Hello everyone -
I’ve been working on a library that allows simple bidirectional communication between a PC and an Arduino Duemilanove. I hope some of you check it out. I would love to get some feedback. Below is my (overly wordy) description of the project.
I hope some of you check it out. I would love to get some feedback. Also, please feel free to redistribute this message freely.
By the way, this is an open source project. The code will always be free.
Rhyduino is a software library that can be used from managed code applications to control Arduino hardware that is connected via USB-serial port or wirelessly (with additional hardware). The software running on the Arduino is the SimpleFirmata sketch. The project website is http://rhyduino.codeplex.com.
I’ve been interested in robotics for years but never really stuck with it because the programming environments were so foreign to what I was used to. I’ve been programming for PCs since 1990, so maybe my over-familiarity with PC programming worked against me when programming for robots. However, things changed when I stumbled across the Arduino a few years ago; I found a very inexpensive platform that was pretty easy to program for.
The honeymoon lasted a few months at most. While it was easy to program for the Arduino, the Arduino IDE was a bit clunky. The CPU on the Arduino is extremely powerful considering how little it costs, but it’s not an Intel Core2 Quad either, so it doesn’t really compare to the horsepower of the desktop CPU. Most of what I like to do involves a lot of bidirectional PC to Arduino communication, so all the Arduino really needs to do is interpret the serial messages I send it and perform the operation that the message described; it’s basically just a message parsing machine.
At some point I came across the Firmata protocol. It claimed to be useful for doing exactly what I was doing, so I was interested. I had been looking to create a standardized sketch that I would load on every Arduino I had, regardless of the project it was being used in because I really wanted to get away from that clunky Arduino IDE. Firmata looked like it had what I needed so I tested it out. The Arduino IDE ships with a standard Firmata sketch so there was no Arduino code to be written. But f**k was the protocol hard to use! It just didn’t make any sense to me. The documentation was practically non-existent and everyone who had blogged about using it seemed to be doing it in EVERY WAY BUT the way I wanted to use it – Give me managed code interfaces because I love C# and I swear by Visual Studio 2010 (the add-in support kicks ass in this version so I have it totally pimped out).
I appreciate everyone out there who tried to create a .NET library and share it with us. There were some really good starts, but I found the implementations to be incomplete and/or done in a style that didn’t conform to Microsoft Style Guidelines. Ok, I’m not really that anal (although, I suppose some might disagree), it’s just that for my job, when I have to write code, the code has to conform to those guidelines; it’s just the way I do it. What you find in Rhyduino might not conform to those guidelines, but it’ll be pretty close. To get back to the point, I created Rhyduino to be the PC counterpart to the “SimpleFirmata” sketch running on the Arduino (ArduinoDuemilanove, by the way).
While it’s not there yet, I intend to make Rhyduino support all of the functionality described in the Firmata 2.1 protocol.
The Future of Rhyduino
For my pre-Firmata projects, I used the tools and libraries in Microsoft Robotics Developer Studio to write my PC <-> Arduino code; I worked on the team that invented the foundation that became Microsoft Robotics Developer Studio, so I’ve been fond if it from the start. Once I’ve completely implemented the Firmata 2.1 protocol in Rhyduino, I will be creating a Rhyduino service for Microsoft Robotics Developer Studio. If I’m feeling ambitious at the time, I may create an Arduino emulator for use in the MSRDS simulation environment.
I see that the Firmata protocol has grown to provide servo control and I2C communication features, but for my needs there are two critical components that are still missing:
I’d like to see it provide Charlieplexing functionality. I wonder what performance I’d be able to achieve by implementing this purely on the PC side using the existing standard Firmata sketch on the Arduino. It’d be a hell of a lot easier to do that than to get the protocol spec revised and implement the changes on the Arduino.
I need to be able to read and write to the memory on the Arduino. Since that will require modification to the Arduino sketch, I guess that I’ll have to propose a change to the Firmata protocol.
How to Help
The foundation has been set already with some good basic functionality, but I could still use help finishing it up. If you’re interested, here are the “jobs” that need to be done:
- Testing – Task: Design the test plan and/or implement it.
- Rhyduino I2C
** (Arduino) - Task: Combine the I2C sketch with the StandardFirmata sketch so that both can be done at the same time. I should say that I don’t know if this is even possible; it seems like it should be.
** (PC) – Task: Implement the I2C functionality in Rhyduino.
- Rhyduino Servo Control
** (Arduino) – Task: Combine the servo sketch with the StandardFirmata sketch so that both can be done at the same time. I should say that I don’t know if this is even possible; it seems like it should be.
** (PC) – Task: Implement the servo functionality in Rhyduino.
Future Features – If you see one of the tasks that I’ve slated for the future and want to take it on, please be my guest. Please, just work with me so that we could keep design methodologies consistent.
The project code is currently in a beta state. I use this terminology to mean that I don’t plan on adding any additional features to the existing code; I am focused on deep testing and fixing bugs. To see the features included in this release, please visit the release page: http://rhyduino.codeplex.com/releases/view/46473.