Announcement

Collapse
No announcement yet.

Atomic Clock Sync Discussion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Atomic Clock Sync Discussion

    This is in reference to
    Elmo's Atomic Clock Sysnc script

    Elmo,
    I tried to test out your script as it sounds like a good idea. HS cannot go to the web sight you call for in your script and the script fails. I tried to go to the websight manually and it never connects.
    Any ideas?
    Thanks

    Dan-O
    My system specs are in my profile
    (Current beta as always)



    Dan-O
    HomeSeer contributor since summer 1999, yes 1999!

    #2
    There are also freeware programs that will run, synchronize, and quit when finished. Automachron is a good example.

    Comment


      #3
      I had to change the format of the strData, because it was returning the seconds, and MSDOS window said Invalid Time Format. Also change the universal time to your region. Mine is -8 Here is what I did.
      ............................................................
      '
      ' This script will sync your PC's time to the atomic clock from NIST/USNO - http://www.time.gov/
      ' Send your ideas/complaints/etc to larrymull@lunacomp.com
      '
      '
      sub main()

      dim strData
      dim intPos
      dim objShell
      dim data

      ' get the non-java webpage for my timezone, so insert your specific timezone URL here
      strData = hs.GetURL("http://www.time.gov/timezone.cgi?Pacific/d/-8",vbNullString,false,80)

      ' scan for the text that just happens to preceed the time
      intPos = InStr(1, strData, "")

      '<B>!!!!!! I modified it here, loose the seconds, and added "data" declaration !!!!!

      strData = mid(strData, intPos + 3, 5)

      data = strData

      'msgbox data
      ' shell to the command line and set the time old-school style
      set objShell = CreateObject("WScript.Shell")
      objShell.run objShell.ExpandEnvironmentStrings("%comspec%") & " /c time " & data
      set objShell = nothing

      end sub
      ........................................................
      The "data" declaration is probably not needed. It sets the time on my win98 box........JG

      The Garage
      3.0.0.548: HS3PRO - 3.0.5.10: AIAlert - 2.1.1.0: APIWeather - 2.0.64.0: BLBackup - 2.0.45.0: BLLAN - 2.0.37.0: BLRoombaWifi - 1.0.0.3: DevLog - 1.2.5.15: KeyPad - 3.0.2.25: NetCAM - 0.0.0.52: Pushover 3P - 3.0.0.5: SendVFD - 1.0.0.3: Tiles - 3.0.11.0: Z-Wave

      Comment


        #4
        Yup,
        I already use one.
        I liked Elmo's idea of not having another app. running but still be able to sync the clock regularly.

        If it matters, I'm on a W2K Pro Box.

        Dan-O
        My system specs are in my profile
        (Current beta as always)
        Dan-O
        HomeSeer contributor since summer 1999, yes 1999!

        Comment


          #5
          That's what I'm saying.... automachron can be started from HS and then it completely exits when it's synched. So, you're only running another app for a few seconds every time HS starts it.

          Comment


            #6
            Windows 2000 and XP both have their own built in time sync client. It appears that Windows XP by default syncronizes to time.windows.com which is usually 1 minute off - go figure right...

            Try the following from DOS prompt:

            net time /querysntp

            net time /setsntp:tick.usno.navy.mil

            I believe that you will need the SNTP port open. I think it is TCP 123...
            HomeSeer 2, HomeSeer 3, Allonis myServer, Amazon Alexa Dots, ELK M1G, ISY 994i, HomeKit, BlueIris, and 6 "4k" Cameras using NVR, and integration between all of these systems. Home Automation since 1980.

            Comment


              #7
              Krumpy,
              I get a 'The command completed successfully.' message in the DOS prompt but no clock change. I opened port 123 on my router with no changes.

              Mike,
              I DL'd autochron and will set it up and try it.
              Thanks.

              Dan-O
              My system specs are in my profile
              (Current beta as always)


              Update,
              Mike, that app was exactly what I wanted. It works great. No more icons in my system tray. [img]/infopop/emoticons/icon_smile.gif[/img]
              Thanks again.

              [This message was edited by Dan-O on Sunday, 17 November 2002 at 01:53 PM.]
              Dan-O
              HomeSeer contributor since summer 1999, yes 1999!

              Comment


                #8
                If you ran the net time /setsntp:xxx command then it should have set the sntp server. Make sure that you have the Windows Time service started. You can also run the following command manually:

                w32tm -v

                Depending of which version of the operating system you're running, it should start contacting the time server and synchronize the clock.
                HomeSeer 2, HomeSeer 3, Allonis myServer, Amazon Alexa Dots, ELK M1G, ISY 994i, HomeKit, BlueIris, and 6 "4k" Cameras using NVR, and integration between all of these systems. Home Automation since 1980.

                Comment


                  #9
                  Dan-O, can you not hit the site www.time.gov?

                  Jebus, I posted a new version that should fix up problems with the Win9x systems. Someone else was having a problem w/it. My feel was that the AM/PM format was't liked, so I changed it to 24 hr format. I don't have a Win9x system handy but a 98 user said it worked for him. Anyway, the fix will retain resolution to the seconds. If you like, give it a shot and see if it works.

                  Krumpy, interesting info there - I'll have to check that out. There's always more than one way to skin a cat! (just don't mention that to the cat!)

                  Comment


                    #10
                    Nope, I still can't browse to the sight.

                    The Autochron program started popping up now even though I have the shut down box when done checked.
                    I have to manually exit it every time.

                    I will have to tinker with it when I have more time.
                    Thanks for the info.

                    Dan-O
                    My system specs are in my profile
                    (Current beta as always)



                    Dan-O
                    HomeSeer contributor since summer 1999, yes 1999!

                    Comment


                      #11
                      Hi,
                      This has worked well for setting the time.

                      http://www.arachnoid.com/abouttime/


                      Stuart

                      Comment


                        #12
                        Krumpy, that's good stuff there! Looks like I wrote a script I don't need! That worked like a champ.

                        Dan-0, I dunno what's going on w/your box! You should be able to browse to the time.gov site. Try a different browser. I'm an IE'er but I have Netscape on hand in case IE bonks. Regardless, you're probably not gonna get the script working if IE can't hit it. But hey, since you'er on W2k, forget my script and Autochron or whatever and follow Krumpy's method. It's slick - looks like it measures latency several times and sets the clock accordingly. Also, it will set your date as well as time, plus it knows your timezone from your local settings. Totally rocks! [img]/infopop/emoticons/icon_biggrin.gif[/img]

                        Comment


                          #13
                          Guess I am overdoing it but using the internet, dial-up or radio is ok but there is some latency that will come into play with these methods. GPS antennas are cheap now. I took a 15 dollar mobile active antenna (Ebay) and glued it on some PVC. Using a readily available GPS module (very cheap also ~15-50) with a serial connection gives me what I consider pretty accurate time. Running NTP (free-public domain) gives me what I would consider pretty accurate time for less than $50 with no scripting necessary. Can post a picture if anyone is interested.

                          [This message was edited by Pete on Wednesday, 20 November 2002 at 12:33 AM.]
                          - Pete

                          Auto mator
                          Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
                          Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
                          HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

                          HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                          HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                          X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                          Comment


                            #14
                            Elmo,
                            I tried IE, Netscape and Opera, and on different machines. None will connect.

                            I will try the Win2K stuff. My HS box is sacred ground and I lately don't like to upset it until the week-end so if I 'screw someting up' I have time to fix it.

                            Dan-O
                            My system specs are in my profile
                            (Current beta as always)



                            Dan-O
                            HomeSeer contributor since summer 1999, yes 1999!

                            Comment


                              #15
                              Why not go to the source:

                              http://www.worldtimeserver.com/atomic-clock/

                              I have been using this for 3 years. Its free and very very small.

                              -Rupp
                              ...One Nation Under GOD, Indivisible, With Liberty And Justice For All.
                              💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                              Comment

                              Working...
                              X