Software Archive
Read-only legacy content
17061 Discussions

NTPd on IoT Dev Kit image for galileo

Gowri_S_
Beginner
559 Views

Hello

 

Whats the best way to get ntp installed on the IoT dev kit linux image for galileo?

It doesnt seem to be on the package list visible through "opkg list"

Are there alternatives to ntpd for network time sync?

 

thanks

 

0 Kudos
5 Replies
Matthias_H_Intel
Employee
559 Views

- connman has a sort of "ntpd light" built in

- rdate should come with the Galileo image as well

0 Kudos
Gowri_S_
Beginner
559 Views

Thanks. I couldnt find the right commands for connman but rdate worked.

I'm putting the steps here for others

Install the tzdata package as the first step

root@quark00c8dc:/# opkg install tzdata

It would give files for the different timezones as below
root@quark00c8dc:/# cd /usr/share/zoneinfo/
root@quark00c8dc:/usr/share/zoneinfo# ls
Africa	   CST6CDT  Europe  GMT0       MST7MDT	Pacific  Universal    zone.tab
America    EET	    GB	    Greenwich  NZ	ROC	 W-SU
Asia	   EST	    GMT     HST        NZ-CHAT	ROK	 WET
Australia  EST5EDT  GMT+0   MET        PRC	UCT	 Zulu
CET	   Etc	    GMT-0   MST        PST8PDT	UTC	 iso3166.tab

Select the right one for you
root@quark00c8dc:/usr/share/zoneinfo# cd America/
root@quark00c8dc:/usr/share/zoneinfo/America# ls
Anchorage  Caracas  Chicago  Denver  Los_Angeles  New_York  Sao_Paulo

Set it as your timezone as follows
root@quark00c8dc:/usr/share/zoneinfo/America# ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime

Use rdate to sync the system time to the correct time zone
root@quark00c8dc:/usr/share/zoneinfo/America# rdate -s time.nist.gov
rdate: current time matches remote time

check to see its correct!
root@quark00c8dc:/usr/share/zoneinfo/America# date
Sun Oct  5 10:51:45 PDT 2014

 

Then do the steps to add a service based on rdate as suggested in https://software.intel.com/en-us/forums/topic/507062

 

 

0 Kudos
Matthias_H_Intel
Employee
559 Views

are you sure you are using the SD card image from Intel(R) IoT developer kit on https://software.intel.com/en-us/iot/downloads?

- the connman built in "ntpd light" is run automatically

- ntpd is installed there by default 

- tzdata also already installed 

0 Kudos
GOWRI_S_Intel
Employee
559 Views

Hey

Yes I have the official SD card image from there.

I couldnt run ntpd, and the help for connman seems to only provide wifi/bluetooth stuff.

If it was running, it was setting to wrong date. It was also stuck at the wrong date (Sep 3) and it didnt seem to move ahead so I was thinking it wasnt doing any resets from the network.

I got tzdata from the package manager, it wasnt there by default.

Maybe I have a slightly old image, and the opkg upgrade didnt do all the new features by default?

 

thanks

GS

0 Kudos
Matthias_H_Intel
Employee
559 Views

How do you mean "couldn't run ntpd"?

# ntpd 
BusyBox v1.22.1 (2014-08-14 18:40:30 BST) multi-call binary.

Usage: ntpd [-dnqNw] [-S PROG] [-p PEER]...

It might not come with all standard options so possibly if the time skew is too big it will fail as there is no "-g" option, i.e. you'd have to run something like rdate to set an initial date but then it should work to sync the date.

@connman "ntpd": I have seen issues in certain restricted networks. However, at least for me at home it works great - after a short time I have the correct date after booting.

I currently also don't seem to have latest version installed:

# cat /etc/version 

201408151103

 

0 Kudos
Reply