5 Replies Latest reply on Mar 26, 2015 12:57 PM by ForumMigrationAdmin

    NTPd on IoT Dev Kit image for galileo




      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?



        • 1. Re: NTPd on IoT Dev Kit image for galileo

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

          - rdate should come with the Galileo image as well

          • 2. Re: NTPd on IoT Dev Kit image for galileo

            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


            01root@quark00c8dc:/# opkg install tzdata






            03<b>It would give files for the different timezones as below</b>



            04root@quark00c8dc:/# cd /usr/share/zoneinfo/



            05root@quark00c8dc:/usr/share/zoneinfo# ls



            06Africa     CST6CDT  Europe  GMT0       MST7MDT  Pacific  Universal    zone.tab



            07America    EET      GB      Greenwich  NZ   ROC  W-SU



            08Asia       EST      GMT     HST        NZ-CHAT  ROK  WET



            09Australia  EST5EDT  GMT+0   MET        PRC  UCT  Zulu



            10CET    Etc      GMT-0   MST        PST8PDT  UTC  iso3166.tab






            12<strong>Select the right one for you</strong>



            13root@quark00c8dc:/usr/share/zoneinfo# cd America/



            14root@quark00c8dc:/usr/share/zoneinfo/America# ls



            15Anchorage  Caracas  Chicago  Denver  Los_Angeles  New_York  Sao_Paulo






            17<strong>Set it as your timezone as follows</strong>



            18root@quark00c8dc:/usr/share/zoneinfo/America# ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime






            20<strong>Use rdate to sync the system time to the correct time zone</strong>



            21root@quark00c8dc:/usr/share/zoneinfo/America# rdate -s time.nist.gov



            22rdate: current time matches remote time






            24<strong>check to see its correct!</strong>



            25root@quark00c8dc:/usr/share/zoneinfo/America# date



            26Sun 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

            • 3. Re: NTPd on IoT Dev Kit image for galileo

              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

              • 4. Re: NTPd on IoT Dev Kit image for galileo


                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?




                • 5. Re: NTPd on IoT Dev Kit image for galileo

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


                  1# ntpd



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






                  4Usage: 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:


                  1# cat /etc/version