diff --git a/otaflash.sh b/otaflash.sh new file mode 100644 index 0000000..54f51fd --- /dev/null +++ b/otaflash.sh @@ -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 + diff --git a/src/simpleota.h b/src/simpleota.h index bbd62f7..f2ee904 100644 --- a/src/simpleota.h +++ b/src/simpleota.h @@ -8,7 +8,7 @@ #define OTA_WIFI_SSID "Chaos-West temp alternative" #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 void checkOTA();