]> git.zerfleddert.de Git - fhem-stuff/blob - CUL/update-cul
bca664e5e1afd2c92d9afd547847c19aecba7806
[fhem-stuff] / CUL / update-cul
1 #!/bin/sh
2
3 set -e
4
5 if [ "`id -u`" != "0" ]; then
6 exec sudo "${0}" "${@}"
7 fi
8
9 if [ "`lsusb -d 03eb:204b`" != "" ]; then
10 echo "Found running CUL, entering bootloader..."
11 echo "B01" >/dev/ttyACM0
12 sleep 1
13 fi
14
15 if [ "`lsusb -d 03eb:2ff4`" != "" ]; then
16 echo "Found CUL in bootloader-mode"
17 else
18 echo "No CUL in bootloader-mode found or unable to enter bootloader mode!"
19 fi
20
21 echo "Programming..."
22 set -x
23 dfu-programmer atmega32u4 erase
24 dfu-programmer atmega32u4 flash CUL_V3.hex
25 dfu-programmer atmega32u4 start
26
Impressum, Datenschutz