Saturday, January 8, 2011

Arduino Wireless Switcher

There are some rumors out there telling about the diseases around wireless signals!

Since the wireless router is in my bedroom and I think like "better safe than sorry", I built a device to switch on or off my wireless feature from my router.

It was a lot easier if the router has a button to do that, but unfortunately it doesn't have!
I read about some way to control wireless feature through 'telnet' on 23 port. But again,unfortunately, my router doesn't allow any incoming connection unless on port 80 which is the default port browsers use to HTTP.

So, let's create a HTTP bot to simulate a human to enter the router web site and switch the wireless option



What we need:

  1. Arduino
  2. Ethernet shield
Obviously, we can create the bot on our computer but this will limiting the switch.
With Arduino, the change can be made even if the pc is off.

Another feature that i want to add to this project is the capability to switch the router with a common InfraRed remote control ( from my tv for example).

Components:
  1. A IR Receiver ( I choose one of the TSOP22 family)
  2. 100ohm resistor
  3. Status led

This project is too simple:

Pick an example of IRemote from Arduino libraries.From IR Receiver connect pin 2 to 5V with the 100ohm resistor to prevent over current, pin 3 to GND and pint 1 will be our RECv pin for Arduino example code.Test it! It should work at first!Then do the changes you like!

Now,just pick a client example of Ethernet from Arduino libraries see how this works. Connect it to port:80 as I said before, and ip address from your router and let's send to router some code!

What is the code do we need to send to router?

In the router web page, to change the option of wireless feature I need to check or uncheck a check box inside a form and click on submit button to post the form.Ok, let's sniff the connection and search for a HTTP POST command.

I installed a HTTP sniffer "HTTPAnalyzer from IEInspector" and start recording while I perform the task of switch on and off. I got two different codes under the HTTP Header.I copy them to arduino and send through the example from the ethernet library. 

It Worked, but not in the first try!. Now just we need to join the codes from iRemote and ethernet together and test pressing the button from remote control.

It is the best for me, now every time i want wlan I just need to pick up my remote control and when I'm done I pick it up again.

Hope you enjoy


6 comments:

  1. Hey nice project!
    Can you share the code and schematics ?

    ReplyDelete
  2. hey, thanks!!

    I will post the code and some schematics, but i need to clean it up first, comment the code, etc.
    I'm too bad for coding... What a mess!

    ReplyDelete
  3. Hi there,

    I stumbled across your blog while searching for a way to connect a TSOB22 IR-receiver to an Arduino.
    Whatever way I try, I don't seem to be able to read out a signal change via the IRemote library..(Serial monitor just shows nothing..)
    Thereby I also would very much appreciate if you could post the schematics and code (even unclean..)

    greetings,
    chicho

    ReplyDelete
  4. https://www.facebook.com/groups/362977540405666/

    ARDUINO Ferrara Italy.

    ReplyDelete
  5. I want to ask I wanna connect arduino to android phone so is it necessary to use usb host sheild or I can use otg only to connect it to mobile ??

    ReplyDelete
    Replies
    1. try this:

      https://play.google.com/store/apps/details?id=com.primavera.arduino.listener&hl=en

      Delete