Linksys Router & Python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brad Tilley

    Linksys Router & Python

    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.ht m")
    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
  • Josiah Carlson

    #2
    Re: Linksys Router & Python


    Brad Tilley <bradtilley@gma il.com> wrote:[color=blue]
    >
    > 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.[/color]

    Some linksys routers offer support for dynamic hostnames via no-ip.org
    or dyndns.org. That is, they connect to the dynamic dns server, tell it
    "hey, I'm now ip address ...", and within about 5-10 minutes, the rest
    of the world knows it.

    - Josiah

    Comment

    • Cliff Wells

      #3
      Re: Linksys Router &amp; Python

      On Fri, 2004-10-29 at 11:31 -0700, Josiah Carlson wrote:
      [color=blue]
      > Some linksys routers offer support for dynamic hostnames via no-ip.org
      > or dyndns.org. That is, they connect to the dynamic dns server, tell it
      > "hey, I'm now ip address ...", and within about 5-10 minutes, the rest
      > of the world knows it.[/color]

      There's also a plethora of scripts (several of them in Python) that do
      the equivalent. dyndns.org has a listing of many of them.

      Regards,
      Cliff

      --
      Cliff Wells <clifford.wells @comcast.net>

      Comment

      • paul koelle

        #4
        Re: Linksys Router &amp; Python

        Brad Tilley wrote:[color=blue]
        > Probably a stupid question, but here goes:
        >[/color]
        Not stupid but nevertheless I'll try to restate ;):

        Has anyone heard of a (probably stipped down) MIPS version of the python
        interpreter which may run on openwrt? I'd hate to write scripts in "ash".

        Thanks
        Paul

        Comment

        • Frithiof Andreas Jensen

          #5
          Re: Linksys Router &amp; Python


          "Brad Tilley" <bradtilley@gma il.com> wrote in message
          news:cltjkt$4fi $1@solaris.cc.v t.edu...
          [color=blue]
          > 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?[/color]

          Probably - There are some Linux + development tools for the LinkSys WRT54G
          router.



          Maybe the devices are somewhat identical:

          [color=blue]
          > 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),[/color]

          Those requirements are mutually exclusive.


          Comment

          • marcus@deepfort.com

            #6
            Re: Linksys Router &amp; Python

            Brad Tilley wrote:
            [color=blue]
            > 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.ht m")
            > 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[/color]


            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:



            Good luck :-)

            Comment

            • Tony C

              #7
              Re: Linksys Router &amp; Python

              BRad

              Here's a one-liner way of getting your IP address, but you'd need a
              shell
              account on a webserver to get it.
              I made a python CGI script, and had it print the IP address of the
              client as HTML.

              import os
              print os.environ["REMOTE_ADD R"]

              I don't show the code to to format the output as HTML, but that's
              rpretty straightforward .

              However, this would still require you to have your computer on while
              you're away, which isn't your goal. But at least you don't have to
              login to your router to get the info.

              You can accomplish the same thing by running a python script to
              www.myipaddress.com, and scraping the screen.

              These are just another ways of getting your IP address.
              I copied this from a post on CLP, so I can't take credit for it.

              Brad Tilley <bradtilley@gma il.com> wrote in message news:<cltjkt$4f i$1@solaris.cc. vt.edu>...[color=blue]
              > 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.ht m")
              > 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[/color]

              Comment

              • Tony C

                #8
                Re: Linksys Router &amp; Python

                Cliff

                [color=blue][color=green]
                >>dyndns.org has a listing of many of them.[/color][/color]
                Can you provide the full URL to these scripts, or do you need an
                account to get them ?

                Cliff Wells <clifford.wells @comcast.net> wrote in message news:<mailman.5 681.1099078529. 5135.python-list@python.org >...[color=blue]
                > On Fri, 2004-10-29 at 11:31 -0700, Josiah Carlson wrote:
                >[color=green]
                > > Some linksys routers offer support for dynamic hostnames via no-ip.org
                > > or dyndns.org. That is, they connect to the dynamic dns server, tell it
                > > "hey, I'm now ip address ...", and within about 5-10 minutes, the rest
                > > of the world knows it.[/color]
                >
                > There's also a plethora of scripts (several of them in Python) that do
                > the equivalent. dyndns.org has a listing of many of them.
                >
                > Regards,
                > Cliff[/color]

                Comment

                • Cliff Wells

                  #9
                  Re: Linksys Router &amp; Python

                  On Mon, 2004-11-01 at 16:59 -0800, Tony C wrote:[color=blue]
                  > Cliff
                  >
                  >[color=green][color=darkred]
                  > >>dyndns.org has a listing of many of them.[/color][/color]
                  > Can you provide the full URL to these scripts, or do you need an
                  > account to get them ?[/color]

                  You shouldn't need an account, but accounts are free either way ;)

                  DynDNS account login and overview. Proceed to My Services page to get detailed look.



                  --
                  Cliff Wells <clifford.wells @comcast.net>

                  Comment

                  Working...