George wrote up an Arduino sketch that can detect and program other Arduinos connected through serial. He demonstrates the functionality above by writing a sort of serial-synchronized version of the well-known “Blink” sketch –
It is an implementation of the STK500 protocol within an Arduino sketch. STK500 is used by avrdude and the Arduino IDE to write sketches to AVR chips.
A normal sketch (‘BlinkSync’ is used in the video) is first compiled and then converted from the Intel Hex format to a series of bytes written in C (by a Python script), which can be inserted into the Copier sketch as the data to be written to the destination Arduinos.
Afterwards, the Copier sketch and the BlinkSync sketch are stuck together, resulting in a sketch that performs both the original task and the copying of that task to other boards.
Quite cool – reminds me a bit of the Illuminato X Machina project demo. Now we just need to get Arduino writing it’s own code ;-]
12 thoughts on “Arduino sketch programs its peers”
Comments are closed.
Yes folks, it’s the first Arduino Virus!
I was just thinking the same thing. The beginnings of virus programming for the Arduino.
If skynet runs on arduino I will will not be apart of the resistance. I love my arduinos too much to fight back.
Nice work. Have a look at LumiNet: http://www.luminet.cc
LumiNet has a “Vector node” that infects the LumiNet network. Each node can infect its four direct neighbors. Each node can also be infected by each one of its direct four neighbors…
The program code that is stored in flash memory is transmitted to the neighbors… this is possible because LumiNet runs on attiny microcontrollers and they don’t have a dedicated bootsection.
I patched the official Arduino 0014 release in order to add support for this “programming by infection” bootloader and some other features. The user does not see a difference between programming an Arduino and a LumiNet network. Everything is done within the Arduino IDE, no python scripts.
Have a look at it :)
There is more information in this thread of the Arduino forum: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1236434254/0
Cheers,
René
I’ve uploaded the code: http://github.com/George1024/Arduino-Copier
Enjoy!
Is the a first version Arduino virus?