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

Tomato shows Connecting after Power Outage

Discussion in 'Tomato Firmware' started by Jamie Ledwell, Dec 30, 2012.

  1. Jamie Ledwell

    Jamie Ledwell Serious Server Member

    Hello,

    Maybe this issue has been addressed, I searched and didn't find it. I have a WRT54G running Tomato 1.28. It works great. The only problem I have is when I experience a power outage the router shows connecting and never connects. I can login and turn off wireless and turn it back on, it then connects. Can this be fixed so it automatically reconnects after a power outage?

    Thanks in advance for your help.
     
  2. Jamie Ledwell

    Jamie Ledwell Serious Server Member

    Help please. Thanks
     
  3. rs232

    rs232 Network Guru Member

    Sorry but the issues is not clear. When you mean "connect" do you refer to the WAN interface (e.g. unable to get a public IP address) or do yo refer to the wireless client trying to connect to the router via wireless?

    Also, do you have an external modem/router that handles the connection?
     
  4. Jamie Ledwell

    Jamie Ledwell Serious Server Member

    Hi rs232,

    Thanks for the reply. Sorry, I wasn't clear. I am using it as a Wireless Client.

    It is wirelessly connected to another router. When a power outage occurs, the WAN connection stays in a 'Connecting' state. To restore it, I go to 'Basic' and disable wireless and then re-enable it.

    Thanks
     
  5. rs232

    rs232 Network Guru Member

    Ok, I have few tomato in wireless mode and never experienced something like this before.
    I would try two things:
    1) try to set the wireless parameter manually e.g. wpa2 instad of wpa/wpa2 and aes instead of TKIP/AES (or whatever you're using as long as it's specific).
    1a) you can try to change setting in advanced/wireless too, but you need to know what you're doing otherwise leave it to the defaults.
    2) I suspect the problem is the router tomato is connecting to:
    If disabling disconneting/conneting manually works do consider writing a little script that pings the router e.g. every 5 min.pings fail: disconnect/reconnect automatically.

    e.g. run in admin/scripts every 5 minutes: (not tested!)
    Code:
    /bin/ping -c 1 192.168.1.1 > /dev/null; if [[ $? != 1 ]]; then ifconfig eth1 down; sleep 3; ifconfig eth1 up; fi
    OR (not tested either)
    Code:
    /bin/ping -c 1 192.168.1.1 > /dev/null; if [[ $? != 1 ]]; then radio off; sleep 3; radio on; fi
    radio off/on
    192.168.1.1 I guess is the IP of the main router, if not change it with whatever it is.

    HTH
     
    Jamie Ledwell likes this.
  6. dc361

    dc361 LI Guru Member

    Great suggestions rs232 - If Jamie is only having this problem at startup (ie .. doesn't periodically get dropped if the power stays on) after trying your other suggestions, I might suggest that the radio off/on script be put in the INIT (administration -> scripts -> init) script which only runs when the router starts. Not as complete as your solution but you don't have a script running every 5 minutes on the router...
     
    Jamie Ledwell likes this.
  7. Jamie Ledwell

    Jamie Ledwell Serious Server Member

    Thank you both for the great replies.

    rs232, I think you are right the problem is related to the other router(a Westel DSL/Router) loosing power. I powered off and on my WRT54G and it reconnected instantly. Tried it a second time and it reconnected instantly. I do not have easy access to the Westel to experiment with it.

    Under normal circumstances, both routers experience power outages at the same time.

    With all this in mind, what do you both suggest?

    Thank you,
    Jamie
     
  8. dc361

    dc361 LI Guru Member

    Jamie,

    rs232's solution is more complete. I suggested the 'one time' approach because I don't like adding extra 'bits' that may cause other unexpected consequences. In this case though, it is simply a ping and status check.

    DC
     
  9. Jamie Ledwell

    Jamie Ledwell Serious Server Member

    Thanks again for the reply.

    I did some experiments with the code. I found the first one is to release and renew the connection, the second one disables and re-enables the radio on the overview page. I have tried both of these proecesses manually after a power outage and it doesn't restore the connection. The only way I can get it to restore after a power outage is to go to the Basic page uncheck the 'Enable Wireless' box, save it, check it and save it again. I don't understand the difference between Radio Off and Enable Wireless Off, but there obviously is a difference. So my questions are:

    How can the code be changed to turn on and off the 'Enable Wireless' on the Basic page?

    My thoughts are to put it in both the INIT section and also schedule it to run every so many minutes. Is that a good idea?

    Just curious, does the code effect performance in any way? Would it be a bad idea to set it to run every minute?

    Thank you,
    Jamie
     
  10. dc361

    dc361 LI Guru Member

    Jamie,

    Try changing to a sleep 10 from a sleep 3 to see if it makes a difference with the radio commands. Also, since the ping command and the script itself does consume some router resource, I think every 5 minutes should be OK.
     
  11. Jamie Ledwell

    Jamie Ledwell Serious Server Member

    dc361,
    The problem isn't the delay. After a power outage clicking Disable and Enable on the Overview page has no effect. The only way I can get it to restore after a power outage is to go to the Basic page uncheck the 'Enable Wireless' box, save it, check it and save it again. Do you or anyone know the command to turn on and off the 'Enable Wireless' on the Basic page?

    Thanks,
    Jamie
     
  12. mvsgeek

    mvsgeek Addicted to LI Member

    I'd try this:

    wl down
    sleep n <---pick a number, say 10
    wl up

    Failing that, from a wired client, open a telnet or ssh session, issue the command

    nvram find wl0

    and make a note of the values. Then uncheck the 'Enable Wireless' box, and save. Go back to your telnet/ssh window, repeat the 'nvram find wl0' command, and compare the results. That should tell you what gets changed by the GUI, and you could then replicate the changes via script.
    Not very elegant I'm afraid, but it might do the trick.

    p.s. I run a 'keepalive' script every 5 minutes on all routers, with no noticeable performance hit.
     
  13. Jamie Ledwell

    Jamie Ledwell Serious Server Member

    Thank you all for the great info.
     

Share This Page