Skip to content

Add LongFred firmware update over Soft-AP, LAN, and USB - #2

Open
keskad wants to merge 3 commits into
feat/runtime-and-fake-modefrom
feat/longfred-firmware-ota
Open

Add LongFred firmware update over Soft-AP, LAN, and USB#2
keskad wants to merge 3 commits into
feat/runtime-and-fake-modefrom
feat/longfred-firmware-ota

Conversation

@keskad

@keskad keskad commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add updateFirmware / wireless-programmer update-firmware --mode ap|lan|usb to upload LongFred firmware.
  • Soft-AP and LAN POST .app.bin to /api/v1/firmware (120 s, no retries). LAN discovery via mDNS _longfred-ota._tcp (scan --mode lan) or --host.
  • USB runs espflash on a serial port (ELF, merged .bin, or .app.bin); scan --mode usb lists ports.
  • Firmware jobs emit a job.watch heartbeat every 3 s so a 10 s idle client does not drop the stream. job cancel kills espflash and aborts an in-flight POST. CLI default watch idle is 180 s (USB) / 120 s (HTTP) when --timeout is omitted.
  • Advertise supportsFirmwareUpdate (LongFred true, WiFred false). Stacked on feat/runtime-and-fake-mode (Wire the programming runtime and add fake Soft-AP mode #3).

Test plan

  • cargo test --workspace and cargo clippy --workspace --all-targets -- -D warnings
  • wireless-programmer hello shows supportsFirmwareUpdate on longfred
  • Fake LongFred: POST /api/v1/firmware with a non-empty body returns 200
  • Soft-AP: update-firmware --mode ap --driver longfred --key <bssid> --file *.app.bin after the 8 s chord
  • LAN: Extras → Firmware update on the throttle, then scan --mode lan and update-firmware --mode lan --host <ipv4> --file *.app.bin
  • USB: update-firmware --mode usb --port /dev/ttyUSB0 --file <elf> --partition-table partitions.csv streams progress past 10 s
  • program is unchanged (Soft-AP settings only)

keskad and others added 3 commits August 15, 2026 08:36
Queue POST /api/v1/firmware as an updateFirmware job, discover STA hosts via
mDNS, and keep settings programming on Soft-AP only.

Co-authored-by: Cursor <cursoragent@cursor.com>
Scan serial ports and flash ELF, merged .bin, or .app.bin with --mode usb
so the first dual-slot install does not require a manual espflash invocation.

Co-authored-by: Cursor <cursoragent@cursor.com>
espflash and the firmware POST block without progress frames, so the 10s
client idle dropped the watch. Heartbeat every 3s, honour job cancel, and
default update-firmware watch idle to the flash/POST deadline.

Co-authored-by: Cursor <cursoragent@cursor.com>
@keskad keskad changed the title Add LongFred HTTP firmware update (Soft-AP and LAN) Add LongFred firmware update over Soft-AP, LAN, and USB Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant