Update 3/8/2014: There is an Arduino WiFi shield for around $40 now sold by Adafruit Industries (but you have to solder on the connectors). That shield costs about as much as the TP-Link router I mention in this article, and a $20 Ethernet shield. However, with clone Ethernet shields now around $9 from China, it’s still cheaper to hack something together. (Another advantage of the TP-Link device is you can have it set up to connect and publish the connection via Ethernet, and plug it in to anything that needs it — an Arduino, an OUYA, TiVo, etc.)
To test my Arduino Ethernet code, I needed a way to get my Arduino on my home network. Unfortunately, my router is somewhere else, and I was not able to run a long ethernet cable to it. I initially experimented with making my old MacBook act as a gateway using Apple’s Internet Sharing. I was going to have it share my home WiFi internet out the ethernet port, and hook that port up to the Arduino. Unfortunately, again, it seems there is some problem with the current version of Mac OS X and Internet Sharing and I was unable to get it to work. So, I turned to a free bit of software called Ice Floor which is a GUI front end for the Unix firewall running on Mac OS X. With a bit of Googling I was able to configure Ice Floor to let my Arduino hook to the MacBook, then reach out to the Internet.
I won’t be writing about that. It was easy, once I figured it out, but I spent all night trying.
What I really wanted was a way to get my Arduino on my home WiFi.
With Arduino ethernet interfaces being real cheap if your order from China, or slightly less cheap if your order from the USA, it puzzled me that WiFi shields were so much more. Well, if you don’t need everything to fit inside a small Arduino case, you can just get one of the cheap Ethernet shields and then use one of these things:
This $23 TP-LINK WR702N WiFi router is really teeny tiny (about 2″x2″ and .5″ tall), and comes with a short ethernet cable, USB cable, and USB power supply. It has several modes of operation, including the one you would expect — plugging up to an Ethernet jack and broadcasting it as a WiFi signal. But, it also has a Client mode, so you can plug it up via Ethernet to the Arduino and then use it as a WiFi card.
Configuration was a bit tricky because I didn’t know what I was doing, but basically, you plug it up to power (USB or power adapter), and configure it via your computer and an Ethernet cable. If your computer is already on a network that is 192.186.0.x (like mine was, from my home DSL router), you will need to disable that from your computer (turn off WiFi, or unplug the Ethernet cable). The instructions (on the website) tell you to change your computer’s IP address to 192.168.0.10, and then in your web browser you go to 192.168.0.254 (which is the router’s default IP address). Up loads an admin web page.
Type in the password (admin/admin), then click the easy setup button and select Client. It will then give you a screen where you can browse to the WiFi network you wish to join, and enter the password (if it’s a protected network) and encryption method used (again, if it’s a protected network).
Once you do that, the little box will reboot and then try to connect to that WiFi hotspot, and then get an IP address from it and link the Ethernet port to the WiFi… So, configure it, then unplug it from the computer and plug it to the Arduino and… your Arduino’s Ethernet code now talks out WiFi.
So, if you ever try to telnet in to my home Arduino, that is how the connection will be getting there.
Just passing information along. Hope it helps someone.
Thanks mate! this was EXACTLY what i was looking for, and wondering if was possible. Can I ask have you tried setting the tplink to router mode, plugging in the arduino, and trying to access the arduino from another pc via wifi? for example running the ethernet chat server example and trying to access the arduino directly and wirelessly? would be cool.
Also curious if you could plug a mini ethernet hub into the tplink and connect many arduinos to the net through the one tplink router. Thanks for the tutorial though buddy!
Yes, I used this device and was able to telnet in to my Arduino remotely. I had a small BBS program running on mine that way for awhile. It works great!
Would it be possible to get native cheap WIFI using this 5 dollar part?
http://www.ebay.com/itm/For-New-Nintendo-DS-Lite-NDSL-WIFI-blue-tooth-Network-Module-PCB-Repair-part-BU/271187618796?_trksid=p2045573.m2042&_trkparms=aid%3D111000%26algo%3DREC.CURRENT%26ao%3D1%26asc%3D27%26meid%3D420458186014896737%26pid%3D100033%26prg%3D1011%26rk%3D1%26rkt%3D4%26sd%3D271187618796%26
Even cheaper WIFI router which can also act as range extender and run in client mode:
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=181151761208
Hi!
Can you share how did you configure IceFloor to connect Arduino Ethernet Shield to the ethernet port on your macbook (via Wifi to Ethernet sharing) ? I’m kind of stuck on it now :/
Thanks!
Greg
Hi. I am thinking of using Arduino for BitTorrent server. The WiFi option would make it very convenient to use.
Please post your BitTorrent server code so I can copy and paste it into my Arduiono. Thank you.
I have never worked with BitTorrent protocol. I expect it would exist for Raspberry Pi.
There is also a TP-LINK WR703N which has a USB interface. Chinese only web interface – mitigate that by installing OpenWRT – and then you also get a “full” Linux environment on the router that you can use to connect through the USB port to your Arduino. No need for the Ethernet shield….
Pingback: Configuring the TP-LINK TL-WR702N nano router for Arduino | Sub-Etha Software
I’ll try it, just bought this router online and i think i will use it in my engineering degree project :).
I also use one on a Raspberry Pi. The Pi cannot do a network install over WiFi, so I have a TP-LINK configured on my WiFi network that I can plug in to the Pi ethernet and let it install that way. I also use one on a printer I have that only has ethernet. This is turning in to a very useful device.