Project - Fez.Spider, Two XBee's and a Sparkfun WiFly RN131-C breakout. Commands from a windows form

Fez.Spider, Two XBee’s and a Sparkfun WiFly RN131-C breakout. Commands from a windows form

I started this project to see how many things the Fex.Spider could do without running out of resources or crashing.
I have attached and use the following modules.

USBClientDP
SDCard
Camera
xBeeSocket
Ethernet J11D
One button
T35 LCD Display
Extender sockets
GHI DuinoProto 1.0 board for serial and WiFly power, reset and Ad Hoc wiring.

For communication I am using two XBee’s (series 2) and a Sparkfun WiFly shield
(Roving WiFly RN-131C). One XBee is attached to my PC using a serial port.
This XBee is configured as a Router. The XBee connected to the Spider is
Configured as a Coordinator.

Note: XBee series one should work as well for communication from the PC to the Fez.Spider.
I do have two XBee (series one) but I cannot find them to run a test. I have used the XBee
series one in the past to communicate between the PC and the Fez.Spider without any problems.
If you have programmed your XBee’s so they can talk to each other over a serial port they
should work with my code. I use the default 9600 baud because I do not need anything faster.

This code is more of a ‘test’ than it is a application that reads sensors and such. The code is intended
as a base to begin with so I see no reason why this could not be added.

The primary reason I started is because I wanted to program my WiFly remotely from a windows form and receive
my changes for verification. One I got that working, I got carried away and added code to save files on the PC and the SDCard.
I added the camera ‘On A Whim’ just to see it working. Files can be saved from the camera. There is no read of images but this
feature could be easily added. Flipbookmaker has some cool code to do this with a pot.
See http://blogs.msdn.com/b/net_gadgeteer/archive/tags/flipbookmaker/

File read/write on the Spider to the SDCard is by using GT.StorageDevice SDStorage. I began by using StreamReader and
StreamWriter. I had several issues using StreamWriter. The most severe was receiving Assert on the T35 display.
Write would save my file but the LCD would ‘go to black’ with the Assert message during the write.
The LCD would return to ‘normal’ after the write was finished. I could not solve that so I tried SDStorage and that worked well.

The Fex.Spider is using two serial ports. One port for read/write to the PC application and the other serial port
for read/write the WiFly commands. I am using only the AT command mode. Not API mode. I used AT mode for this
sample code because it is much easier to understand if you are just beginning. At least that is my opinion.

I have used some sample code I found by Marco Minerva. See his Copyright in the GadgeteerSpiderServer application.
I use no copyright for my code. Use as you like.

I know of nothing in my application that will harm your XBee or your WiFly device.
My WiFly module is powered by an auxiliary power source. Not by the Fez.Spider power.

Along with the code I have supplied the WiFly configuration I am using with the applications.
See file testEFile.txt. You must change the Passphrase=****** to your Passphrase.

There is code to switch the WiFly in/out of Ad Hoc mode but do code to support it.

Frankly… I am not smart enough to develop code to communicate over Ad hoc from a windows form. I have not
been able to find any sample code to get me started with the basics.

Anybody reading this have some sample code or can steer me to a link? I would really like to be able to do this.
(I do not need security because the WiFly only supports Open mode as far as I know).

Hope someone can use at least part of the code…

Usage is the Windows form.

1 Like

A video would be great to see these 2 systems communicate.

1 Like