Flashing Arduino’s and AVR’s over the Network

PI + Pogo + LSCommander

Can flash over the network for Raspberry Pi’s, Pogoplugs, and normal Linux machines.

Ever since I read this post, I wanted to see if I could reliably flash Arduino’s over my network.  I’m pleased to announce that I can, and my plan is to share the juicy details so that you too can enjoy being able to reprogram your projects from the comfort of your main machine.

RFC2217 is a standard that lets you read and write to a serial port, over your local network.  It not only sends data, but it lets the remote client send RTS and DTS signals, which allow you to reset the remote AVR.  The general standard gives us some nice flexibility, letting the remote client control the serial port as if it was right there.

Why would you want to do that?  Well, I can do my main programming on my main machine at my comfortable desk, while having my AVR microprocessor in the hot garage next to the Raspberry Pi/Pogoplug, connected to the network.  Developing on a Pi or Pogo is slow, so if I can leverage my powerful system to do the development on, and delegate the Pi to just the flashing part, then it reduces one more barrier to having network capable, field re-programmable devices everywhere.

A big advantage for me is that now I can completely contain my development environment into a virtual machine, which can be backed up, moved to a different machine, or saved/resumed.  If there are enough requests, I can see if I can upload the machine somewhere for easy download.

The RFC2217 standard would allow for some pretty interesting things.  I could have an Linux Serial Commander connected to one computer, that controls the Raspberry Pi + monitor in the other room. With SSH tunneling, I think I could flash firmware over the internet (I will test this soon), so that all you would need is a Linux system on the wifi, to be able to reprogram any networked RFC2217 AVR within that network.  Another idea is if you need to reprogram your AVR based sprinklers, instead of bringing it inside, you just bring a Raspberry Pi + USB wifi adapter + batteries + serial cable to the unit.  Push a button, and the firmware is flashed from your remote computer.  Pretty awesome.

I’ve uploaded this updated LScreamer to bitbucket this time, a link to it should be in the side bar.  Feel free to ask any questions about getting started with LScreamer.


Newest Project: Linux Serial Commander

LSCommander on left, Raspberry Pi on right

LSCommander on left, Raspberry Pi on right

Recently I was playing around with the Raspberry Pi and thought of how useful it would be to pair an 16×2 character LCD + buttons with it so that I could control it on the go.  After a few hours of brainstorming, I came up with the Linux Serial Commander, which is an Arduino + LCD + buttons, paired with a Linux system running a python server that I wrote.

Here’s a short video of it in action (recorded using guvcview in Linux):

Linux Serial Commander operation from Dustin Robotics on Vimeo.

Continue reading

LScreamer – Linux Wireless Firmware Downloader

Hello Sparkfun people!

Well I really liked the Screamer V2.0 from Sparkfun.com but the program was written in Visual Basic 6.  Since I’m a linux guy, I was running it thru virtual box and I needed to add support for the ATMEGA1280, so I had to choose between learning VB6 or something better.  I chose to write it in Python for linux, so I wouldn’t have to run the Windows XP image through VirtualBox.

LScreamer lets you scan the serial ports currently used by your system, and gives some good examples of how to use it.  I used the pocket programmer to download the bootloader via the ISP header, and I’ve made LScreamer to be fully compliant with Screamer V2.0.  It’s a command line utility, but it is very user friendly if your new to Linux or the command line.

I made it pretty easy to add new processors to it, and if you do, it would be great if you passed it onto me so I can update LScreamer.

Software PWM for 6 Servos on ATmega168

Man, you guys are in for a treat!  Although this has been done before, people usually don’t attempt to do this while doing other things.  In this case, I datalog.  So I can have up to 6 servo’s going with different angles while I’m taking measurements every 200 ms.  Pretty awesome!

I attached the code below, but I’m sure you will see this code again as I’m going to use this ATmega168 to control a Traxxas Slash RC car 🙂
Continue reading