Project

General

Profile

Network Time Applications - NTP PTP

The MitySOM-335x features an on module RTC which depending on your carrier board can also be powered by an external battery to retain the time through outages and power cycles. However some customers may require a network based time sync capability and the following sections describe some information about using either NTP or PTP.

NTP Support

Note: Yocto MDK Release September 2015 already has NTP support. Skip to step 2.

The MitySOM-335x module running the TI image (versions before September 2015) can easily add support for NTP time syncing services. If you have a current development kit/SD card you would follow the following steps to install the NTP service as well as set the system time from the NTP time source once.

1) Install the NTP service using OPKG and other NTP utilities

root@mityarm-335x:~# opkg install ntp
root@mityarm-335x:~# opkg install ntp-utils
root@mityarm-335x:~# opkg install ntpdate

Note that if an error is printed when the ntpd service is run, like below, about the "libgcc_s.so.1" file not being found please copy the file attached to this wiki into the /usr/lib/ directory of your development kit root filesystem.

Starting ntpd: /usr/bin/ntpd: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
done

2) Set the system time from a network time source, in this case we are using an internet NTP source by it's IP address

root@mityarm-335x:~# date
Sat Dec 24 10:48:39 UTC 2011
root@mityarm-335x:~# ntpdate -b -s -u 108.61.194.85
root@mityarm-335x:~# date
Sat Dec  6 02:04:28 UTC 2014

In order to support automatic time syncing you must configure and/or add servers to the /etc/ntp.conf

PTP Support

The AM335x processor can use software PTP to obtain accuracies of approximately 10-15 microseconds. This support can be provided by the ptpd2 daemon.

Please contact your Critical Link representative if you require PTP support for further information.

Time Zone Modification

The filesystem included with the MitySOM-335x Development Kit is setup for UTC based time by default. If an alternate timezone is required please follow these steps to add such support:

  1. With the module/dev kit connected to the internet perform an 'opkg update'
    root@mitysom-335x ~ $ opkg update
    
  2. Install the "tzdata" package to add timezone support to the filesystem
    root@mitysom-335x ~ $ opkg install tzdata
    Package angstrom-version version 1:2009.11-r2.3 has no valid architecture, ignoring.
    Package base-files-dbg version 3.0.14-r89.3 has no valid architecture, ignoring.
    Package base-files-doc version 3.0.14-r89.3 has no valid architecture, ignoring.
    Package base-files version 3.0.14-r89.3 has no valid architecture, ignoring.
    Package sysvinit-inittab version 2.86-r48.3 has no valid architecture, ignoring.
    Installing tzdata (2010b-r5.0.5) to root...
    Downloading http://feeds.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv7a/base/tzdata_2010b-r5.0.5_armv7a.ipk.
    Configuring tzdata.
    
  3. There now should be a "/usr/share/zoneinfo/" directory which contains all of the available timezones
    root@mitysom-335x ~ $ ls /usr/share/zoneinfo/
    /usr/share/zoneinfo/Africa/     /usr/share/zoneinfo/HST
    /usr/share/zoneinfo/America/    /usr/share/zoneinfo/MET
    /usr/share/zoneinfo/Asia/       /usr/share/zoneinfo/MST
    /usr/share/zoneinfo/Australia/  /usr/share/zoneinfo/MST7MDT
    /usr/share/zoneinfo/CET         /usr/share/zoneinfo/NZ
    /usr/share/zoneinfo/CST6CDT     /usr/share/zoneinfo/NZ-CHAT
    /usr/share/zoneinfo/EET         /usr/share/zoneinfo/PRC
    /usr/share/zoneinfo/EST         /usr/share/zoneinfo/PST8PDT
    /usr/share/zoneinfo/EST5EDT     /usr/share/zoneinfo/Pacific/
    /usr/share/zoneinfo/Etc/        /usr/share/zoneinfo/ROC
    /usr/share/zoneinfo/Europe/     /usr/share/zoneinfo/ROK
    /usr/share/zoneinfo/GB          /usr/share/zoneinfo/UCT
    /usr/share/zoneinfo/GMT         /usr/share/zoneinfo/UTC
    /usr/share/zoneinfo/GMT+0       /usr/share/zoneinfo/Universal
    /usr/share/zoneinfo/GMT-0       /usr/share/zoneinfo/W-SU
    /usr/share/zoneinfo/GMT0        /usr/share/zoneinfo/WET
    /usr/share/zoneinfo/Greenwich   /usr/share/zoneinfo/Zulu
    
  4. Ensure that a current 'localtime' file is not present in the /etc/ directory. If so remove it
    root@mitysom-335x /etc $ rm /etc/localtime
    
  5. Create a link between your desired timezone and /etc/localtime. In this case we are using the "EST" timezone.
    root@mitysom-335x /etc $ ln -s /usr/share/zoneinfo/EST /etc/localtime
    
  6. Reboot your system
    root@mitysom-335x /etc $ reboot
    
  7. Confirm that the timezone has been changed by issuing the "date" command.
    root@mitysom-335x ~ $ date
    Sun Dec 25 05:54:45 EST 2011
    

Go to top
Add picture from clipboard (Maximum size: 600 MB)