Commit Graph
15 Commits
Author SHA1 Message Date
Thomas Göttgens ad1dd14b6c fix(bin): repair the Windows device-install and device-update scripts (#11388)
* fix(bin): correct filename check and esptool v5 subcommands in .bat installers

device-install.bat rejected every valid firmware-*.factory.bin name. The
substring-strip comparison was negated, so it errored when the suffix was
present instead of when it was absent.

Both scripts hardcoded esptool subcommand spellings. device-install.bat used
the v4 underscore forms only. device-update.bat used the v5 write-flash with
the v4 read_flash_status, so it worked fully on neither version. Probe the
help output once and select the spelling, mirroring bin/device-install.sh.

The probe uses %ESPTOOL_CMD% rather than !ESPTOOL_CMD! because cmd does not
split a delayed-expanded command token carrying a path into program and
arguments.

Fixes #8156

* fix(bin): make the -P interpreter option work in the .bat installers

Both scripts invoked ESPTOOL_CMD through delayed expansion. cmd does not split
a delayed-expanded command token that carries a path into program and
arguments, so "-P C:\path\python.exe" exited 9009 and the scripts reported
"esptool not found". Use %ESPTOOL_CMD% at the two command positions per file.

device-update.bat additionally wrapped the interpreter in doubled quotes, which
made python treat python.exe as a source file. Quote the path once, as
device-install.bat does, so interpreter paths containing spaces also work.

* fix(bin): anchor the .factory.bin suffix check and harden esptool detection

The filename check matched .factory.bin anywhere in the name, so
firmware-x.factory.bin.bak passed and the script then derived
firmware-x.bak.mt.json for metadata. Compare the last 12 characters instead,
matching the anchored glob in bin/device-install.sh.

A quoted interpreter path that does not exist returns 3 rather than 9009, so
the missing-esptool check skipped it and the script died at the probe with no
message. Treat 3 as missing as well.

device-update.bat read %ERRORLEVEL% after a CALL that overwrote it, so the
missing-esptool check never fired. Capture the exit code before logging it.
2026-08-10 15:48:41 +00:00
Austin 66ff1536f3 Meshtastic build manifest (#8248) 2025-12-08 17:21:23 -06:00
Jeremiah K f26e657577 Fix esptool detection and baud rate issues in Windows batch scripts (#7856)
- Fix esptool detection to use 'version' subcommand instead of no arguments
- Fix device-update.bat to use 115200 bps for flashing, 1200 bps only for reset
- Add missing closing quotes in debug messages

Replace magic numbers with named constants for better maintainability

- Add RESET_BAUD=1200 constant for reset baud rate
- Add UPDATE_OFFSET=0x10000 constant for update flash offset
- Use constants instead of hardcoded values throughout script

Extract magic numbers to constants in shell scripts for consistency

- Add FLASH_BAUD, RESET_BAUD, UPDATE_OFFSET constants to device-update.sh
- Add RESET_BAUD, FIRMWARE_OFFSET constants to device-install.sh
- Replace hardcoded values with named constants throughout
- Maintain consistency with batch script improvements

Fix Python path quoting and remove unreachable code

- Quote Python interpreter paths to handle spaces in paths like 'C:\Program Files\Python\python.exe'
- Remove unreachable GOTO statements after EXIT /B commands
- Improve robustness when custom Python interpreters are specified

Fix esptool detection for pipx installations

- Change from checking ERRORLEVEL GEQ 2 to EQU 9009
- Pipx-installed esptool returns exit code 2 when showing help (normal)
- Only treat Windows 'command not found' error (9009) as truly not found
- Add debug output to show actual exit codes for troubleshooting
2025-09-06 06:20:57 -05:00
Manuel 8aae4f1b9d Update device-install scripts for T-LoRa Pager (#7833)
* add tlora-pager to device install scripts + fixes

* replace deprecated commands (write_flash)
2025-09-03 06:22:57 -05:00
Kalle LiljaandBen Meadors 4d81280ac2 Add --1200bps-reset param to device-install/update scripts (#6752)
* add change-mode support

* add change-mode support

* tab to space

* fix if check

* change param name to 1200bps-reset

* update help section

* missed one in help seciton

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2025-06-02 20:35:26 -05:00
Kalle LiljaandBen Meadors 8efc9702d3 device-install/update: fix esptool --port (#6341)
* 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>
2025-03-17 20:16:16 -05:00
Kalle Lilja f7afa9a81e [Task]: 2.6 device-install scripts (#6248)
* update device-install.bat

* add device-install unittest

* update device-update.bat

* update uf2-convert.bat

* update regen-protos.bat

* update rem

* bump version

* update device-install.sh

* add esptool

* move esptool to setup.sh

* trunk check+fmt

* update uf2-convert.bat
2025-03-06 16:58:08 -06:00
Jeremiah K bd3755bb33 Fix device flashing scripts so they work with esptool when it's installed via pipx (#5269)
* Try esptool.py in device flashing scripts for pipx compatibility

* esptool detection fixes in device flashing .bat's
2024-11-07 09:43:34 +08:00
Thomas Göttgens 082aa07e7f update batch scripts to further check filename. 2022-11-26 17:00:33 +01:00
Thomas Göttgens 29fb283daf adaptig for #1938 2022-11-24 12:30:15 +01:00
Thomas Göttgens e98c11ff89 The new combined firmware starts flashing at offset 0, no need to flash system-info or partitions any more. 2022-10-01 09:46:56 +02:00
Ben Meadors b54073a8a1 Bluetooth mode unification and behavior tweaks (#1636)
* Esp32 bluetooth modes

* Comment

* Gutting bluetooth

* Cleanup

* Security

* Testing

* NRF bluetooth security

* Reboot on saved lora or bluetooth settings

* Cleanup

* Fixes

* Stub for platforms without screens

* Fixed just-works in esp32

* Cleanup

* Display device name in boot screen

* Added waypoint module routing

* chmod

* Words

* Protos

* Backing out partition changes for testing

* Revert "Backing out partition changes for testing"

This reverts commit 191ed6489c.

* Chmod PR artifacts

* Trying setInitialState again

* Revert "Trying setInitialState again"

This reverts commit 703eac7277.

* External notification module

* Cleanup

* Pin display formatting
2022-08-22 16:41:23 -05:00
Ben Meadors bbd7c5063d Removed ota erasure 2022-08-19 13:34:41 -05:00
Ben MeadorsandThomas Göttgens a1dc350231 Changed default baud to 115200 (#1517)
Co-authored-by: Thomas Göttgens <tgoettgens@gmail.com>
2022-06-15 11:44:37 -05:00
michelepagot b16004dcdf .bat porting of install and update scripts 2021-05-23 01:46:31 +02:00