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

Linksys WRTSL54GS on Tomato Firmware v1.27.8747 ND USB: Script Help Required

Discussion in 'Tomato Firmware' started by Aquafire, Jul 7, 2010.

  1. Aquafire

    Aquafire LI Guru Member

    Hello,

    Continuing the effort to trigger the power cycling shut down for the DSL modem via a router script as mentioned in my earlier post below.

    http://www.linksysinfo.org/forums/showpost.php?p=365239&postcount=13

    The power circuit socket board (with appropriate relay and transistor) is almost finished.

    Have read the original article in the earlier post (mentioned above) to make a shell script to control the GPIO pins of Linksys WRTSL54GS.

    This can be added to the Administration -> Scheduler section as a custom script to be triggered every minute to check the status of the internet connection.

    I have copied the script more or less as similar, and need some help in order to understand the commands used.

    As a sample I have tried to control the state of GPIO ping 5 (SES White Light), which I further plan to use ( to connect a transistor and relay to control state of modem power).

    The script runs correctly in the background as a cron job every minute. If the ping reply is not received from the mentioned IP address then the SES light (in the front of router) turns white and then stays this way.

    Note:
    As a default when the router starts the white light is off, but maybe the internal state of GPIO Pin 5 is enabled. So for commands

    I have the following queries and own understandings, please reply where much clarification / correction is needed :

    1. What are meanings of line no. 3 - 5

    2. If ping is active (DSL connection is up) reply received from the IP (66.102.7.104/www.google.com), then the avg response time would be greater than 1 and maybe nothing will happen. I don't know the meaning of GREP 100% command in line 3.

    3. If a ping is not received then it will disable GPIO pin 5 ( the white light turns on). What does the echo commands 1 and 0 means and why are they needed (they just add a 0 or 1 in a text file in the mentioned file in the JFFS partition).

    4. What does the sleep 1 command means and what sleep time does it denotes.

    5. I guess we manually have to control the state of the relay to switch OFF and then ON (to power cycle the DSL modem). But even in the original script and (of course in my copied version) there is only one command for GPIO disable 5 which can presumably turn OFF the relay to shut down power.

    How to turn the power back ON (maybe after a delay of 10 seconds). The status of script should be reset again to keep checking the connection for any subsequent connection failures to repeat the same procedure.

    6. The script is reporting the time/date of Modem failures in a text file (which maybe called in a router hosted web page to show log , with a custom button to manually reset the modem), as done by the original author.

    7. How can we also add the time/date of Modem Startup (after a failure) to the same text file.

    Anything else to improve the efficiency of the script.

    Thanks a lot for reading through and any possible guidance.
     

Share This Page