From 8ee2c44550677b1f03c71f3bce49d72a206d495b Mon Sep 17 00:00:00 2001 From: Christian Dahmen Date: Sat, 18 Jan 2025 00:24:24 +0100 Subject: [PATCH 001/108] Fixed DNRGBW --- wled00/udp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/udp.cpp b/wled00/udp.cpp index 8ba9a1a7..2e87d9d0 100644 --- a/wled00/udp.cpp +++ b/wled00/udp.cpp @@ -605,8 +605,8 @@ void handleNotifications() return; } - //UDP realtime: 1 warls 2 drgb 3 drgbw - if (udpIn[0] > 0 && udpIn[0] < 5) + //UDP realtime: 1 warls 2 drgb 3 drgbw 4 dnrgb 5 dnrgbw + if (udpIn[0] > 0 && udpIn[0] < 6) { realtimeIP = (isSupp) ? notifier2Udp.remoteIP() : notifierUdp.remoteIP(); DEBUG_PRINTLN(realtimeIP); From 27d3420ad7e81fb78e30f3833579b02d37a12e2b Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 09:31:51 +0000 Subject: [PATCH 002/108] Build each usermod in isolation --- .github/workflows/usermods.yml | 70 ++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/usermods.yml diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml new file mode 100644 index 00000000..58973e95 --- /dev/null +++ b/.github/workflows/usermods.yml @@ -0,0 +1,70 @@ +name: Usermod CI + +on: + push: +# paths: +# - usermods/** + +jobs: + + get_usermod_envs: + name: Gather Environments + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - name: Install PlatformIO + run: pip install -r requirements.txt + - name: Get default environments + id: envs + run: | + echo -n "usermods=\"" >> $GITHUB_OUTPUT + find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo >> $GITHUB_OUTPUT + echo "\"" >> $GITHUB_OUTPUT + outputs: + usermods: ${{ steps.envs.outputs.usermods }} + + + build: + name: Build Enviornments + runs-on: ubuntu-latest + needs: get_usermod_envs + strategy: + fail-fast: false + matrix: + environment: [usermod] + usermod: ${{ needs.get_usermod_envs.outputs.usermods }} + steps: + - uses: actions/checkout@v4 + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'npm' + - run: npm ci + - name: Cache PlatformIO + uses: actions/cache@v4 + with: + path: | + ~/.platformio/.cache + ~/.buildcache + build_output + key: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}-${{ hashFiles('wled00/**', 'usermods/**') }} + restore-keys: pio-${{ runner.os }}-${{ matrix.environment }}-${{ hashFiles('platformio.ini', 'pio-scripts/output_bins.py') }}- + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + cache: 'pip' + - name: Install PlatformIO + run: pip install -r requirements.txt + - name: Add usermods environment + run: | + cp -v usermods/platformio_override.usermods.ini platformio_override.ini + echo -n "custom_usermods = ${{ matrix.usermod }}" >> platformio_override.ini + + - name: Build firmware + run: pio run -e ${{ matrix.environment }} From 0e7d5dd0133e027e0a794dd1401a6bfa91275416 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 09:38:30 +0000 Subject: [PATCH 003/108] Build each usermod in isolation --- .github/workflows/usermods.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 58973e95..0b51a393 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -21,9 +21,8 @@ jobs: - name: Get default environments id: envs run: | - echo -n "usermods=\"" >> $GITHUB_OUTPUT - find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo >> $GITHUB_OUTPUT - echo "\"" >> $GITHUB_OUTPUT + mods=`find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo` + echo -n "usermods=\"$mods\"" >> $GITHUB_OUTPUT outputs: usermods: ${{ steps.envs.outputs.usermods }} From 04c7eace09bcd64ef3d946df8b97d203d638fc37 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 09:49:06 +0000 Subject: [PATCH 004/108] Use JSON for usermods list --- .github/workflows/usermods.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 0b51a393..12436722 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -8,7 +8,7 @@ on: jobs: get_usermod_envs: - name: Gather Environments + name: Gather Usermods runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -21,7 +21,7 @@ jobs: - name: Get default environments id: envs run: | - mods=`find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | xargs echo` + mods=`find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | jq -R | jq --slurp -c` echo -n "usermods=\"$mods\"" >> $GITHUB_OUTPUT outputs: usermods: ${{ steps.envs.outputs.usermods }} @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: environment: [usermod] - usermod: ${{ needs.get_usermod_envs.outputs.usermods }} + usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }} steps: - uses: actions/checkout@v4 - name: Set up Node.js From b3af04d3ca1dfb6a3936d5ff1ac5b5e5fa5fadcb Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 09:49:42 +0000 Subject: [PATCH 005/108] Use JSON for usermods list --- .github/workflows/usermods.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 12436722..efd5296d 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -22,7 +22,7 @@ jobs: id: envs run: | mods=`find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | jq -R | jq --slurp -c` - echo -n "usermods=\"$mods\"" >> $GITHUB_OUTPUT + echo "usermods=$mods >> $GITHUB_OUTPUT outputs: usermods: ${{ steps.envs.outputs.usermods }} From b1b2eead26d7bae5a600994d127e539412d4b47e Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 09:53:24 +0000 Subject: [PATCH 006/108] Use JSON for usermods list --- .github/workflows/usermods.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index efd5296d..ec5f9876 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -21,8 +21,7 @@ jobs: - name: Get default environments id: envs run: | - mods=`find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | jq -R | jq --slurp -c` - echo "usermods=$mods >> $GITHUB_OUTPUT + echo "usermods=$(find usermods/ -name library.json | xargs dirname | xargs -n 1 basename | jq -R | jq --slurp -c)" >> $GITHUB_OUTPUT outputs: usermods: ${{ steps.envs.outputs.usermods }} From 8d4c9119b49f956397d4c86d37cfbd3e962a6a6f Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 09:55:34 +0000 Subject: [PATCH 007/108] Fix typo in env name --- .github/workflows/usermods.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index ec5f9876..21fef248 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - environment: [usermod] + environment: [usermods] usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }} steps: - uses: actions/checkout@v4 From 7d48bba926aa932ae453901a3f8f2714a753dc80 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 10:09:51 +0000 Subject: [PATCH 008/108] build usermod_esp32 --- .github/workflows/usermods.yml | 2 +- usermods/platformio_override.usermods.ini | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 usermods/platformio_override.usermods.ini diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 21fef248..9a81d464 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - environment: [usermods] + environment: [usermod_esp32] usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }} steps: - uses: actions/checkout@v4 diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini new file mode 100644 index 00000000..611dc0d8 --- /dev/null +++ b/usermods/platformio_override.usermods.ini @@ -0,0 +1,11 @@ +[env:usermod_esp32] +board = esp32dev +platform = ${esp32_idf_V4.platform} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMOD\" + -DTOUCH_CS=9 + -DMQTTSWITCHPINS=8 +lib_deps = ${esp32_idf_V4.lib_deps} +monitor_filters = esp32_exception_decoder +board_build.flash_mode = dio + From 74672e21303e489b8db32253fdb78837badbf975 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 10:13:36 +0000 Subject: [PATCH 009/108] Verify each usermod on change --- .github/workflows/usermods.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 9a81d464..fed79f57 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -2,8 +2,8 @@ name: Usermod CI on: push: -# paths: -# - usermods/** + paths: + - usermods/** jobs: From 99108f9eff7587f762e69fb8880bf1d209aa332e Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 10:15:35 +0000 Subject: [PATCH 010/108] Swap ordering to see if naming is then clearer --- .github/workflows/usermods.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index fed79f57..7467d991 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -33,8 +33,8 @@ jobs: strategy: fail-fast: false matrix: - environment: [usermod_esp32] usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }} + environment: [usermod_esp32] steps: - uses: actions/checkout@v4 - name: Set up Node.js From 199529a031c7ef0d56c1c79fcb1b3a13c38a0f2e Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Wed, 22 Jan 2025 10:16:56 +0000 Subject: [PATCH 011/108] Also run if the workflow changes --- .github/workflows/usermods.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 7467d991..02a404ba 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -4,6 +4,7 @@ on: push: paths: - usermods/** + - .github/workflows/usermods.yml jobs: From cf391034da3556f2d1fc660d07a7f578c79c8c1f Mon Sep 17 00:00:00 2001 From: Jason Somers <121630262+jasonsomers@users.noreply.github.com> Date: Tue, 25 Mar 2025 13:54:06 -0400 Subject: [PATCH 012/108] Update settings_wifi.htm Several of our controllers support the Ethernet module, so we figured it best to leave it as simply "RGB2Go" in the menu, as opposed to "RBG2Go" Tetra. --- wled00/data/settings_wifi.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/data/settings_wifi.htm b/wled00/data/settings_wifi.htm index 1531d161..ab08f8ca 100644 --- a/wled00/data/settings_wifi.htm +++ b/wled00/data/settings_wifi.htm @@ -216,7 +216,7 @@ Static subnet mask:
- + From ff3680813ca34d8e088d19b7a98b31c0f7be0744 Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sat, 29 Mar 2025 14:08:23 +0100 Subject: [PATCH 013/108] Create wled-tools.sh Per discussion, add a discover-fueled tool to update/backup wled devices in the local network. --- tools/wled-tools.sh | 226 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 tools/wled-tools.sh diff --git a/tools/wled-tools.sh b/tools/wled-tools.sh new file mode 100644 index 00000000..4ea3282f --- /dev/null +++ b/tools/wled-tools.sh @@ -0,0 +1,226 @@ +#!/bin/bash + +# ===================== +# wled-toolbox.sh - A script for managing WLED devices +# ===================== + +# Color Definitions +GREEN="\e[32m" +RED="\e[31m" +BLUE="\e[34m" +YELLOW="\e[33m" +RESET="\e[0m" + +# Path to backup directory +backup_dir="./" + +# Firmware file (if provided) +firmware_file="" + +# Logging function +log() { + local category="$1" + local color="$2" + local text="$3" + + if [ "$quiet" = true ]; then + return + fi + + if [ -t 1 ]; then # Check if output is a terminal + echo -e "${color}[${category}]${RESET} ${text}" + else + echo "[${category}] ${text}" + fi +} + +# Generic curl handler function +curl_handler() { + local command="$1" + local hostname="$2" + + response=$($command -w "%{http_code}" -o /dev/null) + curl_exit_code=$? + + if [ "$response" -ge 200 ] && [ "$response" -lt 300 ]; then + return 0 + elif [ $curl_exit_code -ne 0 ]; then + log "ERROR" "$RED" "Connection error during request to $hostname (curl exit code: $curl_exit_code)." + return 1 + elif [ "$response" -ge 400 ]; then + log "ERROR" "$RED" "Server error during request to $hostname (HTTP status code: $response)." + return 2 + else + log "ERROR" "$RED" "Unexpected response from $hostname (HTTP status code: $response)." + return 3 + fi +} + +# Print help message +show_help() { + cat << EOF +Usage: wled-toolbox.sh [OPTIONS] COMMAND [ARGS...] + +Options: + -h, --help Show this help message and exit. + -v, --verbose Enable verbose output for debugging. + -t, --target Specify a single WLED device by IP address or hostname. + -D, --discover Discover multiple WLED devices using mDNS. + -d, --directory Specify a directory for saving backups (default: working directory). + -f, --firmware Specify the firmware file for updating devices. + -q, --quiet Suppress logging output (also makes discover output hostnames only). + +Commands: + backup Backup the current state of a WLED device or multiple discovered devices. + update Update the firmware of a WLED device or multiple discovered devices. + discover Discover WLED devices using mDNS and list their IP addresses and names. + +EOF +} + +# Discover devices using mDNS +discover_devices() { + if ! command -v avahi-browse &> /dev/null; then + log "ERROR" "$RED" "'avahi-browse' is required but not installed." + exit 1 + fi + + mapfile -t hostnames < <(avahi-browse _wled._tcp --terminate -r -p | awk -F';' '/^=/ {print $7}') + if [ "$quiet" = true ]; then + for hostname in "${hostnames[@]}"; do + echo "$hostname" + done + else + printf "%s\n" "${hostnames[@]}" | sort -u + fi +} + +# Backup one device +backup_one() { + local hostname="$1" + + log "INFO" "$YELLOW" "Backing up device config/presets: $hostname" + + mkdir -p "$backup_dir" + + local cfg_url="http://$hostname/cfg.json" + local presets_url="http://$hostname/presets.json" + local cfg_dest="${backup_dir}/${hostname}.cfg.json" + local presets_dest="${backup_dir}/${hostname}.presets.json" + + # Write to ".tmp" files first, then move when success, to ensure we don't write partial files + local curl_command_cfg="curl -s "$cfg_url" -o "$cfg_dest.tmp"" + local curl_command_presets="curl -s "$presets_url" -o "$presets_dest.tmp"" + + curl_handler "$curl_command_cfg" "$hostname" + curl_handler "$curl_command_presets" "$hostname" + + mv "$cfg_dest.tmp" "$cfg_dest" + mv "$presets_dest.tmp" "$presets_dest" +} + +# Update one device +update_one() { + local hostname="$1" + local firmware="$2" + + log "INFO" "$YELLOW" "Starting firmware update for device: $hostname" + + if [ -z "$firmware" ]; then + log "ERROR" "$RED" "Firmware file not specified." + exit 1 + fi + + local url="http://$hostname/update" + local curl_command="curl -s -X POST -F "file=@$firmware" "$url"" + + curl_handler "$curl_command" "$hostname" +} + +# Command-line arguments processing +command="" +target="" +discover=false +quiet=false + +if [ $# -eq 0 ]; then + show_help + exit 0 +fi + +while [[ $# -gt 0 ]]; do + case "$1" in + -h|--help) + show_help + exit 0 + ;; + -v|--verbose) + verbose=true + shift + ;; + -t|--target) + target="$2" + shift 2 + ;; + -D|--discover) + discover=true + shift + ;; + -d|--directory) + backup_dir="$2" + shift 2 + ;; + -f|--firmware) + firmware_file="$2" + shift 2 + ;; + -q|--quiet) + quiet=true + shift + ;; + backup|update|discover) + command="$1" + shift + ;; + *) + log "ERROR" "$RED" "Unknown argument: $1" + exit 1 + ;; + esac + +done + +# Execute the appropriate command +case "$command" in + discover) + discover_devices + ;; + backup) + if [ -n "$target" ]; then + backup_one "$target" + elif [ "$discover" = true ]; then + for hostname in $(discover_devices); do + backup_one "$hostname" + done + else + log "ERROR" "$RED" "No target specified. Use --target or --discover." + exit 1 + fi + ;; + update) + if [ -n "$target" ]; then + update_one "$target" "$firmware_file" + elif [ "$discover" = true ]; then + for hostname in $(discover_devices); do + update_one "$hostname" "$firmware_file" + done + else + log "ERROR" "$RED" "No target specified. Use --target or --discover." + exit 1 + fi + ;; + *) + show_help + exit 1 + ;; +esac From 0139c34ec276d2987156daf7837bb1b8f07ec0c3 Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sat, 29 Mar 2025 14:10:33 +0100 Subject: [PATCH 014/108] Rename script in help text --- tools/wled-tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/wled-tools.sh b/tools/wled-tools.sh index 4ea3282f..731841c7 100644 --- a/tools/wled-tools.sh +++ b/tools/wled-tools.sh @@ -59,7 +59,7 @@ curl_handler() { # Print help message show_help() { cat << EOF -Usage: wled-toolbox.sh [OPTIONS] COMMAND [ARGS...] +Usage: wled-tools.sh [OPTIONS] COMMAND [ARGS...] Options: -h, --help Show this help message and exit. From 8a6e3a9898ff8d11d59523740c61e3f50472d4e7 Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sat, 29 Mar 2025 18:20:29 +0100 Subject: [PATCH 015/108] Update wled-tools.sh --- tools/wled-tools.sh | 95 ++++++++++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 40 deletions(-) diff --git a/tools/wled-tools.sh b/tools/wled-tools.sh index 731841c7..45f67061 100644 --- a/tools/wled-tools.sh +++ b/tools/wled-tools.sh @@ -1,9 +1,5 @@ #!/bin/bash -# ===================== -# wled-toolbox.sh - A script for managing WLED devices -# ===================== - # Color Definitions GREEN="\e[32m" RED="\e[31m" @@ -11,12 +7,6 @@ BLUE="\e[34m" YELLOW="\e[33m" RESET="\e[0m" -# Path to backup directory -backup_dir="./" - -# Firmware file (if provided) -firmware_file="" - # Logging function log() { local category="$1" @@ -85,26 +75,29 @@ discover_devices() { exit 1 fi - mapfile -t hostnames < <(avahi-browse _wled._tcp --terminate -r -p | awk -F';' '/^=/ {print $7}') - if [ "$quiet" = true ]; then - for hostname in "${hostnames[@]}"; do - echo "$hostname" - done - else - printf "%s\n" "${hostnames[@]}" | sort -u - fi + mapfile -t raw_devices < <(avahi-browse _wled._tcp --terminate -r -p | awk -F';' '/^=/ {print $7, $8, $9}') + + local devices_array=() + for device in "${raw_devices[@]}"; do + read -r hostname address port <<< "$device" + devices_array+=("$hostname" "$address" "$port") + done + + echo "${devices_array[@]}" } # Backup one device backup_one() { local hostname="$1" + local address="$2" + local port="$3" - log "INFO" "$YELLOW" "Backing up device config/presets: $hostname" + log "INFO" "$YELLOW" "Backing up device config/presets: $hostname ($address:$port)" mkdir -p "$backup_dir" - local cfg_url="http://$hostname/cfg.json" - local presets_url="http://$hostname/presets.json" + local cfg_url="http://$address:$port/cfg.json" + local presets_url="http://$address:$port/presets.json" local cfg_dest="${backup_dir}/${hostname}.cfg.json" local presets_dest="${backup_dir}/${hostname}.presets.json" @@ -122,16 +115,13 @@ backup_one() { # Update one device update_one() { local hostname="$1" - local firmware="$2" + local address="$2" + local port="$3" + local firmware="$4" - log "INFO" "$YELLOW" "Starting firmware update for device: $hostname" + log "INFO" "$YELLOW" "Starting firmware update for device: $hostname ($address:$port)" - if [ -z "$firmware" ]; then - log "ERROR" "$RED" "Firmware file not specified." - exit 1 - fi - - local url="http://$hostname/update" + local url="http://$address:$port/update" local curl_command="curl -s -X POST -F "file=@$firmware" "$url"" curl_handler "$curl_command" "$hostname" @@ -142,6 +132,8 @@ command="" target="" discover=false quiet=false +backup_dir="./" +firmware_file="" if [ $# -eq 0 ]; then show_help @@ -154,10 +146,6 @@ while [[ $# -gt 0 ]]; do show_help exit 0 ;; - -v|--verbose) - verbose=true - shift - ;; -t|--target) target="$2" shift 2 @@ -193,14 +181,30 @@ done # Execute the appropriate command case "$command" in discover) - discover_devices + read -ra devices <<< "$(discover_devices)" + for ((i=0; i<${#devices[@]}; i+=3)); do + hostname="${devices[$i]}" + address="${devices[$i+1]}" + port="${devices[$i+2]}" + + if [ "$quiet" = true ]; then + echo "$hostname" + else + log "INFO" "$BLUE" "Discovered device: Hostname=$hostname, Address=$address, Port=$port" + fi + done ;; backup) if [ -n "$target" ]; then - backup_one "$target" + # Assume target is both the hostname and address, with port 80 + backup_one "$target" "$target" "80" elif [ "$discover" = true ]; then - for hostname in $(discover_devices); do - backup_one "$hostname" + read -ra devices <<< "$(discover_devices)" + for ((i=0; i<${#devices[@]}; i+=3)); do + hostname="${devices[$i]}" + address="${devices[$i+1]}" + port="${devices[$i+2]}" + backup_one "$hostname" "$address" "$port" done else log "ERROR" "$RED" "No target specified. Use --target or --discover." @@ -208,11 +212,22 @@ case "$command" in fi ;; update) + # Validate firmware before proceeding + if [ -z "$firmware_file" ] || [ ! -f "$firmware_file" ]; then + log "ERROR" "$RED" "Please provide a file in --firmware that exists" + exit 1 + fi + if [ -n "$target" ]; then - update_one "$target" "$firmware_file" + # Assume target is both the hostname and address, with port 80 + update_one "$target" "$target" "80" "$firmware_file" elif [ "$discover" = true ]; then - for hostname in $(discover_devices); do - update_one "$hostname" "$firmware_file" + read -ra devices <<< "$(discover_devices)" + for ((i=0; i<${#devices[@]}; i+=3)); do + hostname="${devices[$i]}" + address="${devices[$i+1]}" + port="${devices[$i+2]}" + update_one "$hostname" "$address" "$port" "$firmware_file" done else log "ERROR" "$RED" "No target specified. Use --target or --discover." From 6f5482782bb0c747c29a6c6e4cd2e5afcb8b2adc Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sat, 29 Mar 2025 21:38:31 +0100 Subject: [PATCH 016/108] Update wled-tools.sh --- tools/wled-tools.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/wled-tools.sh b/tools/wled-tools.sh index 45f67061..3ee574b9 100644 --- a/tools/wled-tools.sh +++ b/tools/wled-tools.sh @@ -53,7 +53,6 @@ Usage: wled-tools.sh [OPTIONS] COMMAND [ARGS...] Options: -h, --help Show this help message and exit. - -v, --verbose Enable verbose output for debugging. -t, --target Specify a single WLED device by IP address or hostname. -D, --discover Discover multiple WLED devices using mDNS. -d, --directory Specify a directory for saving backups (default: working directory). From dc5eaf3ae9b3aa4d9cef7914813c2f376df00ba7 Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Thu, 3 Apr 2025 21:46:58 +0200 Subject: [PATCH 017/108] Rename file --- tools/{wled-tools.sh => wled-tools} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tools/{wled-tools.sh => wled-tools} (100%) diff --git a/tools/wled-tools.sh b/tools/wled-tools similarity index 100% rename from tools/wled-tools.sh rename to tools/wled-tools From 646ec30ae5049a3387069d22cb85cbb61ee273c7 Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sun, 6 Apr 2025 01:07:40 +0200 Subject: [PATCH 018/108] Implement error checking for curl; add checks for required param args --- tools/wled-tools | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/wled-tools b/tools/wled-tools index 3ee574b9..d99e9e51 100644 --- a/tools/wled-tools +++ b/tools/wled-tools @@ -104,11 +104,22 @@ backup_one() { local curl_command_cfg="curl -s "$cfg_url" -o "$cfg_dest.tmp"" local curl_command_presets="curl -s "$presets_url" -o "$presets_dest.tmp"" - curl_handler "$curl_command_cfg" "$hostname" - curl_handler "$curl_command_presets" "$hostname" + if ! curl_handler "$curl_command_cfg" "$hostname"; then + log "ERROR" "$RED" "Failed to backup configuration for $hostname" + rm -f "$cfg_dest.tmp" + return 1 + fi + + if ! curl_handler "$curl_command_presets" "$hostname"; then + log "ERROR" "$RED" "Failed to backup presets for $hostname" + rm -f "$presets_dest.tmp" + return 1 + fi mv "$cfg_dest.tmp" "$cfg_dest" mv "$presets_dest.tmp" "$presets_dest" + log "INFO" "$GREEN" "Successfully backed up config and presets for $hostname" + return 0 } # Update one device @@ -146,6 +157,10 @@ while [[ $# -gt 0 ]]; do exit 0 ;; -t|--target) + if [ -z "$2" ] || [[ "$2" == -* ]]; then + log "ERROR" "$RED" "The --target option requires an argument." + exit 1 + fi target="$2" shift 2 ;; @@ -154,10 +169,18 @@ while [[ $# -gt 0 ]]; do shift ;; -d|--directory) + if [ -z "$2" ] || [[ "$2" == -* ]]; then + log "ERROR" "$RED" "The --directory option requires an argument." + exit 1 + fi backup_dir="$2" shift 2 ;; -f|--firmware) + if [ -z "$2" ] || [[ "$2" == -* ]]; then + log "ERROR" "$RED" "The --firmware option requires an argument." + exit 1 + fi firmware_file="$2" shift 2 ;; @@ -174,7 +197,6 @@ while [[ $# -gt 0 ]]; do exit 1 ;; esac - done # Execute the appropriate command From bc099baeb11fcb4cc43747c3f58d1df24f6e664a Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sun, 6 Apr 2025 01:10:27 +0200 Subject: [PATCH 019/108] Guard against hostnames/avahi responses with spaces --- tools/wled-tools | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tools/wled-tools b/tools/wled-tools index d99e9e51..345ef1ec 100644 --- a/tools/wled-tools +++ b/tools/wled-tools @@ -68,22 +68,23 @@ EOF } # Discover devices using mDNS -discover_devices() { - if ! command -v avahi-browse &> /dev/null; then - log "ERROR" "$RED" "'avahi-browse' is required but not installed." - exit 1 - fi +discover_devices() { + if ! command -v avahi-browse &> /dev/null; then + log "ERROR" "$RED" "'avahi-browse' is required but not installed." + exit 1 + fi - mapfile -t raw_devices < <(avahi-browse _wled._tcp --terminate -r -p | awk -F';' '/^=/ {print $7, $8, $9}') + # Map avahi responses to strings seperated by 0x1F (unit separator) + mapfile -t raw_devices < <(avahi-browse _wled._tcp --terminate -r -p | awk -F';' '/^=/ {print $7"\x1F"$8"\x1F"$9}') - local devices_array=() - for device in "${raw_devices[@]}"; do - read -r hostname address port <<< "$device" - devices_array+=("$hostname" "$address" "$port") - done + local devices_array=() + for device in "${raw_devices[@]}"; do + IFS=$'\x1F' read -r hostname address port <<< "$device" + devices_array+=("$hostname" "$address" "$port") + done - echo "${devices_array[@]}" -} + echo "${devices_array[@]}" +} # Backup one device backup_one() { From 5203c3927fbb5e97163704e2435bbeffb81ca0dc Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sun, 6 Apr 2025 01:11:20 +0200 Subject: [PATCH 020/108] Update tools/wled-tools Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- tools/wled-tools | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/wled-tools b/tools/wled-tools index 345ef1ec..40d2df91 100644 --- a/tools/wled-tools +++ b/tools/wled-tools @@ -135,7 +135,13 @@ update_one() { local url="http://$address:$port/update" local curl_command="curl -s -X POST -F "file=@$firmware" "$url"" - curl_handler "$curl_command" "$hostname" + if ! curl_handler "$curl_command" "$hostname"; then + log "ERROR" "$RED" "Failed to update firmware for $hostname" + return 1 + fi + + log "INFO" "$GREEN" "Successfully initiated firmware update for $hostname" + return 0 } # Command-line arguments processing From 9e96bd6705a08a1f70d24f74f141d805616faa1b Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sun, 6 Apr 2025 01:17:44 +0200 Subject: [PATCH 021/108] Add help examples, header --- tools/wled-tools | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/wled-tools b/tools/wled-tools index 40d2df91..1b27b113 100644 --- a/tools/wled-tools +++ b/tools/wled-tools @@ -1,5 +1,9 @@ #!/bin/bash +# WLED Tools +# A utility for managing WLED devices in a local network +# https://github.com/wled/WLED + # Color Definitions GREEN="\e[32m" RED="\e[31m" @@ -64,6 +68,19 @@ Commands: update Update the firmware of a WLED device or multiple discovered devices. discover Discover WLED devices using mDNS and list their IP addresses and names. +Examples: + # Discover all WLED devices on the network + ./wled-tools discover + + # Backup a specific WLED device + ./wled-tools -t 192.168.1.100 backup + + # Backup all discovered WLED devices to a specific directory + ./wled-tools -D -d /path/to/backups backup + + # Update firmware on all discovered WLED devices + ./wled-tools -D -f /path/to/firmware.bin update + EOF } From 81b74227fad6b2908757da6280abfe9d09a42969 Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Sun, 6 Apr 2025 01:20:24 +0200 Subject: [PATCH 022/108] Set executable --- tools/wled-tools | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 tools/wled-tools diff --git a/tools/wled-tools b/tools/wled-tools old mode 100644 new mode 100755 From 88aa8e817868e2edd718b26438058d19068deffc Mon Sep 17 00:00:00 2001 From: Michael Bisbjerg Date: Fri, 11 Apr 2025 16:15:52 +0200 Subject: [PATCH 023/108] Add note on avahi-utils --- tools/wled-tools | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/wled-tools b/tools/wled-tools index 1b27b113..9d196526 100755 --- a/tools/wled-tools +++ b/tools/wled-tools @@ -87,7 +87,7 @@ EOF # Discover devices using mDNS discover_devices() { if ! command -v avahi-browse &> /dev/null; then - log "ERROR" "$RED" "'avahi-browse' is required but not installed." + log "ERROR" "$RED" "'avahi-browse' is required but not installed, please install avahi-utils using your preferred package manager." exit 1 fi From 7852ff558eb9a5ebba13661b049e9317d097ad10 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 26 Apr 2025 14:44:48 +0100 Subject: [PATCH 024/108] Build for each chipset --- .github/workflows/usermods.yml | 2 +- usermods/platformio_override.usermods.ini | 44 +++++++++++++++++++---- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 02a404ba..06ce611b 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }} - environment: [usermod_esp32] + environment: [usermod_esp32, usermods_esp32c3, usermods_esp32s2, usermod_esp32s3] steps: - uses: actions/checkout@v4 - name: Set up Node.js diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini index 611dc0d8..c738077e 100644 --- a/usermods/platformio_override.usermods.ini +++ b/usermods/platformio_override.usermods.ini @@ -1,11 +1,41 @@ -[env:usermod_esp32] +[platformio] +default_envs = usermods_esp32, usermods_esp32c3, usermods_esp32s2, usermods_esp32s3 + +[env:usermods_esp32] board = esp32dev platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} -build_flags = ${common.build_flags} ${esp32_idf_V4.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMOD\" - -DTOUCH_CS=9 - -DMQTTSWITCHPINS=8 -lib_deps = ${esp32_idf_V4.lib_deps} -monitor_filters = esp32_exception_decoder -board_build.flash_mode = dio +build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\" +lib_deps = ${esp32.lib_deps} +board_build.partitions = ${esp32.big_partitions} +usermod = ${usermods.custom_usermods} +[env:usermods_esp32c3] +extends = esp32c3 +board = esp32-c3-devkitm-1 +platform = ${esp32_idf_V4.platform} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"C3_USERMODS\" +lib_deps = ${esp32.lib_deps} +board_build.partitions = ${esp32.big_partitions} +usermod = ${usermods.custom_usermods} + +[env:usermods_esp32s2] +extends = esp32s2 +platform = ${esp32_idf_V4.platform} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"S2_USERMODS\" +lib_deps = ${esp32.lib_deps} +board_build.partitions = ${esp32.big_partitions} +usermod = ${usermods.custom_usermods} + +[env:usermods_esp32s3] +extends = esp32s3 +platform = ${esp32_idf_V4.platform} +build_unflags = ${common.build_unflags} +build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"S3_USERMODS\" +lib_deps = ${esp32.lib_deps} +board_build.partitions = ${esp32.big_partitions} +usermod = ${usermods.custom_usermods} + +[usermods] \ No newline at end of file From b77881f634885889827643b070fc2cc45e525f9c Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 26 Apr 2025 14:46:55 +0100 Subject: [PATCH 025/108] Build for each chipset --- .github/workflows/usermods.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 06ce611b..4de88449 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }} - environment: [usermod_esp32, usermods_esp32c3, usermods_esp32s2, usermod_esp32s3] + environment: [usermods_esp32, usermods_esp32c3, usermods_esp32s2, usermod_esp32s3] steps: - uses: actions/checkout@v4 - name: Set up Node.js From fbb7ef7cfcd52eb46d7ace42869b1a36f566714a Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 26 Apr 2025 14:52:13 +0100 Subject: [PATCH 026/108] fix custom_usermods setting --- usermods/platformio_override.usermods.ini | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini index c738077e..5a0d8c3f 100644 --- a/usermods/platformio_override.usermods.ini +++ b/usermods/platformio_override.usermods.ini @@ -8,7 +8,7 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} -usermod = ${usermods.custom_usermods} +custom_usermods = ${usermods.custom_usermods} [env:usermods_esp32c3] extends = esp32c3 @@ -18,7 +18,7 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"C3_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} -usermod = ${usermods.custom_usermods} +custom_usermods = ${usermods.custom_usermods} [env:usermods_esp32s2] extends = esp32s2 @@ -27,7 +27,7 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"S2_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} -usermod = ${usermods.custom_usermods} +custom_usermods = ${usermods.custom_usermods} [env:usermods_esp32s3] extends = esp32s3 @@ -36,6 +36,7 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"S3_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} -usermod = ${usermods.custom_usermods} +custom_usermods = ${usermods.custom_usermods} -[usermods] \ No newline at end of file +[usermods] +# Added in CI \ No newline at end of file From 6c4d049c1acffc490116fa0e9fcce4bcc9739662 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 26 Apr 2025 15:06:07 +0100 Subject: [PATCH 027/108] force new line --- .github/workflows/usermods.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 4de88449..9b1dd2ab 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -63,7 +63,8 @@ jobs: - name: Add usermods environment run: | cp -v usermods/platformio_override.usermods.ini platformio_override.ini - echo -n "custom_usermods = ${{ matrix.usermod }}" >> platformio_override.ini + echo >> platformio_override.ini + echo "custom_usermods = ${{ matrix.usermod }}" >> platformio_override.ini - name: Build firmware run: pio run -e ${{ matrix.environment }} From 19ba25772217db8efe878aed6f1bf10f1d2b426c Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 26 Apr 2025 15:07:31 +0100 Subject: [PATCH 028/108] usermod_esp32s3 --- .github/workflows/usermods.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/usermods.yml b/.github/workflows/usermods.yml index 9b1dd2ab..a597d2bf 100644 --- a/.github/workflows/usermods.yml +++ b/.github/workflows/usermods.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: usermod: ${{ fromJSON(needs.get_usermod_envs.outputs.usermods) }} - environment: [usermods_esp32, usermods_esp32c3, usermods_esp32s2, usermod_esp32s3] + environment: [usermods_esp32, usermods_esp32c3, usermods_esp32s2, usermods_esp32s3] steps: - uses: actions/checkout@v4 - name: Set up Node.js From 92db9e0e002fe1c541005dae2de5d02df13a5ab4 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 26 Apr 2025 15:21:22 +0100 Subject: [PATCH 029/108] fix envs --- usermods/platformio_override.usermods.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini index 5a0d8c3f..a2324ba4 100644 --- a/usermods/platformio_override.usermods.ini +++ b/usermods/platformio_override.usermods.ini @@ -8,10 +8,11 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"ESP32_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} +board_build.flash_mode = dio custom_usermods = ${usermods.custom_usermods} [env:usermods_esp32c3] -extends = esp32c3 +extends = esp32c3dev board = esp32-c3-devkitm-1 platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} From f1c88bc38d5ef94d7c0a36af93ad033e42724a60 Mon Sep 17 00:00:00 2001 From: Will Tatam Date: Sat, 26 Apr 2025 15:54:14 +0100 Subject: [PATCH 030/108] fix envs --- usermods/platformio_override.usermods.ini | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usermods/platformio_override.usermods.ini b/usermods/platformio_override.usermods.ini index a2324ba4..127b5d33 100644 --- a/usermods/platformio_override.usermods.ini +++ b/usermods/platformio_override.usermods.ini @@ -19,25 +19,31 @@ build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"C3_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} +board_build.flash_mode = qio custom_usermods = ${usermods.custom_usermods} [env:usermods_esp32s2] -extends = esp32s2 +extends = esp32s2dev +board = esp32-c3-devkitm-1 platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"S2_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} +board_build.flash_mode = dio custom_usermods = ${usermods.custom_usermods} [env:usermods_esp32s3] extends = esp32s3 +board = esp32-s3-devkitc-1 platform = ${esp32_idf_V4.platform} build_unflags = ${common.build_unflags} build_flags = ${common.build_flags} ${esp32.build_flags} -D WLED_RELEASE_NAME=\"S3_USERMODS\" lib_deps = ${esp32.lib_deps} board_build.partitions = ${esp32.big_partitions} custom_usermods = ${usermods.custom_usermods} +board_build.flash_mode = qio + [usermods] # Added in CI \ No newline at end of file From dcd3e072739c47f1a4201b2df9f95209b4ee800d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Mon, 26 May 2025 18:00:45 +0200 Subject: [PATCH 031/108] Securing OTA update - prevent settings change if not using private IP address or same subnet - prevent OTA from differnet subnet if PIN is not set - ability to revert firmware --- wled00/cfg.cpp | 2 ++ wled00/data/settings_sec.htm | 3 +++ wled00/data/update.htm | 19 ++++++++++++--- wled00/set.cpp | 1 + wled00/wled.h | 1 + wled00/wled_server.cpp | 46 ++++++++++++++++++++++++++++++++---- wled00/xml.cpp | 1 + 7 files changed, 66 insertions(+), 7 deletions(-) diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index d3415efd..bb918f30 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -631,6 +631,7 @@ bool deserializeConfig(JsonObject doc, bool fromFS) { CJSON(aOtaEnabled, ota[F("aota")]); #endif getStringFromJson(otaPass, pwd, 33); //normally not present due to security + CJSON(otaSameSubnet, ota[F("same-subnet")]); } #ifdef WLED_ENABLE_DMX @@ -1127,6 +1128,7 @@ void serializeConfig(JsonObject root) { #ifndef WLED_DISABLE_OTA ota[F("aota")] = aOtaEnabled; #endif + ota[F("same-subnet")] = otaSameSubnet; #ifdef WLED_ENABLE_DMX JsonObject dmx = root.createNestedObject("dmx"); diff --git a/wled00/data/settings_sec.htm b/wled00/data/settings_sec.htm index 2db798cf..7f462704 100644 --- a/wled00/data/settings_sec.htm +++ b/wled00/data/settings_sec.htm @@ -57,6 +57,9 @@

Software Update


Enable ArduinoOTA:
+ Only allow update from same network/WiFi:
+ ⚠ If you are using multiple VLANs (i.e. IoT or guest network) either set PIN or disable this option.
+ Disabling this option will make your device less secure.


Backup & Restore

⚠ Restoring presets/configuration will OVERWRITE your current presets/configuration.
diff --git a/wled00/data/update.htm b/wled00/data/update.htm index 96ba821e..8b39b1cc 100644 --- a/wled00/data/update.htm +++ b/wled00/data/update.htm @@ -3,9 +3,20 @@ WLED Update +