Search This Blog

Saturday, 30 April 2011

RedFly-Shield Socket class and FTP Server

After coming back from a short vacation, I thought I'd add an update to describe my progress with the Watterott Electronic RedFly-Shield.

In the previous blog post I describe the success I've had with setting up the C# Shield class to initialise and setup the RedPine Signals WiFi module (RS9110-N-11-22). Once I was happy with this class I moved on to looking at how to support the 8 sockets on this WiFi module.

Skewworks had added a FTP server class to the code repository over at Looking through this, and other network code, it seemed obvious to create a custom Socket class for the RedFly-Shield. I started with the System.Net.Sockets class as a template and began fleshing out the necessary class functions.

After implementing the bare essential Socket functions, I was surprised how quickly it was to get the FTP server class working. A nice feature of creating a new RedFly Socket class is that the only change needed to Skewwork's FTP class was the addition of the following code;
using Socket = RedFly.RedFlySocket;

So right now the RedFlySocket classes can be used to create listening Sockets (only tested TCP ones), accept incoming connections on those sockets, and receive data from a connected host. This initial setup however is able to allow a host PC to connect to the FTP server running on a FEZ Domino, complete a handful of FTP commands (pwd, cwd, etc.), and receive a file located on the FEZ Domino SD card.

A much harder task is to flesh out the RedFlySocket.Send functions. I've come across something odd with my fairly synchronous UART data reception. So now I need to work out a different strategy for handling incoming UART data from the RedPine WiFi module.

Over on my GoogleCode SVN repository, revision 99 of the RedFly class library ties in with this blog post;

A RedFly-Tester solution exists that creates a listening Socket on port 23, and simply acknowledges a host trying to telnet to the RedFly Shield;

Revision 96 of the RedFly FTP server solution also ties in with this blog post;

Sunday, 17 April 2011

Watterott RedFly-Shield

From Project: Burt

Watterott Electronic very generously sent me a new Arduino Shield they are close to releasing. It's called RedFly-Shield, and uses a RedPine Signals WiFi module (RS9110-N-11-22).

Here's the feature list for this WiFi module -
  • Compliant to 802.11b/g and single stream 802.11n
  • Fully self-contained serial-to-wireless functionality - does not require any host processor bandwidth
  • Includes all the protocol and configuration functions required for WLAN connectivity in Open, WEP and WPA/WPA2-PSK modes of operation
  • Payload data through Serial Interface and SPI
  • Terminates TCP and UDP connections, and offers transparent serial modem functionality
  • Configuration through AT commands and SPI frames
  • Integrated antenna, frequency reference, and low-frequency clock
  • Ultra low power operation with power save modes
  • Ad-hoc and infrastructure modes for maximum deployment flexibility
  • Single supply 3.1 to 3.6 V operation
  • Certification : Module is based on RS9110-N11-02 which is certified by FCC, IC and CE.

Watterott have done a great job in designing this shield. Communication to the RedPine WiFi module is via standard UART using modem-like ASCII 'AT' commands. Supplied with the shield is a nicely fleshed out Wiring library and example code for the Arduino (Tweeter, HTTP client and server).

I'd picked up a Sparkfun FT232RL Breakout board for another project. So the first job was to use it to talk to the RedPine module. As the above picture shows it's quite straight forward to setup and snoop on the serial port.

I'm currently using Windows Vista for development, so I needed to grab HyperTerminal to be able to see the UART data, and to use the Kermit protocol to transfer the latest firmware to the module. NOTE: I first tried using the TeraTerm supplied by GHI for use with their .Net boards, but although this looked like it can successfully transfer the firmware files to the RedPine module, the module failed to load them upon reboot. Thankfully using HyperTerminal worked fine.

Although the Arduino is a wonderful module, I usually get frustrated with the development tools. Hence my current projects are focused on using a GHI FEZ Domino module, and recently their Panda module. I'd become familiar with porting Arduino Wiring code to .Net C# with the Watterott S65-Shield. So with the RedFly-Shield's quite complete Wiring library and examples, I've set about porting this across to managed C# code.

Work-in-progress C# class library and testing solution can be found on Burt's GoogleCode repository (revision r92, 20th April 2011);

So far I've managed to get the RedPine module; reset, obtained and decoded the firmware version and MAC address, scanning of broadcast WiFi access points (AP), joining an AP, and obtaining an IP via DHCP.

Hopefully in the next week or so I can complete the port of the Wiring library and examples. Plus code up a Socket class.

*Must resist Portal 2*
Matt Isenhower's Blog - MicroTweet - Twitter OAuth API Library for the .NET Micro Framework

MicroLinq for the .NET Micro Framework -MicroLinq for the .NET Micro Framework

C# .NET DNS query component

Saturday, 16 April 2011

Project Update

A pictorial update of my current projects.

From Project: Burt

Watterott RedFly-Shield connected to a GHI FEZ Domino.
Serial snooping via a Sparkfun FT232RL Breakout board.

From Project: Burt

GHI FEZ Panda. Single row right-angle header allows for the Mode pin to be grounded.
Double row right-angle header underneath the board exposing the JTAG interface.
Not show: Olimex ARM-USB-TINY JTAG dongle.

From Project: Burt

Simple Inertia sensing. I2C temperature sensor. UART and Reset control of the motor controller. Futaba servo mounted and ready to connect to a distance sensing array.