Add extras and build scripts

This commit is contained in:
Nik Rozman
2022-10-24 15:04:38 +02:00
parent 8ad8f768b5
commit fce951a70f
3 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# /etc/ser2net.conf
# This file is part of the source device.
2000:raw:600:/dev/ttyACM0:9600 8DATABITS NONE 1STOPBIT

View File

@@ -0,0 +1,19 @@
# This file is part of the Home Assistant server.
[Unit]
Description=Socat bridge to ser2net
After=wg-quick@wg0.service
Requires=wg-quick@wg0.service
[Service]
Type=simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=socat-bridge
ExecStartPre=/usr/bin/rm -rf /dev/ttyV0
ExecStart=/usr/bin/socat pty,link=/dev/ttyV0,waitslave tcp:10.10.0.2:2000
Restart=always
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Stop ser2net to free serial port
service ser2net stop
# Flash the firmware
avrdude -v -p m328p -F -P /dev/serial/by-id/usb-Arduino__www.arduino.cc__0043_95032303837351D02141-if00 -c arduino -D -U flash:w:../vremenska-postaja.ino.hex:i
# Start ser2net
service ser2net start