From 1752caaf19ca9ab65b0df8a192af4c50c344a4c1 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 00:21:06 +0100 Subject: [PATCH] --web added to device-install(.sh/.bat) (#5405) * Add --web * Update device-install.bat Forgot a "-" a few places. --------- Co-authored-by: Ben Meadors --- 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 f8ca9e408..5e0f1c847 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 b2a5684ee..9cdf635d7 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 <