device-install/update: fix esptool --port (#6341)
Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / build-debian-src (push) Waiting to run
CI / package-pio-deps-native-tft (push) Waiting to run
CI / test-native (push) Waiting to run
CI / docker-debian-amd64 (push) Waiting to run
CI / docker-alpine-amd64 (push) Waiting to run
CI / docker-debian-arm64 (push) Waiting to run
CI / docker-debian-armv7 (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions

* fix errorlevel check

* add esptool --port if supplied

* match device-install

* add --port if supplied

* update logmessage

* bump version

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Kalle Lilja 2025-03-18 02:16:16 +01:00 committed by GitHub
parent 2876eec7ed
commit 8efc9702d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 11 deletions

View File

@ -34,7 +34,7 @@ ECHO Example: %SCRIPT_NAME% -f firmware-unphone-2.6.0.0b106d4.bin -p COM11 --web
GOTO eof GOTO eof
:version :version
ECHO %SCRIPT_NAME% [Version 2.6.0] ECHO %SCRIPT_NAME% [Version 2.6.1]
ECHO Meshtastic ECHO Meshtastic
GOTO eof GOTO eof
@ -106,7 +106,7 @@ IF NOT "__%PYTHON%__"=="____" (
CALL :LOG_MESSAGE DEBUG "Checking esptool command !ESPTOOL_CMD!..." CALL :LOG_MESSAGE DEBUG "Checking esptool command !ESPTOOL_CMD!..."
!ESPTOOL_CMD! >nul 2>&1 !ESPTOOL_CMD! >nul 2>&1
IF %ERRORLEVEL% GTR 2 ( IF %ERRORLEVEL% GEQ 2 (
@REM esptool exits with code 1 if help is displayed. @REM esptool exits with code 1 if help is displayed.
CALL :LOG_MESSAGE ERROR "esptool not found: !ESPTOOL_CMD!" CALL :LOG_MESSAGE ERROR "esptool not found: !ESPTOOL_CMD!"
EXIT /B 1 EXIT /B 1
@ -121,6 +121,7 @@ CALL :LOG_MESSAGE DEBUG "Using esptool command: !ESPTOOL_CMD!"
IF "__!ESPTOOL_PORT!__" == "____" ( IF "__!ESPTOOL_PORT!__" == "____" (
CALL :LOG_MESSAGE WARN "Using esptool port: UNSET." CALL :LOG_MESSAGE WARN "Using esptool port: UNSET."
) ELSE ( ) ELSE (
SET "ESPTOOL_CMD=!ESPTOOL_CMD! --port !ESPTOOL_PORT!"
CALL :LOG_MESSAGE INFO "Using esptool port: !ESPTOOL_PORT!." CALL :LOG_MESSAGE INFO "Using esptool port: !ESPTOOL_PORT!."
) )
CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!." CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!."

View File

@ -42,8 +42,8 @@ while [ $# -gt 0 ]; do
exit 0 exit 0
;; ;;
-p) -p)
ESPTOOL_PORT="$2" ESPTOOL_CMD="$ESPTOOL_CMD --port $2"
shift # Shift past the option argument shift
;; ;;
-P) -P)
PYTHON="$2" PYTHON="$2"

View File

@ -16,7 +16,7 @@ ECHO.
ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python] ECHO Usage: %SCRIPT_NAME% -f filename [-p PORT] [-P python]
ECHO. ECHO.
ECHO Options: ECHO Options:
ECHO -f filename The .bin file to flash. Custom to your device type and region. (required) ECHO -f filename The update .bin file to flash. Custom to your device type and region. (required)
ECHO The file must be located in this current directory. ECHO The file must be located in this current directory.
ECHO -p PORT Set the environment variable for ESPTOOL_PORT. ECHO -p PORT Set the environment variable for ESPTOOL_PORT.
ECHO If not set, ESPTOOL iterates all ports (Dangerous). ECHO If not set, ESPTOOL iterates all ports (Dangerous).
@ -28,7 +28,7 @@ ECHO Example: %SCRIPT_NAME% -f firmware-t-deck-tft-2.6.0.0b106d4-update.bin -p C
GOTO eof GOTO eof
:version :version
ECHO %SCRIPT_NAME% [Version 2.6.0] ECHO %SCRIPT_NAME% [Version 2.6.1]
ECHO Meshtastic ECHO Meshtastic
GOTO eof GOTO eof
@ -53,6 +53,7 @@ IF "__!FILENAME!__"=="____" (
CALL :LOG_MESSAGE DEBUG "Missing -f filename input." CALL :LOG_MESSAGE DEBUG "Missing -f filename input."
GOTO help GOTO help
) ELSE ( ) ELSE (
CALL :LOG_MESSAGE DEBUG "Filename: !FILENAME!"
IF NOT "__!FILENAME: =!__"=="__!FILENAME!__" ( IF NOT "__!FILENAME: =!__"=="__!FILENAME!__" (
CALL :LOG_MESSAGE ERROR "Filename containing spaces are not supported." CALL :LOG_MESSAGE ERROR "Filename containing spaces are not supported."
GOTO help GOTO help
@ -62,7 +63,6 @@ IF "__!FILENAME!__"=="____" (
SET "FILENAME=!FILENAME:./=!" SET "FILENAME=!FILENAME:./=!"
) )
CALL :LOG_MESSAGE DEBUG "Filename: !FILENAME!"
CALL :LOG_MESSAGE DEBUG "Checking if !FILENAME! exists..." CALL :LOG_MESSAGE DEBUG "Checking if !FILENAME! exists..."
IF NOT EXIST !FILENAME! ( IF NOT EXIST !FILENAME! (
CALL :LOG_MESSAGE ERROR "File does not exist: !FILENAME!. Terminating." CALL :LOG_MESSAGE ERROR "File does not exist: !FILENAME!. Terminating."
@ -71,7 +71,7 @@ IF NOT EXIST !FILENAME! (
IF "!FILENAME:update=!"=="!FILENAME!" ( IF "!FILENAME:update=!"=="!FILENAME!" (
CALL :LOG_MESSAGE DEBUG "We are NOT working with a *update* file. !FILENAME!" CALL :LOG_MESSAGE DEBUG "We are NOT working with a *update* file. !FILENAME!"
CALL :LOG_MESSAGE INFO "Use script device-install.bat to flash update !FILENAME!." CALL :LOG_MESSAGE INFO "Use script device-install.bat to flash !FILENAME!."
GOTO eof GOTO eof
) ELSE ( ) ELSE (
CALL :LOG_MESSAGE DEBUG "We are working with a *update* file. !FILENAME!" CALL :LOG_MESSAGE DEBUG "We are working with a *update* file. !FILENAME!"
@ -95,7 +95,7 @@ IF NOT "__%PYTHON%__"=="____" (
CALL :LOG_MESSAGE DEBUG "Checking esptool command !ESPTOOL_CMD!..." CALL :LOG_MESSAGE DEBUG "Checking esptool command !ESPTOOL_CMD!..."
!ESPTOOL_CMD! >nul 2>&1 !ESPTOOL_CMD! >nul 2>&1
IF %ERRORLEVEL% GTR 2 ( IF %ERRORLEVEL% GEQ 2 (
@REM esptool exits with code 1 if help is displayed. @REM esptool exits with code 1 if help is displayed.
CALL :LOG_MESSAGE ERROR "esptool not found: !ESPTOOL_CMD!" CALL :LOG_MESSAGE ERROR "esptool not found: !ESPTOOL_CMD!"
EXIT /B 1 EXIT /B 1
@ -110,6 +110,7 @@ CALL :LOG_MESSAGE DEBUG "Using esptool command: !ESPTOOL_CMD!"
IF "__!ESPTOOL_PORT!__" == "____" ( IF "__!ESPTOOL_PORT!__" == "____" (
CALL :LOG_MESSAGE WARN "Using esptool port: UNSET." CALL :LOG_MESSAGE WARN "Using esptool port: UNSET."
) ELSE ( ) ELSE (
SET "ESPTOOL_CMD=!ESPTOOL_CMD! --port !ESPTOOL_PORT!"
CALL :LOG_MESSAGE INFO "Using esptool port: !ESPTOOL_PORT!." CALL :LOG_MESSAGE INFO "Using esptool port: !ESPTOOL_PORT!."
) )
CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!." CALL :LOG_MESSAGE INFO "Using esptool baud: !ESPTOOL_BAUD!."

View File

@ -35,7 +35,7 @@ while getopts ":hp:P:f:" opt; do
show_help show_help
exit 0 exit 0
;; ;;
p) export ESPTOOL_PORT=${OPTARG} p) ESPTOOL_CMD="$ESPTOOL_CMD --port ${OPTARG}"
;; ;;
P) PYTHON=${OPTARG} P) PYTHON=${OPTARG}
;; ;;