Skip to content

Instantly share code, notes, and snippets.

@ConnorRigby
Last active October 23, 2016 16:41
Show Gist options
  • Save ConnorRigby/b8acfeb91d1c087680efeb489d9c926c to your computer and use it in GitHub Desktop.
Save ConnorRigby/b8acfeb91d1c087680efeb489d9c926c to your computer and use it in GitHub Desktop.
script to download the latest farmbot arduino firmware
sudo -i
apt-get install avrdude
mkdir /tmp/farmbot-firmware
cd /tmp/farmbot-firmware
wget https://github.com/FarmBot/farmbot-arduino-firmware/releases/download/v0.0.1/firmware.hex -O firmware.hex
HEX_FILE=$(pwd)/firmware.hex
if [ -a /dev/ttyACM0 ]
then
TTY=/dev/ttyACM0
elif [ -a /dev/ttyUSB0 ]
then
TTY=/dev/ttyUSB0
fi
avrdude -v -patmega2560 -cwiring -P$TTY -b115200 -D -Uflash:w:$HEX_FILE:i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment