LScreamer /

Filename Size Date modified Message
2217bootloader1280
2217bootloader168
2217bootloader328
2217bootloader328_8mhz
bin
bootloader1280
bootloader168
bootloader328
bootloader328_8mhz
53 B
44 B
4.4 KB

LScreamer and LScreamer2217

This program started as a port of Screamer V2.0 produced by Sparkfun.com which allows you to wirelessly download AVR firmware. What makes it special, is that the bootloader and python script can handle broken and corrupted frames.

LScreamer2217 supports RFC2217, which basically allows you to communicate with serial ports on different computers, over the network. This means that if you need to update the firmware on your AVR sprinkler control system, all you need is to connect that AVR to a computer on your network, and run the rfc2217_server.py script provided from the PySerial project at http://sourceforge.net/p/pyserial/code/461/tree/trunk/pyserial/examples/

Overview - LScreamer

To use LScreamer, you'll need to reflash the bootloader on your AVR. Currently LScreamer supports ATMEGA168, ATMEGA328, and ATMEGA1280 AVR's. A USBasp ISP programmer can be had on ebay for less than $4.

To program it in Linux, I used the following command (for an ATMEGA168 Diecimila, 16MHz) <Be sure to look up your chip before trusting this>:

sudo avrdude -p m168 -c usbasp -U flash:w:Wireless_Bootloader_ATmega168.hex -U lfuse:w:0xff:m -U hfuse:w:0xdd:m -U efuse:w:0x00:m

RFC2217

To use LScreamer in RFC2217 mode, you'll need to run the rfc2217 server.py on the system with the AVR connected to the serial port, and this LScreamer.py script with the -n flag. This was tested in Debian Wheezy Linux using Python 2.7.3 and PySerial 2.5-2.1.

On Server you'd run (192.168.100.132): python rfc2217_server.py /dev/ttyUSB0

On the remote dev machine you'd run: python LScreamer.py -n -p ATMEGA168 -i rfc2217://192.168.100.132:2217 ~/filename.hex

If there's an error in the LScreamer.py, you'll need to close that terminal, since I'm not quite sure how to get it to properly recognize CTRL+C, but once you get it setup, you won't have to worry.

I'd suggest checking that you can communicate with the remote server using miniterm.py: http://sourceforge.net/p/pyserial/code/461/tree/trunk/pyserial/serial/tools/

One side effect of using RFC2217 is that the hidden characters typically used in bootloaders, can't be used, so now you'll see '?' when its ready to bootload, which can be useful in debugging this.

Raspberry Pi Serial Host

With the Raspbian image, I had no problem running the rfc2217 server, and flashing my ATMEGA168 hexfile over the network.

PogoPlug E02 Serial Host

With running the latest Arch Linux Arm community version, I ran into the following problem:

[root@pogoplug1 ~]# python rfc2217_server.py /dev/ttyUSB0 Traceback (most recent call last): File "rfc2217_server.py", line 14, in <module> import serial.rfc2217 File "/usr/lib/python2.7/site-packages/serial/rfc2217.py", line 67, in <module> import queue

To solve it, I changed the effected module, replacing (import queue), with (import Queue):

[root@pogoplug1 ~]# vim /usr/lib/python2.7/site-packages/serial/rfc2217.py

I've filed a bug in the ArchLinux bug tracker, so I imagine it will eventually be fixed.

Development Environment

This set of programs was developed in Crunchbang Linux (Debian 7 stable, openbox, tint2). To program the Arduino, I used Arduino-mk in combination with my Lscreamer python script. LScreamer lets you flash over unreliable networks (wireless, wifi, ethernet). I now run this development environment within a VirtualBox VM, allowing me to preserve my precise development environment effortlessly.

Arduino-mk: https://github.com/sudar/Arduino-Makefile/

LScreamer:https://bitbucket.org/dustin-robotics/lscreamer/

Links

My Blog:http://mecharobotics.wordpress.com

Arduino-mk:https://github.com/sudar/Arduino-Makefile/

LScreamer:https://bitbucket.org/dustin-robotics/lscreamer/

RFC2217 Inspiration:http://robosavvy.com/forum/viewtopic.php?t=7578