Remote upload Hex to Arduino over Raspberry Pi

posted 18 Feb 2017, 22:29 by Nhan Le Duy   [ updated 18 Feb 2017, 22:31 by Lê Duy Nhân ]
1. Remote upload code(Hex file) to Arduino over Rpi with auto reset
-  Install Wiringpi
- Install Avrdude
- Create a folder Arduino on home/pi
- Copy file hex to this folder by using WINCSP
- Create a file such as with content like this

gpio mode 26 out
gpio write 26 1
gpio write 26 0
gpio write 26 1
gpio mode 26 in
/usr/bin/avrdude -q -V -D -p atmega328p -C /etc/avrdude.conf -c arduino -b 57600 -P /dev/ttyAMA0 -U flash:w:$1:i

We use GPIO26 for DTR pin to reset Arduino
Remember replacing parameter MCU type for your case

2. GPIO Raspberry and WiringPi pin Map