add automatic flash script

This commit is contained in:
interfisch 2022-07-25 13:59:05 +02:00
parent d2085041c6
commit fb80090d1b
2 changed files with 19 additions and 1 deletions

18
otaflash.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
do_this_on_ctrl_c(){
echo "Stopped searching!"
exit 0
}
trap 'do_this_on_ctrl_c' SIGINT
printf "ip: %s" "$1"
printf "\n%s" "waiting for Device ..."
while ! ping -c 1 -n -w 1 $1 &> /dev/null
do
printf "%c" "."
done
printf "\n%s\n" "Device is online"
pio run -t upload --upload-port $1

View File

@ -8,7 +8,7 @@
#define OTA_WIFI_SSID "Chaos-West temp alternative" #define OTA_WIFI_SSID "Chaos-West temp alternative"
#define OTA_WIFI_PASSWORD "" #define OTA_WIFI_PASSWORD ""
#define OTA_WAIT_TIMEOUT 1000 // in 0.1s increments -> 10s #define OTA_WAIT_TIMEOUT 20 // in 0.1s increments -> 10s
#define OTA_PASSWORD "MCH2022OTA" //password needed for ota flashing #define OTA_PASSWORD "MCH2022OTA" //password needed for ota flashing
void checkOTA(); void checkOTA();