Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

All about firmwares for routers. Support for RouterTech firmwares is here too.
Post Reply
AlterEgo
Novice
Novice
Posts: 17
Joined: Thu Sep 25, 2008 6:56 pm

Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

Post by AlterEgo » Tue Sep 21, 2010 4:08 am

Hello,

I am running Aztech DSL600E DSL Modem with IP 192.168.1.1 (in bridge mode) with the following firmware information :

Linux RouterTech.AR7RD 2.4.17_mvl21-malta-mips_fp_le #1 Wed Jul 23 00:24:31 BST 2008 mips unknown
BUILD=RouterTech_3.6.0D_20080723_2.60
VERSION=3.6.0D-RouterTech-1P-PSBL
BOARD=AR7RD

It is connected to the WAN port of a Linksys WRTSL54GS IP 192.168.10.1 which is acting as the gateway / DHCP for the rest of the network. I can access the modem interface just by writing its IP address in the web browser.

It is happening quite often these days that my internet service locks up for no reason at random intervals and modem thus hangs. Sometimes it disconnects and never connects again (the connection light keeps blinking). The remedy to such problems are usually a cold boot (turning off and on the modem) or doing a software reset using the System --> Reboot Router --> Yes Reboot Now (Button).

Since I am not usually at home to monitor this, I need to write a script in the Linksys router interface that if it detects the disconnection to internet it should reboot the router and wait for "x" amount of time before checking and ensuring that connectivity has been restored.

So based on the collective experience of the folks here, can some please guide me a script to preferably Turn OFF and ON (Cold Boot) or at least do the Reboot Router (Soft Boot) of the DSL modem to remedy the situation.

It maybe something like which I have already tried, which is, keep checking the ping connectivity to any website (google.com for example) every "x" amount of time, if the ping response is not received (maybe within y" amount of time), then run the DSL modem reboot script and wait for it to come back.

I m novice in Linux and in router configuration. However I know where to write script in Linksys Interface (Tomato Firmware v1.27.8747 ND USB vpn3.6), I just need the right code to be placed over there.

Thanks for reading and replying.
User avatar
thechief
RouterTech Team
RouterTech Team
Posts: 12067
Joined: Wed Feb 01, 2006 10:22 pm
Location: England, the Centre of Africa
Contact:

Re: Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

Post by thechief » Tue Sep 21, 2010 9:17 am

The Chief: :afro: Be sure to read the Firmware FAQ and do a Forum Search before posting!
No support via PM. Ask all questions on the open forum.
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

Post by mstombs » Tue Sep 21, 2010 9:51 am

If its the DSL light that flickers it would be worth experimenting with different versions of RouterTech firmware which will have different DSL drivers, I don't recall what the 1-port 2MB flash used in 2.6.

Checksync wouldn't work if the modem in "PPPoE" full bridge mode, as the modem won't have direct access to the internet - but then special firewall commands needed to get access to the modem. In "PPPoE" full bridge mode the username and password are entered into Tomato, not the modem. Not being in this mode on a ram challenged modem could be the root cause of such problems.
AlterEgo
Novice
Novice
Posts: 17
Joined: Thu Sep 25, 2008 6:56 pm

Re: Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

Post by AlterEgo » Tue Sep 21, 2010 5:57 pm

mstombs wrote:If its the DSL light that flickers it would be worth experimenting with different versions of RouterTech firmware which will have different DSL drivers, I don't recall what the 1-port 2MB flash used in 2.6.

Checksync wouldn't work if the modem in "PPPoE" full bridge mode, as the modem won't have direct access to the internet - but then special firewall commands needed to get access to the modem. In "PPPoE" full bridge mode the username and password are entered into Tomato, not the modem. Not being in this mode on a ram challenged modem could be the root cause of such problems.
So any other fruitful ideas that can really work. It would be a big help.

In my tomato interface (Linksys WRTSL54GS) I have already written a script to check the connectivity, I just need to hard-reset or soft-reset the modem when the condition occurs. The script is as follows :
#!/bin/sh
DATE=`date`
x=`ping -c1 66.102.7.104 2>&1 | grep 100%`
if [ ! "$x" = "" ]; then
gpio disable 5; sleep 5; gpio enable 5;
PRINT="Modem Failure and Restart (5 second delay) @ "$DATE;
echo $PRINT >> /jffs/modemlog.txt;
fi
I am basically controlling the Linksys GPIO PIN 5 (as a test example ) and printing the modem hang up failure frequency in a text file for later reference. I call this script as ping_check.sh which is called by a cron job after every minute.

Ideas are awaited.

Thanks.
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

Post by mstombs » Wed Sep 22, 2010 9:53 am

What does the modem log say when you lose connection - if the modem is actually crashing you would need a hardware watchdog to power cycle, but I've even seen a mod for that over at Linksysinfo. If the modem is actually crashing you won't be able to see the log - but do post a copy of the system diagnostics from the current version of RouterTech and let us see if we can see a configuration problem - it is not normal!
AlterEgo
Novice
Novice
Posts: 17
Joined: Thu Sep 25, 2008 6:56 pm

Re: Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

Post by AlterEgo » Thu Sep 23, 2010 7:59 am

I have searched the modem firmware directory for this file.

Can someone please guide where is this shell script located, or maybe just post the contents of this script so I can explore it.

Thanks.
mstombs
RouterTech Team
RouterTech Team
Posts: 3753
Joined: Wed Jan 10, 2007 11:54 pm

Re: Script :Cold-ReBoot or Soft-ReBoot the Modem with RT 2.4.17

Post by mstombs » Thu Sep 23, 2010 9:39 am

Look on your RouterTech router under /usr/local/bin/

The scripts are built-in, and there's more than one and cron used to schedule. At the heart there is a ping script which expects that the modem can reach google (or other user defined), and if all else fails a reboot is requested. I'm pretty sure ping would always fail from a bridged modem.
Post Reply