Go Down

Topic: Arduino directly controlled by Ipad via WiFi (Read 3573 times) previous topic - next topic


Hello, I have a project where I need to control an arduino using an ipad.  It needs to be realtime, wireless, and not connected through another computer.  This rules out using a web interface and converting OSC to serial using a PC.  It seems like using WiFi is the best option (range, compatibility, etc.) so I bought a cuhead WiFi shield, which is supposedly compatible with Asynclabs wishield.  If this doesn't work, I can always purchase a Wifly shield.  I know people like to use OSC to communicate because then you can use the TouchOSC app.  However, I would like to use the accelerometers of the ipad for control, and I don't think TouchOSC has this option, so I plan on writing my own app.  With this in mind, can anyone tell me the best way to communicate between the ipad and arduino using WiFi, or a source of information where I can research the matter more thoroughly?  It seems like UDP is a good option, but I don't how to set this communication up between the ipad and arduino.  Does anyone know a source of information where I can learn how to code up communication between the two using UDP, or even TCP?  I don't have experience with network communication, so any help would be greatly appreciated.


As soon as you're using WiFi then you're into a full network stack with all the parts that go along with that - IP addresses, routing etc.

Assuming the iPad has Bluetooth I'd have gone with that as BT is pretty much a serial transport method so you can craft your own protocol (ie what your packets mean).

If you're keen on the WiFi option then what you'll want to do is configure one or the other device as the Server and the other as the Client. I'd probably go with having the Arduino as the server and the iPad as the client (not least because you'll probably have more visibility that way and I'm not sure if Apple allows inbound connections to the iPad).

If you look at the basic Ethernet examples you can see some options there for running a simple Arduino web server that you can access remotely. Using HTML on the iPad you can access things like the accelerometer and what not so you could do some interesting things that way... If not then you'll need to get down and dirty with Objective C which has an interesting learning curve.

I'd probably start there in order to get yourself familiar with the principles involved and then built out the levels of complexity.


Go Up