I’m wondering if there is an easier way to upload arduino sketches to an arduino using the command line? I’ve found this:
https://github.com/todbot/ArduinoOnBeagleBone/blob/master/building-beaglebone-avr-arduino-tools.txt but the last time it was updated was over a year ago. I’ve also run out disk space trying to follow those instructions.
My arduino is always plugged into the BBB and it would be nice to be able to leave it plugged in when I want to update the firmware.
Thanks in advance.
If you can do the compilation on the desktop, or on another PC, uploading the binaries is straightforward with avrdude. eg. to upload to an Uno:
$ avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -p atmega328p -c arduino -P /dev/ttyACM0 -b 115200 -D -U flash:w:$HOME/arduino/sketch.cpp.hex:i
The USB device name may be different under different linux distributions. Just look in /dev to see what device appears when you plug the Arduino in.
You may need to give yourself permission to access the serial devices, eg:
$ sudo usermod -a -G tty tim $ sudo usermod -a -G dialout tim
Thanks, I’ll definitely be using this in the meantime. Eventually, it would be nice to change a file, and with one command compile and flash. Just have to wait for someone smarter than me to figure it all out. Until then, thanks Timbo.
Command line compilation for Arduino is awkward because the Arduino gui makes a lot of changes to the sketch code, and it’s hard to reliably reproduce all these changes with a makefile. There are a few projects which attempt to do this, including Arduino-mk and Inotool. Let us know if you get one of them working on the BBB.
Will do. I spent a good portion of the morning playing with Arduino-mk on ubuntu. I haven’t heard of Inotool, I’ll look into it.