Skip to content

Setting up the iPhone App

fishrod-interactive edited this page Jan 7, 2011 · 5 revisions

Unfortunately it's been a while since I've touched the iPhone app and I've learned far more Objective-C since this project first began development back in 2009 (of which I'm yet to implement) for now, here's the long way of setting up the iPhone app to communicate with the Arduino.

Download

The first and obvious thing you'll want to do is grab a copy of xcode from Apple - http://developer.apple.com/iphone. Once you've done this simply clone this git repository or checkout if you're using xcode 4 and open the project found in widrive-ios using xcode.

Configure

I've made it hard for every one to configure the application by not having a preferences view or having a configuration plist file. Luckily all you need to do is set the IP address you've assigned to the car from the Arduino set up guide (not yet written) on line 49 in WiDrive_SocketViewController.m. This is what you need to change.

    car = [[Car alloc] init:@"192.168.0.50" carDelegate: self];

Simply change 192.168.0.50 to the IP address of your car

Run

Now that's all done, plug in your iPhone, build and run. You will next need to configure the WiFi on your phone to connect to the Arduino.

Set-Up WiFi

Your car has an ad-hoc WiFi network you'll need to connect to this in order to send commands to the car. You could do this over an Infrastructure WiFi network (car <--> wireless router <--> iphone) but I've found it to be a bit slow to send and receive commands.

Simply turn on your Arduino, a red light should appear (arduino wifi shield) or a blue light will appear (arduino black widow) once the connection is up and ready...

Go to Settings -> WiFi and wait for the car's WiFi network to appear. Click on the blue arrow next to the ssid (network name) and select static under IP Address.

You will need to set the IP address to be under the same subnet as your car.

  • If your car's IP address is 192.168.0.50 set the IP address of your phone to be 192.168.0.51
  • Set subnet mask to 255.255.255.0
  • Set router to 192.168.0.50

Leave the rest blank!

Go back to WiFi networks and select the car's WiFi network to join it.

You should be good to go once there's a tick next to the network name. Launch the app, press go and let the childish reckless driving commence!

Clone this wiki locally