find Arduino's ttyACM from dmesg output
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 13 Aug 2013 12:37:49 +0000 (14:37 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 13 Aug 2013 12:37:49 +0000 (14:37 +0200)
arduino-uno-env.sh

index 37f1850..1267524 100644 (file)
@@ -1,4 +1,5 @@
 echo source this file in current shell
 export board=arduino
-export GOODFET=/dev/ttyACM0
+export GOODFET=`dmesg | grep -C 5 www.arduino.cc | grep ttyACM | cut -d: -f3 | sed 's,^ ,/dev/,'`
+test -z "$GOODFET" && echo "can't find ttyACM for Arduino plug it in and re-run script"