1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Router not getting NTP time

Discussion in 'Tomato Firmware' started by Mojonba, Dec 20, 2008.

  1. Mojonba

    Mojonba Network Guru Member

    Hey guys,

    I just installed SgtPepper 1.23 VPN mod and while setting it up and getting certificate errors I found out that my router is not getting the time from the Ntp servers. I dont know if it did before installing the Sgt's mod. Anyway I think everything is set up as it should (Correct Time Zome, Tried with many pools, Rebooted etc.). I dont see anything related to time/ntp in the log. I dont know anywhere else to troubleshot.
     
  2. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    I just reloaded tomatovpn-1.23vpn2.0005 and see it updating the time. That doesn't definitively rule out my build being the problem, but it makes it unlikely. But, let's see what we can figure out.

    If you ssh into the router and run
    Code:
    ntpsync
    what does the output look like?
     
  3. Mojonba

    Mojonba Network Guru Member

    Sgt,

    Here's what is happening.

    After a reboot the time is not updated automatically.
    If I telnet and ntpsync i get a timeout. (Btw the pool is ping reachable)
    If I go into the web gui and change the pool and then do a ntpsync then i get the time.
    I've repeated the process and the same happens everytime.
     
  4. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Hmmm, we need to find what is different when it works and when it doesn't. To start, let's check NVRAM. In your steps, could you do an nvram show and compare them? The easiest way would probably be to copy/paste the data from the telnet shell and use a diff utility to compare.

    If this doesn't find anything, we'll have to see if something has changed in a relevant file.
     
  5. Mojonba

    Mojonba Network Guru Member

    Sgt,

    I did three nvram dump to txt file from the gui and did a compare with a diff utility (after reboot, after pool change, after ntpsync). One thing to notice is that the time doesnot get updated automatically after doing a pool change, you have to manually do a ntpsync. Regarding the nvram comparison, the only thing different between the three files is line 429 that has the pool servers, everything else is the same.

    Thanks for your help and mod.

    Update: Sgt, For troubleshooting purposes I reverted back to an unmodded 1.21 fw with almost none config changes and I am still having the same problem/behavior. Im really out of ideas. Tommorow Im going to load the "buggy" configuration into another wrt54 i have and ill post back. Isnt there a log of the ntp service somewhere? I would imagine that would be better to troubleshoot instead of my way of experimenting with different routers/firmwares and ending up nowhere.
     
  6. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Unfortunately, there isn't much logging by default in that code. But, I've sent you a PM with a link to a build that enables additional debugging information.

    So, I would say you should:
    1. Perform the ntpsync from the shell (doesn't work)
    2. Change the setting (and change it back saving after each)
    3. Perform the ntpsync from the shell (works)
    4. Compare shell output from each

    And, I'm sorry for the delayed response. I thought I posted this earlier today, but I guess it didn't go through.
     
  7. Mojonba

    Mojonba Network Guru Member

    Sgt I Installed your build. After upgrading/rebooting I tried a ntpsync and it immediately got the time. I rebooted a couple of times and same thing happened, it doesnt get the time automatically after a reboot but it does after the first ntpsync. I reverted back to your 2.005 build and behavior's the same. So now the only thing out of the ordinary is that the time is not getting updated automatically after a reboot. Just in case here is a log of shell output of ntpsync just after upgrading.

    Code:
    BusyBox v1.12.3 (2008-12-21 19:08:17 CST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
    # ntpsync
    [0] 0.us.pool.ntp.org
    65.254.214.170
    u = 0x240200ec
    LI = 0
    VN = 4
    mode = 4
    stratum = 2
    poll interval = 0
    precision = 236
    txtime = 127
    rxtime = 127
    ntpt   = 1230000582
    rtt/2  = 0
    diff   = 1230000455
    new    = 1230000582
     
  8. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Weird. Out of curiousity, when was the last time you did an NVRAM clear (after you upgraded to 1.23 variants?).

    Could you check to see if the cron job has been added?
    Code:
    cru l
    (that's a lower case L).

    If so, have you tried waiting a period after the reboot (ie if it is set to check every four hours, check back more than for 4 hours after the reboot). It could just be that the the first one is happening too soon after the reboot before it is able to make a connection.
     
  9. Mojonba

    Mojonba Network Guru Member

    Sgt,

    Here the output from cru 1:

    Code:
    # cru 1 list
    
    Cron Utility
    add:    cru a <unique id> <"min hour day month week command">
    delete: cru d <unique id>
    list:   cru l
    
    I haven't really given it enough time, but I will and report back. I'm going on vacation so I'll be offline for the next week and half but I'll report when I get back. Thx again for your help.
     
  10. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    As mentioned before, the command is
    Code:
    cru l
    with the last character being a lower-case L.
     
  11. Mojonba

    Mojonba Network Guru Member

    my bad

    Code:
    # cru l
    0 * * * * logger -p syslog.info -- -- MARK -- #syslogdmark#
    48 16 18 1 * ddns-update 0 force #ddnsf0#
    5 1 * * * ntpsync --cron #ntpsync#
    #
    
     
  12. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Well, the ntpsync cron entry is in place, and you've seen that ntpsync seems to work every time now. Even though it doesn't appear that ntp works the first time after a reboot, it should update the next time around (it looks like you have it set to update once a day).

    My only guess is that the first one is happening too soon, but I'm not sure what we could do to delay it.
     
  13. Mojonba

    Mojonba Network Guru Member

    Sgt,

    I shortened the time interval and waited to see if it got updated and nothing. So it got pissed off and started reverting to the oldest firmware and taking it from there. I reverted to the original linksys and the time got updated on startup. Then I updated to the oldest tomato on the website 1.18 and then to 1.19 and the time got updated on startup as well. Until I updated to 1.21. There is something different between 1.19 and 1.21 that breaks my time updating. I did revert back between 1.21 and 1.19 to confirm. I know this is strange as I have another router with 1.23 running perfectly. Maybe something different between hardware version. If this is a bug who should I contact?

    Thanks & happy new year
     
  14. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Sorry for the late reply. I was on vacation and didn't see your reply when I returned.

    If you think you've found a bug in Tomato, you should contact the Author, Jon: http://www.polarcloud.com/tomatofaq#how_do_i_send_a_bug_report
     
  15. FRiC

    FRiC LI Guru Member

    When dealing with ntp servers, try using a fixed ntp server, or a known working one. Once in a while pool could point you to a bad server...
     

Share This Page