what if you plug a bunch of USB to the computer with different COM. Is there a way to upload one sketch do different COM connections at a time
in bash (or sh) you'd just do this (tested and uploads correctly to an uno and a duemilanove at the same time):
#!/bin/sh
FILE_TO_UPLOAD="$1"
ARDUINO_DIR="/home/adam/arduino-unstable"
for CUR_PORT in $(find /dev/ttyACM*)
do
echo "$CUR_PORT"
"$ARDUINO_DIR"/hardware/tools/avrdude -C"$ARDUINO_DIR"/hardware/tools/avrdude.conf -q -q -q -q -patmega328p -carduino -P/"$CUR_PORT" -b115200 -D -Uflash:w:"$FILE_TO_UPLOAD":i &
done
for CUR_PORT in $(find /dev/ttyUSB*)
do
echo "$CUR_PORT"
"$ARDUINO_DIR"/hardware/tools/avrdude -C"$ARDUINO_DIR"/hardware/tools/avrdude.conf -q -q -q -q -patmega328p -carduino -P"$CUR_PORT" -b57600 -D -Uflash:w:"$FILE_TO_UPLOAD":i &
done
just call the program with the argument being the name of the .hex file to upload.
And sparkfun did a series on it:
http://www.sparkfun.com/tutorials/233EDIT: I just tested the script with a bigger file to upload, and it doesn't work as well (ie fails). It seems like avrdude isn't reentrant. But there's not that big of an advantage to getting it parallelized, so if you just remove the & it works great.