How to program 55 Arduinos and stay sane
For a recent, yet to be blogged about project I had to program 55 Arduino boards. I don't really mind repetitive jobs but you still want to make things as simple as possible. There's no point doing something that takes one minute 55 times if you can write a script in 5 minutes and then take 10 seconds to do the job 55 times. That's a saving of at least half an hour, or a lot more if you have to do the job more than once!
In this particular instance, as you can see from the picture above, we chose the Seeeduino v3.0 from Seeed Studio. There were a couple of reasons for this; one was cost, they are a large enough amount cheaper than the alternatives that when you multiply it by 55 the saving certainly adds up. Two was the low profile nature of the Atmega chip, power jack and USB connector, with the shield we stacked on top this was useful.
So if I stop beating around the bush, this is the part you want to know. Using the excellent command line Arduino toolkit, Ino and a tiny script I wrote, all you need to do is plug and un-plug an Arduino and watch the screen. That's it. This is the script;
#!/bin/bash if [ -z $1 ]; then echo 'Usage: '$0' /dev/tty...' exit 1 fi DEVICE=$1 NEW=true echo 'Ready to program Arduino on '$DEVICE while true; do if [ -c $DEVICE ]; then if $NEW; then ino upload NEW=false echo 'Next please...' fi else NEW=true fi sleep 0.2 done
For those who are after more info on the project itself I've got some more info to come which I'll be posting on the blog. Any questions in the mean time feel free to comment below.
Can't wait to see the project blog too :)
John
Should have mentioned you can also do exactly the same thing with avrdude directly which I did earlier but Ino is such a great tool I've been using it more and more.
hads