Linksys Router & Python

marcus at deepfort.com marcus at deepfort.com
Mon Nov 1 05:41:39 EST 2004


Brad Tilley wrote:

> Probably a stupid question, but here goes:
>
> Is there any way to get a scaled down version of Python onto a Linksys 
> Wireless router? Are there any projects out there that are doing this? 
> I've googled around a bit, but didn't find much. I want to keep the 
> router's software as it is, but I also would like to have some 
> scripting abilities on it as well (like email the router's IP addy 
> every x hours), etc.
>
> I have scripts that run on my computers that do this sort of thing.
>
> def url_open():
>     """ Function that gets and returns the IP addy
>     of my Linksys BEFW11S4 Wireless DSL router."""
>     import urllib, re
>     ip = re.compile ('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')
>     f = urllib.urlopen("http://user:passwd@192.168.1.1/RouterStatus.htm")
>     data = f.read()
>     f.close()
>     routerip = ip.findall(data)
>     print routerip[0]
>     return routerip[0]
>
> But, when I leave town for vacation, I don't like leaving a computer 
> running. If I could get the interpreter embedded in the device itself, 
> then that would solve the problem.
>
> This is probably a shot in the dark, but I thought I'd ask.
>
> Thanks,
> Brad


Tim Gilbert has been attempting to cross-compile just such a beast 
fairly recently, and may have had some success by now. Maybe you should 
drop him a line:

http://skreak.com/wrt54g/python.php

Good luck :-)



More information about the Python-list mailing list