mikeytown2 Posted November 7, 2008 Posted November 7, 2008 I have a very cheap Access Point/Router (Trendnet - TEW-432BRP). The wireless gateway stops working after some time, reseting it works. I have a wireless link between this and my Linksys WRT54G running DD-WRT. Using this script I reset my Trendnet router when the wireless link fails.expandcollapse popup;Load http.au3 #include "HTTP.au3" ;Set Parameters $RemoteIP = "192.168.3.2" $LocalIP = "192.168.3.1" $TelnetPort = 23 $SleepTime = 15 * 60 * 1000 ;15 minutes $ResetTime = 5 ;reset router at 5am $ResetBool = False Opt("TrayIconHide", 1) Opt("TrayIconDebug", 1) ;Run Loop While 1 ;Reset Router at the time set no matter what If @HOUR == $ResetTime And $ResetBool == False Then ResetRouter($LocalIP) $ResetBool = True Else $ResetBool = False EndIf Sleep(60 * 1000) ; wait one minute ;Check Wireless Connection $RemoteConnectionOK = CheckRemoteRouter($RemoteIP, $TelnetPort) If Not $RemoteConnectionOK Then ResetRouter($LocalIP) EndIf ;Put Program To Sleep Sleep($SleepTime) WEnd Func ResetRouter($IP) $host = "http://" & $IP & "/" $page = "/restart.cgi" $data = "restart=Restart" $socket = _HTTPConnect($IP) _HTTPPost($host, $page, $socket, $data, "admin", "admin") EndFunc ;==>ResetRouter Func CheckRemoteRouter($IP, $Port) TCPStartup() $socket = TCPConnect($IP, $Port) TCPShutdown() If $socket = -1 Then Return False ;connection bad Else Return True ;connection good EndIf EndFunc ;==>CheckRemoteRouterGet #include "HTTP.au3" from here, with my mod at the last post.http://www.autoitscript.com/forum/index.php?showtopic=29631http://www.autoitscript.com/forum/index.ph...mp;#entry601371 Reveal hidden contents Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack
spudw2k Posted November 7, 2008 Posted November 7, 2008 Pretty cool there mate. I like. Ever hear of or use Tomato, another alternate firmware for router devices? It's very nice. Reveal hidden contents Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
mikeytown2 Posted November 7, 2008 Author Posted November 7, 2008 yeah I gave the latest version of Tomato a try, but i couldn't get it to connect to my TEW-432BRP. Anyway the DD-WRT wiki is very helpful and answers just about any how to question. Reveal hidden contents Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack
Armand Posted November 12, 2008 Posted November 12, 2008 nice, I'll add it to my Reconnection utility.... [u]My Au3 Scripts:[/u]____________(E)Lephant, A Share download manager (RS/MU etc)Http1.1 Console, The Ez Way!Internet Reconnection Automation Suite & A Macro Recording Tool.SK's Alarm Clock, Playing '.MP3 & .Wav' Files._________________Is GOD a mistake of the Humanity Or the Humanity is a mistake of GOD ?!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now