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

Settings vs Shell Commands

Discussion in 'Tomato Firmware' started by hadede, Mar 18, 2009.

  1. hadede

    hadede Addicted to LI Member

    Hi all,

    I noticed following behaviour:
    I have configured the SES button as default, ie. 0-2 sec -> toggle wireless
    Additionally I wanted the router to disable wireless itself at night. So I used the scheduler to place a command.
    I thought, "wl down" would be the right command.
    But now I notice, that the SES button will not activate wireless any more. The only 2 options I have, are either "wl up" or disabling and enabling wireless in the basic networking. Then it will be fine again and the button functionality is restored.

    As I'm not very proof in all these commands, it might be that this "wl down" command goes down deeper and the button will not have any function. I detected the same behaviour, if I disable wireless in the basic network settings, the button will not work too...
    But if I place the command "wl down", wireless will still show enabled in the web interface???

    Can somebody please help me which command is the right one?
    BTW. If someone has got a summary for the most useful/common commands and where to look, this would be pretty helpful for me!

    Best Regards and thank you in advance!
    hadede
     
  2. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    Pressing the button to disable wireless does the equivalent of
    Code:
    nvram set rrules_radio=-1
    radio toggle
    (see line 229 of buttons.c).

    The first command says that the user explicitly turned off the radio (if you had a rule in GUI to disable wireless at a certain time, it won't turn back on if when the rule expires due to this).

    The second command actually performs the actions to disable the wireless, and can be seen here. Though, it's probably just best to use the command above rather than trying to break it down into parts and running those.
     
  3. hadede

    hadede Addicted to LI Member

    Hi,

    I'm not completely understanding this...
    The second command is clear. Simply toggle wireless, that's it...
    But what is the first one exactly good for?
    What do I have to set before toggle wifi?
    And how can I find out, if wifi isn't already disabled to prevent switching it on again?

    Thank you and best regards,
    hadede
     
  4. bigclaw

    bigclaw Network Guru Member

    For the life of me, I can't find "NVRAM SHOW" in the GUI anymore. Was that taken out, or am I hallucinating?
     
  5. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    If you set up a rule in the GUI to automatically turn off wireless for certain time intervals (Access Restrictions->Disable Wireless, btw I think this is what you really what to be doing), then it will turn off wireless at the start of the restriction and turn it back on at the end of the restriction. Turning it back on at the end of the restriction would be a bad thing if you had explicitly turned off wireless using the button . Setting rrules_radio to -1 tells it that we really want wireless off and not to turn it back on at the end of the restriction. Basically, it makes all the different ways of disabling wireless play nicely with each other.
    Well, for the reasons stated above, it's best to set the nvram variable as I said before - though, if you can live with the side-effects of not doing so, that's okay, too.
    If you want to just turn it off, use
    Code:
    radio off
    instead.

    However, it really sounds like you should use the Access Restrictions settings, rather than the scheduler to do what you want, since disabling wireless for certain periods of time is one of the things it's designed to do.
     
  6. SgtPepperKSU

    SgtPepperKSU Network Guru Member

    You can download a dump at Administration->Debugging->Download NVRAM Dump. Was the show ever in the vanilla Tomato builds? I think I remember it being in one of the mods, but I don't ever remember seeing it in regular tomato. Though, I never really look for it, as I usually just open an SSH terminal when I need to see one...
     
  7. bigclaw

    bigclaw Network Guru Member

    Hmm, it may have been in RoadKill's mod then. I used to see it all the time before upgrading to yours. :)
     
  8. occamsrazor

    occamsrazor Network Guru Member

    Yes, I remember the Show NVRam option in the GUI, and also used to use the roadkill mod... perhaps it was a feature only of that mod. It was kind've useful to have it there... not that I understood much of it though :)
     
  9. hadede

    hadede Addicted to LI Member

    I think I got to understand it a bit more, but not completely... anyway...

    Usually I'm connected with cable, so I use wifi only a few days/week for a few hours... So the access restriction is no real option to keep down wifi-on times...

    So if I need wifi, I simply switch it on, but turning off wifi automatically is of course more comfort ;-)

    If I would have the knowledge for this, I would extend the behaviour as follows: Wifi should be turned off after it is idle for a defined time...

    But as long as I don't know for basics yet, "radio off" will be sufficient ;-)

    Thanks!
    hadede
     

Share This Page