From a935b0060a74fb0df9e46ed99236409440c77bce Mon Sep 17 00:00:00 2001 From: gjelsoe <36234524+gjelsoe@users.noreply.github.com> Date: Mon, 18 Nov 2024 21:06:35 +0100 Subject: [PATCH 1/4] Add --web --- bin/device-install.bat | 15 ++++++++++++--- bin/device-install.sh | 19 +++++++++++++++++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/bin/device-install.bat b/bin/device-install.bat index f8ca9e4086..88a093c73d 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -1,6 +1,7 @@ @ECHO OFF set PYTHON=python +set WEB_APP=0 :: Determine the correct esptool command to use where esptool >nul 2>&1 @@ -12,13 +13,14 @@ if %ERRORLEVEL% EQU 0 ( goto GETOPTS :HELP -echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] +echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] [-web] echo Flash image file to device, but first erasing and writing system information echo. echo -h Display this help and exit echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous). echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%) echo -f FILENAME The .bin file to flash. Custom to your device type and region. +echo -web Flash WEB APP. goto EOF :GETOPTS @@ -27,6 +29,7 @@ if /I "%1"=="--help" goto HELP if /I "%1"=="-F" set "FILENAME=%2" & SHIFT if /I "%1"=="-p" set ESPTOOL_PORT=%2 & SHIFT if /I "%1"=="-P" set PYTHON=%2 & SHIFT +if /I "%1"=="-web" set WEB_APP=1 & SHIFT SHIFT IF NOT "__%1__"=="____" goto GETOPTS @@ -49,8 +52,14 @@ IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% ( ) else ( %ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-s3.bin ) - for %%f in (littlefs-*.bin) do ( - %ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f + IF %WEB_APP%==1 ( + for %%f in (littlefsweb-*.bin) do ( + %ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f + ) + ) else ( + for %%f in (littlefs-*.bin) do ( + %ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f + ) ) ) else ( echo "Invalid file: %FILENAME%" diff --git a/bin/device-install.sh b/bin/device-install.sh index b2a5684eef..9cdf635d76 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -1,6 +1,7 @@ #!/bin/sh PYTHON=${PYTHON:-$(which python3 python | head -n 1)} +WEB_APP=false # Determine the correct esptool command to use if "$PYTHON" -m esptool version >/dev/null 2>&1; then @@ -19,16 +20,26 @@ set -e # Usage info show_help() { cat < Date: Wed, 20 Nov 2024 17:44:47 +0100 Subject: [PATCH 2/4] Update device-install.bat Forgot a "-" a few places. --- bin/device-install.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/device-install.bat b/bin/device-install.bat index 88a093c73d..5e0f1c8479 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -13,14 +13,14 @@ if %ERRORLEVEL% EQU 0 ( goto GETOPTS :HELP -echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] [-web] +echo Usage: %~nx0 [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME^|FILENAME] [--web] echo Flash image file to device, but first erasing and writing system information echo. echo -h Display this help and exit echo -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerrous). echo -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: %PYTHON%) echo -f FILENAME The .bin file to flash. Custom to your device type and region. -echo -web Flash WEB APP. +echo --web Flash WEB APP. goto EOF :GETOPTS @@ -29,7 +29,7 @@ if /I "%1"=="--help" goto HELP if /I "%1"=="-F" set "FILENAME=%2" & SHIFT if /I "%1"=="-p" set ESPTOOL_PORT=%2 & SHIFT if /I "%1"=="-P" set PYTHON=%2 & SHIFT -if /I "%1"=="-web" set WEB_APP=1 & SHIFT +if /I "%1"=="--web" set WEB_APP=1 & SHIFT SHIFT IF NOT "__%1__"=="____" goto GETOPTS From 070c34300a73beea8e167e9c33bb1b21eb104b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gjels=C3=B8?= <36234524+gjelsoe@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:49:56 +0100 Subject: [PATCH 3/4] Typo fix. --- bin/device-install.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/device-install.bat b/bin/device-install.bat index 5e0f1c8479..c18be89a8d 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -53,7 +53,7 @@ IF EXIST %FILENAME% IF x%FILENAME:update=%==x%FILENAME% ( %ESPTOOL_CMD% --baud 115200 write_flash 0x260000 bleota-s3.bin ) IF %WEB_APP%==1 ( - for %%f in (littlefsweb-*.bin) do ( + for %%f in (littlefswebui-*.bin) do ( %ESPTOOL_CMD% --baud 115200 write_flash 0x300000 %%f ) ) else ( From 2fbec87c56dbf7bea02efca778728dac4bf18143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gjels=C3=B8?= <36234524+gjelsoe@users.noreply.github.com> Date: Thu, 21 Nov 2024 19:51:11 +0100 Subject: [PATCH 4/4] Typo fix --- bin/device-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/device-install.sh b/bin/device-install.sh index 9cdf635d76..e09c61ba6b 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -85,7 +85,7 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then $ESPTOOL_CMD write_flash 0x260000 bleota-s3.bin fi if [ "$WEB_APP" = true ]; then - $ESPTOOL_CMD write_flash 0x300000 littlefsweb-*.bin + $ESPTOOL_CMD write_flash 0x300000 littlefswebui-*.bin else $ESPTOOL_CMD write_flash 0x300000 littlefs-*.bin fi