How to give your Arduino Ethernet shield wireless capability

in Arduino, wireless by DP | 26 comments

Connecting your Arduino to the internet is cool, but it’s even cooler to connect over WiFi. Luca explains how to connect your Arduino Ethernet shield to a cheap WiFi router to give it WiFi access.

Sometimes however it could be easier (and maybe cheaper!) to connect an Arduino to the Wi-fi network using your ethernet shield in conjunction with a wireless router.

I found the TL-WR702N nano router by TP-LINK that, with a cost of about 20€ on eBay, can work also as a wireless client: in this mode the router acts like a “bridge” between the device connected to its ethernet port and a Wi-fi network.

This entry was posted in Arduino, wireless and tagged , , .

Comments

  1. Squonk says:

    Yes, and if you buy a TL-WR703N for about the same price (or its global export RoHS/CE/FCC compliant sister product, the slightly larger TL-MR3020), you get an additional USB host port where you can connect the Arduino directly without needing the Ethernet shield. For this purpose though, you have to replace the original firmware by OpenWrt, but it is pretty easy.

    Actually, you can even use the free Ethernet port to get wired Ethernet access…

    I recorded a few videos describing the setup:
    http://www.youtube.com/playlist?list=PL4f_8Do1Z2EpyXm_wdCD5YM3V0KUQj4uj&feature=view_all

  2. David says:

    You can put openwrt on this same router and either use a usb serial connector or wire up the serial port to provide wifi without the ethernet shield too…
    It is a neat little lnux box. I have not yet used mine for anything yet though…

  3. Nial Pearce says:

    THAT! Is cool!!!! Want one!

  4. Jim Narem says:

    Check out the openwrt wiki for the TL-WR703N at http://wiki.openwrt.org/toh/tp-link/tl-wr703n.

    It’s got a serial port (internal) that you could connect to the arduino, that saves a LOT
    of code space on the AVR side instead of having the TCP/IP stack or even the USB code.

    Using one of the many atmega32u4 breakout boards instead of the arduino ecosystem
    is a lot more efficient in the long run. The AVR board ends up cheaper and using LUFA
    and a USB cable gets you to the TL-WR703N and the internet.

  5. Squonk says:

    You need to know that the TL-WR703N USB only supports high-speed devices reliably, so you need to add a (passive) hub to connect to an Arduino permanently.

    It is also possible to cycle the USB power from the router.

    I added the ability to flash the Arduino board directly from the TL-WR703N router web admin:

    http://www.youtube.com/watch?v=GZZvfJBuopc

    • Sleepwalker3 says:

      Presumably if you connected to the ‘Internal serial port’, then high speed wouldn’t be an issue, is that correct? Does the TL-WR702 also have that internal serial port than can be hacked into?

      • Squonk says:

        The TL-WR702N probably has the same serial port as the TL-WR703N, but it is 2.7V only and you get Linux and U-Boot console in the way… First one is not to dificult to get rid off if you compile your own firmware, but not the second one… It also requires above-the-average soldering skills, given the tiny pad size and their capability to lift off from PCB easily :)

      • Sleepwalker3 says:

        Thanks. Soldering skills are certainly no problem, HRHS trained, plenty of decent gear, etc. etc. and more years than I care to admit ;) Interfacing 2.7V is no issue, essentially Hardware no issue, firmware on the other hand… um… Maybe I’ll just stick with the Ethernet link – lol.

  6. Brandon says:

    If you want a prettier, and more compact, solution you can use one of the shields from these guys: http://diysandbox.com/

    • Squonk says:

      Prettier? I guess beauty is subjective… I prefer a plastic rounded case than a bare PCB, if not from a pure hacker point of view :)

      As for compactness, the TL-WR702N is only 57 x 57 x 18mm, so about the size of an Arduino Pro…

      And for the price of the “Hydrogen” Wifi shield ($75 + $39.29 shipping to my place), you can get 5x TL-WR703N routers!!!

  7. kmmankad says:

    Interesting.
    I was actually trying to make my laptop act as a LAN-to-Wifi Bridge (just for a few project demos,not actual use),but couldnt get it to work as intended.

    Anyone here tried that?

    • Rohit de Sa says:

      Pretty easy actually. If you use Windows go to the adapters page. (Windows 7: Control Panel\Network and Internet\Network Connections). Select the two adapters you want to bridge, right click and select ‘Bridge adapters’.

      We used to use this method to play multi-player games when no one had a router and there were desktop PCs around. One laptop would be the ‘server’ and would create an Ad-Hoc WiFi net to which other laptops would connect. One of these laptops would connect to a desktop. The WiFi and wired ethernet adapters would be bridged on this laptop. So now, even the desktop would be able to get onto the same network *through* the laptop.

  8. Frank says:

    I did the same just yesterday and i had to set the router to ‘client mode’ to connect it to my main router’s wifi, bridge mode didn’t work. Anyone encountered the same issue?

    • cde says:

      Bridge mode is not the same as Client mode. Bridge mode is like WDS, extending a wireless network, as if both your router and the main router were one. In Client mode, your router is like a computer connecting to a wireless network. Not all routers support bridge mode (especially inter-company devices)

  9. Kris Lee says:

    +1 for the TL-WR703N

    OpenWRT WiKi says about TL-WR702N that “… it only has 2MB flash and 16MB RAM (for both Chinese and International versions), and therefore will not be supported in OpenWRT.”.

    I actually bought one for me today because it was only €16 on eBay (and not €30 it was few months ago).

    @Squonk

    Thank you very much for the OpenWRT Arduino flashing tip and the video demonstration!

    • Squonk says:

      Thank you!

      @Kris Lee: I am looking for hi-res TL-WR702N PCB pictures. If you have a chance, could you please post them somewhere… Preferably here in the forum on on OpenWrt one…

  10. Richie says:

    I use the IOGear GWU627, same idea – cheap and tiny. Only issue is that you need a PC to setup the WiFi link (once).

  11. WJCarpenter says:

    The TPLink web site says this is the smallest wireless router in the world. It certainly is small, but I don’t think that claim is quite true. I have an Edimax BR-6258n, which I think is somewhat smaller. (It comes in red or black. I got the red one because I assume it’s faster.)

    The BR-6258n also uses mini USB for power, but I don’t know if it also does data over that connection, as the TL-WR702N seems to do. But in any case, the BR-6258n is not supported by either DD-Wrt or OpenWrt.

    (But the BR-6258n is a great device for its intended purpose. I always have it in my computer bag for those times when I am stuck in a hotel room with only wired internet.)

    • WJCarpenter says:

      FWIW, I think I’ve confirmed no data over USB for the BR-6258n. When I plug it into my Linux machine, no new USB devices show up in “lsusb”.

  12. Squonk says:

    Even if the BR-6258n is marginally smaller (51 x 42 x 17 mm vs. 57 x 57 x 18 mm), the TL-WR702/3N is much nicer aesthetically… Why do you assume that your red BR-6258n is faster, because Ferraris are red? ;) The TL-WR702n isn’t supported by OpenWrt/DD-Wrt (only 2MB Flash capacity) and it doesn’t provide data over the miniUSB connector either. But the TL-WR703N does, over the additional full USB socket: this is why it such an interesting device, only competing with the Hame MPR-A1 with smaller RAM capacity, an odd cigar-like shape, but with built-in 1800 mAH LiOn battery for $19… The Hame MPR-A2 has more memory and bigger battery, but is more expensive and even ugglier!

    • Sleepwalker3 says:

      Squonk, don’t you know that Red always goes faster? ;) But what you really have to do is put some racing stripes on it, then it will go really fast! These look like nice little units, good info to have, thanks.

  13. Nico says:

    Thanks for posting this project.

    I’m using Arduino Uno R3, Ethernet shield and TP-Link TL-MR3020 (switch at WISP mode). I’m having trouble connecting.

    There are 3 types of connections: PPPoE, Dynamic IP and Static IP. Which one did you use? How do you figure out what IP address to use in the Arduino pde program? I’m using the Arduino 23 IDE.

    Thanks in advance.

  14. Somebody says:

    The cost of the Ethernet Shield plus the modem isn’t that much cheaper than the cost of a WiFi shield. What a ridiculous idlot you are.

  15. Alexius says:

    To “Somebody”:
    I already had arduino and the ethernet shield and moved to a new appartament with wifi only. Am I an idiot for spending $15 for a wireless bridge? Wifi shield would cost me around five times more.

    You Sir, are the idiot.

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.