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

Ethernet bridge mode and clock on slave?

Discussion in 'Tomato Firmware' started by jsmiddleton4, Jan 10, 2012.

  1. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Just noticed that in Ethernet Bridge Mode my slave router is not showing time. E3000 with latest 7494. In WDS the slave pickes up the time. Have everything set as before in the slave in gateway and dns fields.
     
  2. Badders44

    Badders44 LI Guru Member

    I just set a time server on the slave via "Basic"/" Time".
     
  3. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Thanks but I'm not sure what you are saying. I have a time server set in basic time. That is how when in WDS mode the slave gets the time. Same is true for ethernet bridge mode. Tried different time servers to see if that was the issue, different settings in when to check for the time, etc. Also tried different settings in the DNS fields to see if that was the problem. Nothing worked. Again in WDS worked fine with my original settings.
     
  4. ntest7

    ntest7 Network Guru Member

    Time setting problems are almost always more basic connectivity problems.
    Can that router ping the internet (eg. google.com) from the tools menu or an ssh prompt?
     
  5. jsmiddleton4

    jsmiddleton4 Network Guru Member

    No problem connecting to router. Being its a ethernet bridge slave I just need to know if this is normal behavior for them. Again in WDS mode that same slave picks up time no problem.
     
  6. jsmiddleton4

    jsmiddleton4 Network Guru Member

    What are the telnet set commands for setting time manually? I'm looking but so far no luck...
     
  7. mvsgeek

    mvsgeek Addicted to LI Member

    date -s MMDDhhmm
     
  8. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Thanks but that would not set the year. This confusing.

    date
    date [OPTIONS] [+FMT] [TIME]
    Display time (using +FMT), or set time
    Options:
    [-s] TIME Set time to TIME -u Work in UTC (don't convert to local time) -R Output RFC-822 compliant date string -I[SPEC] Output ISO-8601 compliant date string SPEC='date' (default) for date only, 'hours', 'minutes', or 'seconds' for date and time to the indicated precision -r FILE Display last modification time of FILE -d TIME Display TIME, not 'now' -D FMT Use FMT for -d TIME conversion
    Recognized TIME formats:
    hh:mm[:ss]
    [YYYY.]MM.DD-hh:mm[:ss]
    YYYY-MM-DD hh:mm[:ss]
    [[[[[YY]YY]MM]DD]hh]mm[.ss]

    I tried all sorts of formats but always failed to be able to set year.

    Then I found this and I put in the right numbers for today/year/time and it worked without the -s.

    date 011214012012.00

    Setting Date & Time

    1. Get the root access thru Softroot
    2. Install the Busybox
    3. Set the system date/time
      adb shell /data/local/busybox date MMDDhhmmYYYY.ss
      Example: if you want to set it to 2010-01-22 13:59:27 you will use
      adb shell /data/local/busybox date 012213592010.27
    4. Set your hardware clock using system time (otherwise your setting get lost after reboot):
      adb shell /data/local/busybox hwclock -w
    ps. Please note that the date and time has to be UTC date/time (do not set to your local time). For example, my local time is 11:00am and my time zone is UTC+7, I have to set time as 04.00am.

     
  9. jsmiddleton4

    jsmiddleton4 Network Guru Member

    This as well worked but the set hardware clock did not.

    How to set the system date

    When the FOX Board starts without the RTC circuitry its system date is set at 1 January 1970.
    To manually change the system date use this command:
    # date MMDDHHMMYYYY
    where MM is the month (01-12), DD is the day (01-31), HH is the hour (00-23), MM is the minute (00-59), YYYY is the year (i.e. 2005). By example to set 11:26 of December 13th 2005 type:
    # date 121311262005 Tue Dec 13 11:26:00 UTC 2005
    System date is usually based on periodic hardware interrupts. The kernel maintains the current time and advances it at every interrupt. The alarm clock functionality, however, relies on the interrupts and cannot provide a higher accuracy than the interrupt frequency, which is 10ms. (Clock Granularity).


    How to set the Real Time Clock date

    When the FOX Board is connected to a RTC circuitry and the RTC support is enabled it read the clock from the RTC chip at startup.
    ... ds1302: RTC found. ds1302: SDA, SCL, RST on PB0, PB1, GENIO2 rtc_time : 16:51:18 rtc_date : 2007-07-15 ...
    To change the date inside the RTC chip set the system date then type:
    # hwclock -w
    To read the RTC date type:
    # hwclock -r
     
  10. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Would be nice to have a little faq for setting time/date/clock via telnet and how to save it to hardware clock.

    I'm sure I didn't get some command logic/wording right.
     
  11. ntest7

    ntest7 Network Guru Member

    Can the router that's having trouble setting the time ping hosts on the internet?
     
  12. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Not as a slave ethernet bridge.

    Edit: I was incorrect. I am able to ping from it to other places.
     
  13. ntest7

    ntest7 Network Guru Member

    That's why it can't set the time.
     
  14. jsmiddleton4

    jsmiddleton4 Network Guru Member

    I was incorrect. I just pinged google's dns IP, etc., just fine.
     
  15. ntest7

    ntest7 Network Guru Member

    If you're able to ping an IP, use some timeserver's IP in the custom time settings.
     
  16. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Not sure if reboot will clear the time setting now that I've set it manually via telnet. So may not be able to test it. However the point is still valid. Need a simple FAQ for how to set date/time via telnet.

    And there is still no explanation as to why it works with WDS but with settings the same in ethernet bridge mode time being picked up by time server is not working. Something is different between the two modes.

    Rebooting does clear time. However time is not set by any means including manually adding time server IP. I just rebooted and checked.
     
  17. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Have used every possible combination of settings in DNS screen, gateway and dns field screens in Basic Setup, etc., all with no positive outcome. Setup WDS mode and slave gets time before I can even check to see if its getting the time. In Ethernet Bridge Mode despite being able to ping from slave, no time settings are returned to the slave router. Have to set it manually. Which is fine and IF that is a limitation of ethernet bridge mode that again is what it is. However it would be nice in ethernet bridge mode if there was a place in the Time screen to manually enter time OR a simple FAQ on how to set date/time via telnet.

    While I am not sure given the nature of these different modes this could be a small bug, bug probably not right word, and maybe someone can look at why Time doesn't work for slaves in bridge mode?
     
  18. ntest7

    ntest7 Network Guru Member

    The command ntpsync uses the defined time servers. What if you call the ntpsync command directly?
    ntpsync

    It should display the current time and a delta if there was an adjustment, or "no change needed". It's kind of short on diagnostics; if it doesn't work you'll probably get nothing.

    Or what if you call the ntpc tool directly? This requires a hostname, but will give you a diag message if it fails.
    ntpc somehost.tld

    Setting the date manually is trivial with the standard unix date command:
    date -s YYYYMMDDhhmm

    ie. 2012, Jan 13, 2:43pm would be:
    date -s 201201131443
     
  19. jsmiddleton4

    jsmiddleton4 Network Guru Member

    While I appreciate your input nt... I have to wonder if you are actually reading my posts.

    I'll try the command.

    the -s command does not work. As stated it only works if you just use date MMDDhhMMYYYY.
     
  20. ntest7

    ntest7 Network Guru Member

    Yes, I read your posts. Do you read mine?

    I have an E3000 with
    Tomato Firmware v1.28.7494 MIPSR2-Toastman-RT K26 USB VPN
    and the date command works exactly as I described. Just checked again to be sure. I have another E3000 with Victek RAF tomato on it, and a WRT-54GL with stock 1.28; both also uses "date -s". Also checked an old wrt-54gs(v1) with stock 1.21, and another wrt-54gl with a recent toastman mini; all them use "date -s".

    Still, try the ntpsync and ntpc commands and see if that gives you any new info.
     
  21. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Good for you nt... You are making the mistake of assuming because something works for you it should work for everyone.

    Did try ntpsync. Did nothing via telnet. If its in the firmware internal command set I'm thinking it needs more than just that command. It probably needs a time server in the command line.

    Thanks for your time. I'm done with trying things. If someone who is coding the firmware and playing with the git's would like to look at the issue with time and ethernet bridge mode I sure would appreciate it.

    For now I'll just set it via telnet with the commands that I have found to work for me on my E3000.

    "Time setting problems are almost always more basic connectivity problems."

    And you know for sure the slave in ethernet bridge mode is suppose to pick up time?
     
  22. ntest7

    ntest7 Network Guru Member

    I'm still waiting for you to demonstrate it's not a connectivity problem.

    ntpsync reads servers from nvram; if it doesn't work, it doesn't give any output. ntpc expects a server on the command line and will report connection errors. Maybe there's a reason I asked you to do both.

    Good luck solving your problem.
     
  23. ntest7

    ntest7 Network Guru Member

    I've set up a duplicate of your system to attempt to get to the bottom of this issue.

    I'm using an E3000 with toastman v1.28.7494 MIPSR2-Toastman-RT- K26 USB VPN -- same router and firmware version you're using. You didn't say if you have the VPN version, but that shouldn't matter. If you report the exact build you're using I'll be glad to test it. It's possible that one specific build is bad.

    The E3000 router is set to Wireless Ethernet Bridge mode with a single client connected to it via ethernet.

    The E3000 connects to the main router using the 2.4GHz radio and WPA2/AES with Wireless network mode set to Auto. The 5GHz radio is disabled.

    The router has a static IP address (192.168.1.11), and the default gateway and Static DNS are set to the main router (192.168.1.1)

    Bottom line is everything works as expected. The router gets time automatically using the standard Basic/Time settings.

    In particular, I am unable to duplicate the unusual "date" behavior you reported earlier. On this router, in wireless ethernet bridge mode, "date -s YYYYmmddhhmm" sets the time as expected with no errors, just like it does in any other mode. Also, the command "ntpc us.pool.ntp.org" sets the time correctly from the command line.

    It's obvious that your firmware is executing a different date command than what is built into toastman tomato. The most likely cause of this is old leftover cruft in your flash.

    I strongly suggest you do a 30-30-30 reset of the router. Likely that will get rid of whatever gremlin is stuck in your flash and get you back working without all the workarounds. If that doesn't fix it, try downloading a slightly different firmware build and then do a 30-30-30 reset.

    There is no problem with Wireless Ethernet Bridge mode.
     
  24. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Sorry but there is. Went through a whole bunch of stuff to get a script to work on it. Have reset my router many times. My 2.4 ghz channel is set to AP modes. 5 ghz is the bridge channel. So your test and my setup are apples to oranges. But thanks for trying. Your main router is it another E3000?

    You might have narrowed the situation down however to it being an issue with the 5ghz channel being the bridge mode however.
     
  25. jsmiddleton4

    jsmiddleton4 Network Guru Member

  26. ntest7

    ntest7 Network Guru Member

    OK, put another E3000 in as the main router and reconfigured to use 5GHz as the wireless ethernet bridge and set 2.4ghz as a standard AP. Powered off and back on; time came right up. Just for fun I tried with QoS off and on; time works both ways. Any other settings to try?

    If you've already done the 30-30-30 thing you might try flashing another build. There is obviously something wrong with the software running on your router, as evidenced by the oddball "date -s" command errors.
     
  27. jsmiddleton4

    jsmiddleton4 Network Guru Member

    List all your settings in the slave, router vs. gateway, stuff like that.

    Any static assigned IP's in the master?
     
  28. Planiwa

    Planiwa LI Guru Member

    FWIW, I'd like to contribute a couple of data points about the date command on Tomato Busybox --

    1. Contrary to the "help" text, the 3 listed "Recognized TIME formats" are not the only ones. The old Unix format works as well, e.g.: date -u 021103082012

    2. Yesterday Mr. Middleton reported that the following command worked for him:
    date -u -s 201202110308
     
  29. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Yep. I linked to our thread. I'll be glad to try nt...'s settings in both the slave and the master.
     
  30. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Reconfigured bridge to 2.4 channel, still no time in slave.
     
  31. mpegmaster

    mpegmaster Addicted to LI Member

    Slave has the same Gateway IP as does the Main Gateway IP?
     
  32. ntest7

    ntest7 Network Guru Member

    Does the ntpc command work for you? Hopefully it will at least give a useful error. From an ssh or telnet prompt:
    ntpc us.pool.ntp.org
     
  33. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Switched to WDS mode and time reports to slave perfectly.
     
  34. jsmiddleton4

    jsmiddleton4 Network Guru Member

    MP...

    Yep. And in DNS field of the server as well. All is setup properly regarding gateway and dns fields in the slave.
     
  35. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Was hoping to have some insight on nt.... settings this morning to compare his to mine and give his a try.
     
  36. ntest7

    ntest7 Network Guru Member

    I'm using extremely basic settings...

    Main router E3000 Victek RAF 1.28.9007 VPN-Nocat
    LAN IP 192.168.1.1, gateway and DNS set as required for WAN.
    The main router has no port forwarding, QoS or firewall rules. Both 2.4ghz and 5ghz are set to access point mode, WPA2/AES. 2.4ghz is set "g only", 5ghz is set "n only". No static DHCP rules or any other rules referring to the slave.

    Slave router,E3000 Toastman 1.28.7494 USB VPN
    LAN static IP 192.168.1.11, gateway 192.168.1.1, DNS 192.168.1.1
    2.4ghz Wireless Mode Access point, Network Mode Auto, Security WPA2/AES
    5ghz Wireless mode Wireless ethernet bridge, Network mode Auto, Security WPA2/AES
    All other settings are at the firmware defaults, no firewall, QoS or routes set.

    Switching which band is the bridge and access point makes no difference. Disabling security makes no difference.
     
  37. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Slave set to gateway or router? RIP settings? What are your dhcp/dns options set to? In the master you have no static ip addresses set? Can you set a few like for a laptop, desktop, etc., then reboot the slave? Both of my bands are set to Auto. I have nothing else set, no qos, no port forwarding, etc. What are your time settings/server?

    Edit: If you setup a static DHCP it would be best to do so for one of the slave attached clients.
     
  38. ntest7

    ntest7 Network Guru Member

    On the slave:
    Advanced->Routing: Gateway mode, RIP disabled
    Advanced->DHCP/DNS: use internal DNS & prevent rebind are checked; all others unchecked.
    These should all be the defaults; I don't think I've changed settings on any of the Advanced->* pages.
    I'll repeat that in Basic->Network LAN section, the gateway and static DNS are set to 192.168.1.1 (pointing to the master router).

    (on both routers) Basic->Time: UTC-7 Mountain; auto daylight; auto update every hour; Time server "US".
    Works correctly with other time zones and time servers too.

    I set two static IPs on the master; no effect on the slave.
     
  39. jsmiddleton4

    jsmiddleton4 Network Guru Member

    What are your settings for same in Master? Were the static DHCP's slave attached clients? My settings in gateway and dns fields in the slave are correct. You connected to web via dhcp, dsl, etc.?

    Just tried the old standby 7483.2 after full reset, same results. No time at slave.

    Even if you haven't changed anything on any of the advanced pages I still need to know what your settings are so I can compare apples to apples.

    Example: I do not have prevent dns rebind checked in my slave. Am changing and rebooting after I double check all other settings.

    Also I use my wan port in the slave as a lan port. Do you have it checked in Network setup and then in DNS, use user entered gateway IF wan port disabled? Something like that.

    Sorry one more thing. In your master do you manually enter DNS like for Google, OpenDNS, or do you let your ISP provide it?
     
  40. jsmiddleton4

    jsmiddleton4 Network Guru Member

    My humble opinion is the problem lies in the master and it has something to do with having several static dhcp's assigned to clients that are slave attached.
     
  41. Planiwa

    Planiwa LI Guru Member

    If I were the problem owner, I would try to find the minimalist (least complex and least non-default) setup that has the problem.
     
  42. ntest7

    ntest7 Network Guru Member

    I set up three clients with static IPs connected to the slave; two wired and one wireless. No change; slave's time is still set correctly on bootup.

    I set the basic->network "use wan as lan port", and plugged a client in there. No change; still works.

    I'm pretty sure the Advanced->DHCP/DNS "use user entered gateway if wan is disabled" box controls behavior of the DHCP server, determining what gateway is handed to clients. Since the DHCP server isn't used in wireless ethernet bridge mode I wouldn't expect this to matter. Regardless, I tried it both ways and it didn't make a difference; time is still set.
     
  43. ntest7

    ntest7 Network Guru Member

    Easy enough to test. If the master is blocking it somehow, then ntp shouldn't work on any of the clients. On linux, execute "ntpdate -d us.pool.ntp.org". On windows, go to the date & time properties, Internet Time tab, (on Win7 click the Update Settings button), and click the Update Now button.

    If this works on any client, it's unlikely the master is the problem.
     
  44. jsmiddleton4

    jsmiddleton4 Network Guru Member

    "If this works on any client"

    You mean slave attached clients?

    I have quite a few clients with dhcp assigned IP's. Would be a pain to remove them all but could do that too.

    WDS still works perfectly. Change no settings except as needed to go to WDS. Time gets set almost instantly.
     
  45. jsmiddleton4

    jsmiddleton4 Network Guru Member

    Laptop attached to slave gets time just fine.

    Slave will get time when using one of pl....'s scripts. So the slave can connect when not relying on the code in firmware to request and set time.
     
  46. jsmiddleton4

    jsmiddleton4 Network Guru Member

    "If this works on any client, it's unlikely the master is the problem."

    Don't agree with you. It is still apples to oranges. When manually requesting time from the slave it works. Which is all I prove by doing so with a slave attached client. That does not negate there being something in the firmware that is problematic.
     
  47. ntest7

    ntest7 Network Guru Member

    Your little script grabs the time via an http call, not ntp, so only proves that wget and a non-standard date command work. Which by itself is enough to make your router firmware suspect.
    Does calling ntpc directly work?
    ntpc us.pool.ntp.org

    Even if ntpc doesn't work, it should produce a useful error message.

    I've asked several times what *exact* version of firmware you're using, and also suggested you try another build.
     
  48. jsmiddleton4

    jsmiddleton4 Network Guru Member

    And I've told you what ntpc gives me as an error message and I just posted that I have switched back to 7483.2 as a tried and true firmware. I've asked you several times for exact settings across the board for your two routers and have yet to see answers.

    Thanks for your help nt.... I'll just let it go for now. You seem more bent on proving its something in my setup than tracking down this pesky and annoying little issue. Have a good night.
     
  49. ntest7

    ntest7 Network Guru Member

    I don't see a post from you about ntpc. I also don't see you mentioning that you did a full reset and hand-setup after reverting to an earlier software version. I also don't see you mentioning the exact firmware you're using.

    Both my master and slave routers are at the default settings with only the minimal changes needed for them to talk to each other, and I've posted those few changes repeatedly. I see no need to post default settings since you can get them yourself easily enough.

    You have a problem with multiple firmware versions that so far no one is able to duplicate. A problem with your setup would be a reasonable assumption.
     
  50. Planiwa

    Planiwa LI Guru Member

    I do recall JS saying that ntpc got "cannot resolve", or some such. I think this is worth following up, since it may lead somewhere.

    In the past, JS consistently said: works from the command line but not from script/scheduler.

    except that I don't recall this having been tried with an actual ntp* command. this may be worth pursuing.

    another thing worth trying is to shoehorn the ntpsync entry directly into the crontab file via cru in the INIT script.

    Finally -- I am not sure I have ever seen a minimalist statement of the problem, with clearly stated symptoms and facts.

    I am aware of three possibly orthogonal symptoms:

    1. NTP does not run automatically when set up via GUI
    (i.e. it does not make it into /var/spool/cron/contabs/root)

    2. Enabling a script (to do whatever) (e.g. every minute) does not work. It makes an entry in NVRAM, but not in /tmp, and is never executed.

    3. ntpc fails from the command line. (with "cannot resolve", which may contain a clue, IMHO).

    0. ping does work from the command line, as well as tools/ping.

    EDIT -- searched back to find what JS had written about ntpc results -- couldn't find it. Ran a search, which located exactly one instance: "And I've told you what ntpc gives me as an error message". An exact copy/paste of the command and error message would have been useful instead.

    Like this:

    Code:
    ntpc us.pool.ntp.org
    Trying us.pool.ntp.org [66.187.233.4]:
    
    Time: Sat, 11 Feb 2012 20:55:41 -0500, no change was needed.
    
    Since, as I recall (or imagine) JS got "cannot resolve", perhaps he might try:

    Code:
    ntpc 66.187.233.4
     

Share This Page