Skip to content

Instantly share code, notes, and snippets.

@tecteun
Last active June 2, 2018 22:19
Show Gist options
  • Save tecteun/6ffe965b0923883cef9fa0883ab9bfe5 to your computer and use it in GitHub Desktop.
Save tecteun/6ffe965b0923883cef9fa0883ab9bfe5 to your computer and use it in GitHub Desktop.
Arduino IDE remote upload configuration, network tcp upload bridge to leonardo connected to rpi
<!-- file: /etc/avahi/services/arduino.service -->
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">'%h' arduino bridge</name>
<service>
<type>_arduino._tcp</type>
<!-- port value not actually used when ssh_upload=yes -->
<port>22</port>
<txt-record>board=leonardo</txt-record>
<txt-record>tcp_check=yes</txt-record>
<txt-record>ssh_upload=yes</txt-record>
<txt-record>auth_upload=yes</txt-record>
</service>
</service-group>
#!/usr/bin/env python
#file: /home/pi/reset.py
import sys
import serial
ser = serial.Serial(sys.argv[1], 1200)
ser.close()
#!/bin/sh
#https://www.avrfreaks.net/forum/solved-programming-arduino-leonardo-avrdude
#file: /usr/bin/run-avrdude
/home/pi/reset.py /dev/ttyACM0
sleep 2
avrdude -v -v -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -V -Uflash:w:$1:i $2
#avrdude -c linuxgpio -C /etc/avrdude.conf -p m32u4 -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xFB:m -Uflash:w:$1:i $2
#file: /etc/ser2net.conf
127.0.0.1,6571:raw:600:/dev/ttyACM0:115200 8DATABITS NONE 1STOPBIT -XONXOFF LOCAL -RTSCTS HANGUP_WHEN_DONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment