Remote upload Hex to Arduino over Raspberry Pi

Post date: Feb 19, 2017 6:29:15 AM

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 upload.sh with content like this

#!/bin/bash

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