Tuesday, 2 April 2013

Flight Software

I've been busy with the software to control handle the telemetry for RAMFly... 
Sadly (and as is often the case) I've spent a while battling with the development tools. 
Ramfly's current processor...
The main controller hardware is an Arduino (currently an Arduino Duemilenova - see right) but soon to be replaced with a Mini Pro.  The standard Arduino development environment is good, as far as it goes, but makes it a bit difficult to get 'proper' software engineering going for folk like me who appreciate a fully featured IDE to help manage things. Creating and managing multiple source files / libraries etc is just not its thing. The standard tool does a good job of managing the build/upload process, but the editor is (IMNSHO) clunky and confusing.
At work, I live in Netbeansso I took it upon myself to investigate whether it could be used to develop Arduino code. Google revealed a few articles and the Arduino website has a page on the subject but it's a bit dated and relates primarily to building a Mac environment... 
I discovered a netbeans plugin that's quite new but helps a lot. It works alongside the C++ Netbeans module. The installation instructions on the plugin homepage are excellent and the author, Jaques, is very helpful. The plugin wraps the compile/upload process very well (you just need to manually add "upload" as a makefile target for Netbeans). However, that left me looking for a terminal/serial monitor. There are plenty of serial 'console' apps that can do the job, but ideally I wanted something integrated...  Searching took me to the rs232 plugin at java.net .  This project looks like it has grander plans, but for now I just grabbed v0.2 of the above plugin, installed it into netbeans and it works really well. So now I have my familiar Netbeans environment, auto formatting, code completion, 'on the fly' syntax checking, automatic code builds and uploads and a serial console. Pretty cool.
But, and there's always a 'but', it seems to get things wrong sometimes. Incorrectly flagged syntax errors, and a makefile corruption that occurs randomly. I can't (yet) find what's corrupted, so I end up having to create a new project, import the source files and then rebuild. I don't think the plugin is involved but the Makefile provided maybe.
Still to do: The Makefile still rebuilds the entire library on every build (as does the standard Arduino tool). It doesn't take long but that's not the point ...