Thursday, March 29, 2012

Verizon Westell 9100EM scheduled reboot

I recently moved into a new house. Fortunately for me that means I now have a fiber connection to the Internet. Unfortunately, it brings yet another telco provided piece of equipment that leaves alot to be desired.

Today's cheap equipment is the Westell 9100EM. This device is fine, until you want to secure your wireless and turn on WPA. Apparently, using the WPA makes the device rather unstable. In my case, everything seems to work for about a week, and then my wife's MacBook can't communicate with our Xerox printer. Since she is a freelance Graphic Designer, printing is kind of important.

This led me to looking for a way to reboot the router on a regular basis to keep everything happy. But alas, the router software does not provide a way to schedule reboots.

The scripter in me says "I can write a script for that", so I went looking for the easiest way to get it done. The solution came in the form of AutoIt Script. (autoitscript.com). Since I know I'm probably not the only guy out there with this problem, I'll share. This script is written for firmware version 1.03.00.08.


$oIE = ObjCreate("InternetExplorer.Application.1")

If @error Then
MsgBox(0, "", "Error opening Internet Explorer: " & @error)
LogThis("IE Object Open Failed")
Exit
EndIf

$oIE.Visible = 1
$oIE.RegisterAsDropTarget = 1
$oIE.RegisterAsBrowser = 1

;steps to achieve reboot
;18 to advanced
;25 to Yes
;27 to reboot
Dim $routerAddress, $selectAdvanced, $selectReboot, $selectYes,$user,$pass

$user = "usernameGoesHere"
$pass = "passwordGoesHere"
$routerAddress = "http://192.168.1.1"
$selectAdvanced = "{TAB 18}{Enter}"
$selectYes = "{TAB 25}{Enter}"
$selectReboot = "{TAB 27}{Enter}"
$oIE.Navigate($routerAddress)
Sleep(5000)
Send($user & "{TAB}" & $pass & "{TAB}{ENTER}")
Sleep(5000)
Send($selectAdvanced)
Sleep(1000)
Send($selectYes)
Sleep(5000)
Send($selectReboot)
Sleep(5000)
Send($selectYes)
sleep(5000)

$oIE.Quit
$oIE = 0


The next step is to build the .exe and add it to task scheduler for whatever time frame you need. Enjoy!

1 comment:

Chrome.N.Steel said...

Thank you! I often need to toggle the DMZ host on a 9100EM. Starting with your script, I created one to toggle the DMZ setting. Unlike yours, this one does not exit IE, making it easy to manually toggle and verify the switch again when the need for a DMZ host is complete.

Here is the script for firmware version 2.01.02.00:

$oIE = ObjCreate("InternetExplorer.Application.1")

If @error Then
MsgBox(0, "", "Error opening Internet Explorer: " & @error)
LogThis("IE Object Open Failed")
Exit
EndIf

$oIE.Visible = 1
$oIE.RegisterAsDropTarget = 1
$oIE.RegisterAsBrowser = 1


Dim $myAddress, $routerAddress, $selectFirewall, $selectReboot, $selectYes, $selectDMZ, $selectCheckbox, $selectOK, $user,$pass

$user = "admin"
$pass = "amen4275"
$routerAddress = "http://192.168.1.1"
;Steps to toggle DMZ
$selectFirewall = "{TAB 16}{Enter}"
$selectYes = "{TAB 27}{Enter}"
$selectDMZ = "{TAB 28}{Enter}"
$selectReboot = "{TAB 27}{Enter}"
$selectCheckbox = "{TAB 36}{Space}{TAB 5}{Enter}" ;When port forwarding rule already exists for the current IP address
$selectOK = "{TAB 36}{Enter}"
$oIE.Navigate($routerAddress)
Sleep(5000)
Send($user & "{TAB}" & $pass & "{TAB}{ENTER}")
Sleep(5000)
Send($selectFirewall)
Sleep(1000)
Send("{ENTER}")
Send($selectYes)
Sleep(2000)
Send($selectDMZ)
Sleep(2000)
Send($selectCheckbox)
Sleep(5000)
Send($selectOK) ;only necessary when port forwarding is enabled for the current IP address
Send($selectDMZ)

;$oIE.Quit ; exit IE
;$oIE = 0