From 2ab717cebb2e7ff1dced1ec9ee8c2d8510411619 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 26 Jun 2025 10:57:33 -0500 Subject: [PATCH] Remove bundling of web-ui from ESP32 devices (#7143) --- .github/actions/build-variant/action.yml | 50 ++++++++++++------------ .github/workflows/build_esp32.yml | 2 +- .github/workflows/build_esp32_c3.yml | 2 +- .github/workflows/build_esp32_c6.yml | 2 +- .github/workflows/build_esp32_s3.yml | 2 +- .github/workflows/main_matrix.yml | 1 - bin/build-esp32.sh | 11 +++--- bin/device-install.bat | 19 ++------- bin/device-install.sh | 30 ++++++-------- 9 files changed, 50 insertions(+), 69 deletions(-) diff --git a/.github/actions/build-variant/action.yml b/.github/actions/build-variant/action.yml index 67d002eea..f611908ee 100644 --- a/.github/actions/build-variant/action.yml +++ b/.github/actions/build-variant/action.yml @@ -27,10 +27,10 @@ inputs: description: A newline separated list of paths to store as artifacts required: false default: "" - include-web-ui: - description: Include the web UI in the build - required: false - default: "false" + # include-web-ui: + # description: Include the web UI in the build + # required: false + # default: "false" arch: description: Processor arch name required: true @@ -43,29 +43,29 @@ runs: id: base uses: ./.github/actions/setup-base - - name: Get web ui version - if: inputs.include-web-ui == 'true' - id: webver - shell: bash - run: | - echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT + # - name: Get web ui version + # if: inputs.include-web-ui == 'true' + # id: webver + # shell: bash + # run: | + # echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT - - name: Pull web ui - if: inputs.include-web-ui == 'true' - uses: dsaltares/fetch-gh-release-asset@master - with: - repo: meshtastic/web - file: build.tar - target: build.tar - token: ${{ inputs.github_token }} - version: tags/v${{ steps.webver.outputs.ver }} + # - name: Pull web ui + # if: inputs.include-web-ui == 'true' + # uses: dsaltares/fetch-gh-release-asset@master + # with: + # repo: meshtastic/web + # file: build.tar + # target: build.tar + # token: ${{ inputs.github_token }} + # version: tags/v${{ steps.webver.outputs.ver }} - - name: Unpack web ui - if: inputs.include-web-ui == 'true' - shell: bash - run: | - tar -xf build.tar -C data/static - rm build.tar + # - name: Unpack web ui + # if: inputs.include-web-ui == 'true' + # shell: bash + # run: | + # tar -xf build.tar -C data/static + # rm build.tar - name: Remove debug flags for release shell: bash diff --git a/.github/workflows/build_esp32.yml b/.github/workflows/build_esp32.yml index 4fc31f22c..616f51746 100644 --- a/.github/workflows/build_esp32.yml +++ b/.github/workflows/build_esp32.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32 diff --git a/.github/workflows/build_esp32_c3.yml b/.github/workflows/build_esp32_c3.yml index 546762952..1b6b832e9 100644 --- a/.github/workflows/build_esp32_c3.yml +++ b/.github/workflows/build_esp32_c3.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32c3 diff --git a/.github/workflows/build_esp32_c6.yml b/.github/workflows/build_esp32_c6.yml index 56d4d806d..29dac51e1 100644 --- a/.github/workflows/build_esp32_c6.yml +++ b/.github/workflows/build_esp32_c6.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32c6 diff --git a/.github/workflows/build_esp32_s3.yml b/.github/workflows/build_esp32_s3.yml index a9c067ee1..7e0373503 100644 --- a/.github/workflows/build_esp32_s3.yml +++ b/.github/workflows/build_esp32_s3.yml @@ -33,5 +33,5 @@ jobs: artifact-paths: | release/*.bin release/*.elf - include-web-ui: true + #include-web-ui: true arch: esp32s3 diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 9b9877e04..03e61d572 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -257,7 +257,6 @@ jobs: ./device-*.sh ./device-*.bat ./littlefs-*.bin - ./littlefswebui-*.bin ./bleota*bin ./Meshtastic_nRF52_factory_erase*.uf2 retention-days: 30 diff --git a/bin/build-esp32.sh b/bin/build-esp32.sh index a0635e997..96578e914 100755 --- a/bin/build-esp32.sh +++ b/bin/build-esp32.sh @@ -34,11 +34,12 @@ SRCBIN=.pio/build/$1/firmware.bin cp $SRCBIN $OUTDIR/$basename-update.bin echo "Building Filesystem for ESP32 targets" -pio run --environment $1 -t buildfs -cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$1-$VERSION.bin -# Remove webserver files from the filesystem and rebuild -ls -l data/static # Diagnostic list of files -rm -rf data/static +# If you want to build the webui, uncomment the following lines +# pio run --environment $1 -t buildfs +# cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$1-$VERSION.bin +# # Remove webserver files from the filesystem and rebuild +# ls -l data/static # Diagnostic list of files +# rm -rf data/static pio run --environment $1 -t buildfs cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$1-$VERSION.bin cp bin/device-install.* $OUTDIR diff --git a/bin/device-install.bat b/bin/device-install.bat index 816d2fbba..12bfd4f6e 100755 --- a/bin/device-install.bat +++ b/bin/device-install.bat @@ -5,7 +5,6 @@ TITLE Meshtastic device-install SET "SCRIPT_NAME=%~nx0" SET "DEBUG=0" SET "PYTHON=" -SET "WEB_APP=0" SET "TFT_BUILD=0" SET "BIGDB8=0" SET "BIGDB16=0" @@ -25,7 +24,7 @@ GOTO getopts :help ECHO Flash image file to device, but first erasing and writing system information. ECHO. -ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] (--web) [--1200bps-reset] +ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] [--1200bps-reset] ECHO. ECHO Options: ECHO -f filename The firmware .bin file to flash. Custom to your device type and region. (required) @@ -35,13 +34,12 @@ ECHO If not set, ESPTOOL iterates all ports (Dangerous). ECHO -P python Specify alternate python interpreter to use to invoke esptool. (default: python) ECHO If supplied the script will use python. ECHO If not supplied the script will try to find esptool in Path. -ECHO --web Enable WebUI. (default: false) ECHO --1200bps-reset Attempt to place the device in correct mode. (1200bps Reset) ECHO Some hardware requires this twice. ECHO. ECHO Example: %SCRIPT_NAME% -p COM17 --1200bps-reset ECHO Example: %SCRIPT_NAME% -f firmware-t-deck-tft-2.6.0.0b106d4.bin -p COM11 -ECHO Example: %SCRIPT_NAME% -f firmware-unphone-2.6.0.0b106d4.bin -p COM11 --web +ECHO Example: %SCRIPT_NAME% -f firmware-unphone-2.6.0.0b106d4.bin -p COM11 GOTO eof :version @@ -61,7 +59,6 @@ IF /I "%~1"=="-f" SET "FILENAME=%~2" & SHIFT IF "%~1"=="-p" SET "ESPTOOL_PORT=%~2" & SHIFT IF /I "%~1"=="--port" SET "ESPTOOL_PORT=%~2" & SHIFT IF "%~1"=="-P" SET "PYTHON=%~2" & SHIFT -IF /I "%~1"=="--web" SET "WEB_APP=1" IF /I "%~1"=="--1200bps-reset" SET "BPS_RESET=1" SHIFT GOTO getopts @@ -153,9 +150,6 @@ IF %BPS_RESET% EQU 1 ( @REM https://github.com/meshtastic/web-flasher/blob/main/types/resources.ts#L3 IF NOT "!FILENAME:-tft-=!"=="!FILENAME!" ( CALL :LOG_MESSAGE DEBUG "We are working with a *-tft-* file. !FILENAME!" - IF %WEB_APP% EQU 1 ( - CALL :LOG_MESSAGE ERROR "Cannot enable WebUI (--web) and MUI." & GOTO eof - ) SET "TFT_BUILD=1" ) ELSE ( CALL :LOG_MESSAGE DEBUG "We are NOT working with a *-tft-* file. !FILENAME!" @@ -209,13 +203,8 @@ SET "OTA_FILENAME=bleota.bin" :end_loop_c3 CALL :LOG_MESSAGE DEBUG "Set OTA_FILENAME to: !OTA_FILENAME!" -@REM Check if (--web) is enabled and prefix BASENAME with "littlefswebui-" else "littlefs-". -IF %WEB_APP% EQU 1 ( - CALL :LOG_MESSAGE INFO "WebUI selected." - SET "SPIFFS_FILENAME=littlefswebui-%BASENAME%" -) ELSE ( - SET "SPIFFS_FILENAME=littlefs-%BASENAME%" -) +@REM Set SPIFFS filename with "littlefs-" prefix. +SET "SPIFFS_FILENAME=littlefs-%BASENAME%" CALL :LOG_MESSAGE DEBUG "Set SPIFFS_FILENAME to: !SPIFFS_FILENAME!" @REM Default offsets. diff --git a/bin/device-install.sh b/bin/device-install.sh index 613696d2f..42d0c4089 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -1,14 +1,18 @@ #!/bin/bash PYTHON=${PYTHON:-$(which python3 python | head -n 1)} -WEB_APP=false BPS_RESET=false TFT_BUILD=false MCU="" # Variant groups BIGDB_8MB=( - "picomputer-s3" + # Check if FILENAME contains "-tft-" and set target partitionScheme accordingly. +if [[ $FILENAME == *"-tft-"* ]]; then + TFT_BUILD=true +fi + +# Extract BASENAME from %FILENAME% for later use.r-s3" "unphone" "seeed-sensecap-indicator" "crowpanel-esp32s3" @@ -76,14 +80,13 @@ set -e # Usage info show_help() { cat <