Remove bundling of web-ui from ESP32 devices (#7143)

This commit is contained in:
Ben Meadors 2025-06-26 10:57:33 -05:00 committed by GitHub
parent ad23c065f6
commit 2ab717cebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 50 additions and 69 deletions

View File

@ -27,10 +27,10 @@ inputs:
description: A newline separated list of paths to store as artifacts description: A newline separated list of paths to store as artifacts
required: false required: false
default: "" default: ""
include-web-ui: # include-web-ui:
description: Include the web UI in the build # description: Include the web UI in the build
required: false # required: false
default: "false" # default: "false"
arch: arch:
description: Processor arch name description: Processor arch name
required: true required: true
@ -43,29 +43,29 @@ runs:
id: base id: base
uses: ./.github/actions/setup-base uses: ./.github/actions/setup-base
- name: Get web ui version # - name: Get web ui version
if: inputs.include-web-ui == 'true' # if: inputs.include-web-ui == 'true'
id: webver # id: webver
shell: bash # shell: bash
run: | # run: |
echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT # echo "ver=$(cat bin/web.version)" >> $GITHUB_OUTPUT
- name: Pull web ui # - name: Pull web ui
if: inputs.include-web-ui == 'true' # if: inputs.include-web-ui == 'true'
uses: dsaltares/fetch-gh-release-asset@master # uses: dsaltares/fetch-gh-release-asset@master
with: # with:
repo: meshtastic/web # repo: meshtastic/web
file: build.tar # file: build.tar
target: build.tar # target: build.tar
token: ${{ inputs.github_token }} # token: ${{ inputs.github_token }}
version: tags/v${{ steps.webver.outputs.ver }} # version: tags/v${{ steps.webver.outputs.ver }}
- name: Unpack web ui # - name: Unpack web ui
if: inputs.include-web-ui == 'true' # if: inputs.include-web-ui == 'true'
shell: bash # shell: bash
run: | # run: |
tar -xf build.tar -C data/static # tar -xf build.tar -C data/static
rm build.tar # rm build.tar
- name: Remove debug flags for release - name: Remove debug flags for release
shell: bash shell: bash

View File

@ -33,5 +33,5 @@ jobs:
artifact-paths: | artifact-paths: |
release/*.bin release/*.bin
release/*.elf release/*.elf
include-web-ui: true #include-web-ui: true
arch: esp32 arch: esp32

View File

@ -33,5 +33,5 @@ jobs:
artifact-paths: | artifact-paths: |
release/*.bin release/*.bin
release/*.elf release/*.elf
include-web-ui: true #include-web-ui: true
arch: esp32c3 arch: esp32c3

View File

@ -33,5 +33,5 @@ jobs:
artifact-paths: | artifact-paths: |
release/*.bin release/*.bin
release/*.elf release/*.elf
include-web-ui: true #include-web-ui: true
arch: esp32c6 arch: esp32c6

View File

@ -33,5 +33,5 @@ jobs:
artifact-paths: | artifact-paths: |
release/*.bin release/*.bin
release/*.elf release/*.elf
include-web-ui: true #include-web-ui: true
arch: esp32s3 arch: esp32s3

View File

@ -257,7 +257,6 @@ jobs:
./device-*.sh ./device-*.sh
./device-*.bat ./device-*.bat
./littlefs-*.bin ./littlefs-*.bin
./littlefswebui-*.bin
./bleota*bin ./bleota*bin
./Meshtastic_nRF52_factory_erase*.uf2 ./Meshtastic_nRF52_factory_erase*.uf2
retention-days: 30 retention-days: 30

View File

@ -34,11 +34,12 @@ SRCBIN=.pio/build/$1/firmware.bin
cp $SRCBIN $OUTDIR/$basename-update.bin cp $SRCBIN $OUTDIR/$basename-update.bin
echo "Building Filesystem for ESP32 targets" echo "Building Filesystem for ESP32 targets"
pio run --environment $1 -t buildfs # If you want to build the webui, uncomment the following lines
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$1-$VERSION.bin # pio run --environment $1 -t buildfs
# Remove webserver files from the filesystem and rebuild # cp .pio/build/$1/littlefs.bin $OUTDIR/littlefswebui-$1-$VERSION.bin
ls -l data/static # Diagnostic list of files # # Remove webserver files from the filesystem and rebuild
rm -rf data/static # ls -l data/static # Diagnostic list of files
# rm -rf data/static
pio run --environment $1 -t buildfs pio run --environment $1 -t buildfs
cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$1-$VERSION.bin cp .pio/build/$1/littlefs.bin $OUTDIR/littlefs-$1-$VERSION.bin
cp bin/device-install.* $OUTDIR cp bin/device-install.* $OUTDIR

View File

@ -5,7 +5,6 @@ TITLE Meshtastic device-install
SET "SCRIPT_NAME=%~nx0" SET "SCRIPT_NAME=%~nx0"
SET "DEBUG=0" SET "DEBUG=0"
SET "PYTHON=" SET "PYTHON="
SET "WEB_APP=0"
SET "TFT_BUILD=0" SET "TFT_BUILD=0"
SET "BIGDB8=0" SET "BIGDB8=0"
SET "BIGDB16=0" SET "BIGDB16=0"
@ -25,7 +24,7 @@ GOTO getopts
:help :help
ECHO Flash image file to device, but first erasing and writing system information. ECHO Flash image file to device, but first erasing and writing system information.
ECHO. 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.
ECHO Options: ECHO Options:
ECHO -f filename The firmware .bin file to flash. Custom to your device type and region. (required) 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 -P python Specify alternate python interpreter to use to invoke esptool. (default: python)
ECHO If supplied the script will use python. ECHO If supplied the script will use python.
ECHO If not supplied the script will try to find esptool in Path. 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 --1200bps-reset Attempt to place the device in correct mode. (1200bps Reset)
ECHO Some hardware requires this twice. ECHO Some hardware requires this twice.
ECHO. ECHO.
ECHO Example: %SCRIPT_NAME% -p COM17 --1200bps-reset 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-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 GOTO eof
:version :version
@ -61,7 +59,6 @@ IF /I "%~1"=="-f" SET "FILENAME=%~2" & SHIFT
IF "%~1"=="-p" SET "ESPTOOL_PORT=%~2" & SHIFT IF "%~1"=="-p" SET "ESPTOOL_PORT=%~2" & SHIFT
IF /I "%~1"=="--port" SET "ESPTOOL_PORT=%~2" & SHIFT IF /I "%~1"=="--port" SET "ESPTOOL_PORT=%~2" & SHIFT
IF "%~1"=="-P" SET "PYTHON=%~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" IF /I "%~1"=="--1200bps-reset" SET "BPS_RESET=1"
SHIFT SHIFT
GOTO getopts GOTO getopts
@ -153,9 +150,6 @@ IF %BPS_RESET% EQU 1 (
@REM https://github.com/meshtastic/web-flasher/blob/main/types/resources.ts#L3 @REM https://github.com/meshtastic/web-flasher/blob/main/types/resources.ts#L3
IF NOT "!FILENAME:-tft-=!"=="!FILENAME!" ( IF NOT "!FILENAME:-tft-=!"=="!FILENAME!" (
CALL :LOG_MESSAGE DEBUG "We are working with a *-tft-* file. !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" SET "TFT_BUILD=1"
) ELSE ( ) ELSE (
CALL :LOG_MESSAGE DEBUG "We are NOT working with a *-tft-* file. !FILENAME!" 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 :end_loop_c3
CALL :LOG_MESSAGE DEBUG "Set OTA_FILENAME to: !OTA_FILENAME!" CALL :LOG_MESSAGE DEBUG "Set OTA_FILENAME to: !OTA_FILENAME!"
@REM Check if (--web) is enabled and prefix BASENAME with "littlefswebui-" else "littlefs-". @REM Set SPIFFS filename with "littlefs-" prefix.
IF %WEB_APP% EQU 1 ( SET "SPIFFS_FILENAME=littlefs-%BASENAME%"
CALL :LOG_MESSAGE INFO "WebUI selected."
SET "SPIFFS_FILENAME=littlefswebui-%BASENAME%"
) ELSE (
SET "SPIFFS_FILENAME=littlefs-%BASENAME%"
)
CALL :LOG_MESSAGE DEBUG "Set SPIFFS_FILENAME to: !SPIFFS_FILENAME!" CALL :LOG_MESSAGE DEBUG "Set SPIFFS_FILENAME to: !SPIFFS_FILENAME!"
@REM Default offsets. @REM Default offsets.

View File

@ -1,14 +1,18 @@
#!/bin/bash #!/bin/bash
PYTHON=${PYTHON:-$(which python3 python | head -n 1)} PYTHON=${PYTHON:-$(which python3 python | head -n 1)}
WEB_APP=false
BPS_RESET=false BPS_RESET=false
TFT_BUILD=false TFT_BUILD=false
MCU="" MCU=""
# Variant groups # Variant groups
BIGDB_8MB=( 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" "unphone"
"seeed-sensecap-indicator" "seeed-sensecap-indicator"
"crowpanel-esp32s3" "crowpanel-esp32s3"
@ -76,14 +80,13 @@ set -e
# Usage info # Usage info
show_help() { show_help() {
cat <<EOF cat <<EOF
Usage: $(basename "$0") [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME] [--web] [--1200bps-reset] Usage: $(basename "$0") [-h] [-p ESPTOOL_PORT] [-P PYTHON] [-f FILENAME] [--1200bps-reset]
Flash image file to device, but first erasing and writing system information. Flash image file to device, but first erasing and writing system information.
-h Display this help and exit. -h Display this help and exit.
-p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous). -p ESPTOOL_PORT Set the environment variable for ESPTOOL_PORT. If not set, ESPTOOL iterates all ports (Dangerous).
-P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON") -P PYTHON Specify alternate python interpreter to use to invoke esptool. (Default: "$PYTHON")
-f FILENAME The firmware .bin file to flash. Custom to your device type and region. -f FILENAME The firmware .bin file to flash. Custom to your device type and region.
--web Enable WebUI. (Default: false)
--1200bps-reset Attempt to place the device in correct mode. Some hardware requires this twice. (1200bps Reset) --1200bps-reset Attempt to place the device in correct mode. Some hardware requires this twice. (1200bps Reset)
EOF EOF
@ -107,9 +110,6 @@ while [ $# -gt 0 ]; do
FILENAME="$2" FILENAME="$2"
shift shift
;; ;;
--web)
WEB_APP=true
;;
--1200bps-reset) --1200bps-reset)
BPS_RESET=true BPS_RESET=true
;; ;;
@ -140,20 +140,16 @@ if [[ "$FILENAME" != firmware-* ]]; then
exit 1 exit 1
fi fi
# Check if FILENAME contains "-tft-" and prevent web/mui comingling. # Check if FILENAME contains "-tft-" and set target partitionScheme accordingly.
if [[ "${FILENAME//-tft-/}" != "$FILENAME" ]]; then if [[ "${FILENAME//-tft-/}" != "$FILENAME" ]]; then
TFT_BUILD=true TFT_BUILD=true
if [[ $WEB_APP == true ]] && [[ $TFT_BUILD == true ]]; then
echo "Cannot enable WebUI (--web) and MUI."
exit 1
fi
fi fi
# Extract BASENAME from %FILENAME% for later use. # Extract BASENAME from %FILENAME% for later use.
BASENAME="${FILENAME/firmware-/}" BASENAME="${FILENAME/firmware-/}"
if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
# Default littlefs* offset (--web). # Default littlefs* offset.
OFFSET=0x300000 OFFSET=0x300000
# Default OTA Offset # Default OTA Offset
@ -193,12 +189,8 @@ if [ -f "${FILENAME}" ] && [ -n "${FILENAME##*"update"*}" ]; then
OTAFILE=bleota-s3.bin OTAFILE=bleota-s3.bin
fi fi
# Check if WEB_APP (--web) is enabled and add "littlefswebui-" to BASENAME else "littlefs-". # Set SPIFFS filename with "littlefs-" prefix.
if [ "$WEB_APP" = true ]; then SPIFFSFILE=littlefs-${BASENAME}
SPIFFSFILE=littlefswebui-${BASENAME}
else
SPIFFSFILE=littlefs-${BASENAME}
fi
if [[ ! -f "$FILENAME" ]]; then if [[ ! -f "$FILENAME" ]]; then
echo "Error: file ${FILENAME} wasn't found. Terminating." echo "Error: file ${FILENAME} wasn't found. Terminating."