Installing the WiFi Radio
Radio systems available for the MarcDuino: S6B, XBee and Wifly
The XBee S6B is the recommended WiFi radio for the MarcDuino, follow the instructions below. This simple and efficient system uses the internal iPhone WiFi as the transmitter.
The superior, but more complex dual XBee (non-WiFi) setup was the best alternative until the WiFi-compatible XBee S6B became available. This system needs an external XBee radio connected to the iPhone, as it can not use the native WiFi radio in your phone. It's more complicated, but the range and stability are unsurpassed, and it's completely immune to WiFi congestion or interference.
Originally, the setup used the WiFly radios. These are obsoleted and not recommended, as they suffered from annoying disconnection problems in WiFi congested environments.
Instructions for the older WiFly radio
I do not recommend using the older WiFly radio. The problem is that it dropped connection when WiFi was in heady usage, like in a conference or a large gathering setting, which is very annoying. I tracked it down to a bug in the WiFly itself, that the manufacturer acknowledged but never bothered to fix. Nevertheless, the former WiFly radio installation instructions can still be found from the following link:
Instructions for the dual XBee (non WiFi) radio
The XBee (non-WiFi) link is the most reliable, but adds lots complexity to the transmitter setup. It needs no pairing and it is up as soon as your power it, it is not susceptible to WiFi interference, works over reliably over very long distances. But you cannot use the WiFi radio in your phone to talk to an "original" non-WiFi XBee, so you have to add another XBee transmit radio and an iPhone to XBee adapter on the iPhone side. With the advent of the reliable XBee S6B radio, which connects directly to the built-in WiFi in your phone, the extra complexity is probably not worth your while. Nevertheless instructions for the XBee (non-WiFi) radio are here:
Instructions for the XBee S6B WiFi radio
The rest of this page concerns itself with the recommended XBee S6B WiFi radio setup.
The S6B WiFi radio is available from several places, we like to get ours from here:
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.
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:
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.