Installing the WiFi Radio

Radio systems available for the MarcDuino

  • The XBee S6B is the recommended WiFi radio for the MarcDuino, instructions follow below. This simple and efficient system uses the internal iPhone WiFi as the transmitter.
  • The superior, but more complex dual XBee radio setup instructions can be found here. This system uses a more powerful external XBee radio connected to the iPhone as the transmitter.
  • The former (obsolete) WiFly radio installation instructions can still be found here

Ordering the radio, breakout board, and programming board

The S6B WiFi radio is available from several places, we like to get ours from here:

https://www.sparkfun.com/products/12571

If you have a MarcDuino v1 or v1.5, you will need a breakout board to connect your XBee radio to the MarcDuino. You don't need it on the MarcDuino v2, since it's integrated on the board already.

https://www.sparkfun.com/products/11373

In all cases, you need a programming board called an XBee dongle. It is used only for programming the radio, and does not go into the R2 setup. It's similar to the breakout board above, but this one as USB plug, so you can connect the radio to a computer for its initial programming:

https://www.sparkfun.com/products/9819

Programming the radio

Download and fire up the XBee XCTU software available here:

http://www.digi.com/products/xbee-rf...port-utilities

Plug the XBee S6B in the USB XBee dongle and the into your computer

Follow the programming procedure below:

Read in the current config in the XCTU tool. Make 4 modifications:
- Change Infrastructure Mode to SoftAP (default was STA)
- Change SSID to whatever you like. (default was Blank)
- Change IP Protocol to TCP (default was UDP)
- Setup WPA2 password encryption.
Write the changes back to the S6B device. 

Next in the R2 Touch app under the wrench menu, make 2 changes:
- change Receiver IP address to 192.168.1.10
- change Receiver Port Number to 9750

Connecting to your WiFi radio from the iPhone

Plug the programmed S6B radio to the XBee breakout board connected to your MarcDuino (see here for the MarcDuino v1 connections), and power the system up.

On your iPhone go to Settings. In the Wifi section, you should see your R2 network, under the SSID name you gave it above. Connect to it by selecting it like below.

Connecting from the R2 Touch app for the first time

Before the R2 app can connect for the first time, you have to change the settings within the app (that's because the defaults are for the former WiFly radio and won't work with the new S6B).

Open the R2 Touch App, press the wrench menu, and make 2 following changes:

- change Receiver IP address to 192.168.1.10

- change Receiver Port Number to 9750

Now go back to the main R2 Touch screen. If your radio is connected to a working MarcDuino, the WiFi indicator should turn green. You have connected successfully.

Note: testing the radio connection without a functioning MarcDuino

It you have not yet connected your WiFi radio to a MarcDuino, or if the MarcDuino is not working properly, the indicator will not turn green because it does not receive an answer from the MarcDuino. However, it is still possible to check that the radio connection is working by using the XBee dongle and the XCTU app and check if something is received when you press a key on the R2 Touch app. You will just see a fleeting message with a couple letters, as the R2 App keeps sending blank lines every 1/2 seconds, but that is enough to prove that the radio connection is OK.

A few things to check if things don't work

Check that

1- your iPhone is connected to your S6B network (quit the app and go to the iPhone Wifi settings), and has not inadvertently reconnected to your home WiFi network.

2- you are using the TCP connection method (in the R2 Touch wrench menu)

3- you have entered the correct Receiver IP on R2 Touch (192.168.1.10, see above)

4 -you have entered the correct Receiver port on R2 Touch (9750, see above)

5- If you still do not have connectivity, try the following tests to sort our whether the fault is with the radio link or with the MarcDuino board. Connect your WiFi radio back to your computer using the USB dongle, and use the XCTU tool to see if it is receiving traffic from R2 Touch. The data received is going to be mostly garbage, because the receiver is not connected to the MarcDuino yet, and the indicator in R2 Touch is not going to turn green either. If you see any traffic, it's enough to confirm that you WiFi connection is established properly, and that the fault probably resides with the MarcDuino board itself. See here on how to test the MarcDuino board by itself without a radio attached. If that works too, then your problem is in the connection between the XBee breakout and the MarcDuino board.