Add MarkWTech extra buttons and dual-slot HTTP firmware OTA - #3
Open
keskad wants to merge 7 commits into
Open
Conversation
Wire left/Stop/right/Back/Menu on GPIO 11–14 and 16 with a debounced scanner, map them through MarkwtechSurface/NavProfile, and document the pinout so provisioning chord *+Stop works on hardware. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep GPIO 16 free for the serial console; GPIO 15 is strapping but idle-high with pull-up is safe if Menu is not held at reset. Co-authored-by: Cursor <cursoragent@cursor.com>
Add per-component connection tables, a master GPIO map, and clarify GPIO 15 strapping behavior on stock DevKitC-1 boards. Co-authored-by: Cursor <cursoragent@cursor.com>
GPIO 14 is not broken out on the ESP32-C6-WROOM-1 module, so the Back button had no header to connect to. Move it to GPIO 5 and Menu-right from USB_D+ (13) to GPIO 4, keeping the native USB pair intact apart from Stop on USB_D-. Document the ESP32-C6-DevKitC-1 J1/J3 header positions for every wire, and add the battery hardware the DevKit lacks compared to the LOLIN32 the original WiTcontroller uses: charger, 3.3 V regulator and the 47k/47k divider feeding the ADC on GPIO 1. Co-authored-by: Cursor <cursoragent@cursor.com>
Serve POST /api/v1/firmware from the pairing AP (with DHCP) and from the Extras firmware-update screen on STA, writing the inactive OTA slot. Co-authored-by: Cursor <cursoragent@cursor.com>
Point the first dual-slot install at update-firmware --mode usb as well as a raw espflash invocation. Co-authored-by: Cursor <cursoragent@cursor.com>
Add an English step-by-step build plus a Polish translation, log a suggested ADC factor for first-power calibration, and enable 4-minute inactivity sleep with a 5% low-battery cutoff. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this is one PR
MarkWTech hardware bring-up and dual-slot firmware OTA are the same initiative. Extra GPIO buttons, pin remaps, and the DevKit wiring guide exist so the throttle can be assembled and driven. HTTP OTA is how firmware is iterated while that hardware is being built (no USB cable on every change) and is also the intended production update path once the dual-slot table is on the chip.
Companion: wireless-programmer#2 (
update-firmware --mode ap|lan|usb).MarkWTech extra buttons and wiring
Five debounced GPIO tact switches: menu left, Stop, menu right, Back, Menu. Scanner in
extra_buttons, mapped throughMarkwtechSurface/MarkwtechNav(Back = Cancel; left/right page lists or move the cursor in text entry). Provisioning chord remains*+ Stop (8 s).Pins that actually exist on the ESP32-C6-WROOM-1 / DevKitC-1 headers (GPIO 14 is not broken out; GPIO 16 is UART0 TX):
USB_D−)Native USB is sacrificed only on
D−(Stop). Firmware is flashed on the UART Type-C. GPIO 4/5/15 are strapping pins but idle-high with pull-up does not change boot mode if those buttons are not held at reset.Hardware guide (
docs/hardware/markwtech.md): per-component tables, master GPIO map, J1/J3 positions, and the battery hardware the DevKit lacks vs the original LOLIN32 WiTcontroller (TP4056, S7V8F3 3.3 V, 47 kΩ/47 kΩ divider on GPIO 1).Dual-slot HTTP firmware OTA
First flash of the new table is USB (
espflash/wireless-programmer update-firmware --mode usbwith ELF +partitions.csv). After that, updates are HTTP:NVS stays at
0x9000. No factory partition. Slot size0x3C0000;NET_SOCKETS=6/PROG_NET_SOCKETS=4.Two HTTP paths, same
POST /api/v1/firmware(streamed, magic0xE9, chip id0x000D/ ESP32-C6). Body is.app.bin(espflash save-imagewithout--merge); merged dumps are rejected.192.168.0.50–200, HTTP at192.168.0.1. After OTA the throttle stays inprogramming_mode. heiko-wifred: AP chord only (no Extras menu)._longfred-ota._tcp. Leaving the screen disables it. STA HTTP is firmware + GET settings/page only (no PUT settings, noprogramming-mode/off). After OTA the throttle reboots onto layout Wi-Fi.Flash writes take a mutex. CI publishes
.app.binartifacts; size-check covers the new slot.Test plan
make build VARIANT=markwtechmake build VARIANT=longfred-standard*+ Stop for 8 s enters provisioningupdate-firmware --mode usbwith ELF +partitions.csvupdate-firmware --mode ap --file *.app.binscan --mode lan/update-firmware --mode lan --host <ipv4> --file *.app.bin