Repository navigation
Releases
Releases · Hamspiced/piglet
v3.11
v3.11 (2026-11-18)
Bug Fixes
- v3.10's gzip SD-recovery retry could still silently give up after a single successful recovery --
sdTryRecover()is rate-limited to one real recovery attempt per 4 seconds; calling it again sooner silently returnedfalsewith no log output, indistinguishable from "recovery ran and failed." In the field, a per-file-open recovery inside a merge would succeed, but the outer retry's own call tosdTryRecover()moments later landed inside that same 4-second window and was silently rate-limited -- so the gatedif (attempt < 2 && sdTryRecover()) continue;retry logic never fired a second attempt, even though the card was already healthy.sdTryRecover()now logs when a call is skipped for being rate-limited, and the gzip retry paths inGzipDeflate.cpp(and TDongle's inline copy) always retry once regardless of that return value, since a rate-limited skip doesn't mean the card is actually broken. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware. - Files already uploaded to WDGoWars kept retrying forever -- WDGoWars' real duplicate-upload signal is HTTP
409with"error":"duplicate_upload"in the body (meaning this exact file, byte-for-byte, was already uploaded), butuploadFileToWdgwars()only ever treated HTTP202as success; a409fell through to the generic failure path. SincemarkServiceDone()is only called on success, the file's WDGoWars ledger entry was never marked done, so it was resubmitted -- and rejected as a duplicate again -- on every subsequent boot indefinitely. A409with theduplicate_uploaderror is now treated as a successful/already-synced outcome. (This is a different signal shape than Wardrift's duplicate marker, which is HTTP200with"duplicate":true-- not confused with it.) Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Technical Changes
- Boot-time "Update available" prompt countdown shortened from 20 seconds to 10 seconds -- confirmed the countdown itself never runs scanning, uploads, or the web server (all begin strictly after it elapses or the device reboots into download mode on a button press), so this only shortens how long boot pauses waiting for a press. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.11 - T-Dongle C5:
v3.11 - PigletNode:
v3.03
Full Changelog: v3.10...v3.11
v3.10
v3.10 (2026-11-18)
Bug Fixes
- WiGLE's merged-archive upload and some WDGoWars files could still fail silently after v3.09's SD-recovery fix --
sdTryRecover()does a full SD unmount/remount, which invalidates every other already-open file handle on the card, not just the one being retried.gzipCompressMergedFilesToFile()opens its output file once, up front, before iterating source files; if a recovery fired mid-merge to fix one source file's open failure, that already-open output handle was left stale by the remount underneath it, so every subsequent write to it failed -- the merge kept failing even when the per-file recovery it logged had reported success. The same silent-write-failure mode could also skip a WDGWars file with no log line at all right after a prior recovery, since a write failure inside the gzip compressor was never logged to begin with. Since WiGLE never succeeded, no file could ever satisfy "every configured service done," so batches kept reporting 0 files moved even when WDGoWars/Wardrift uploads were individually succeeding.gzipCompressFileToFile()andgzipCompressMergedFilesToFile()now retry the entire compression (fresh output file included) once viasdTryRecover()if it fails for any reason, and every failure path now logs instead of failing silently. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.10 - T-Dongle C5:
v3.10 - PigletNode:
v3.03
Full Changelog: v3.09...v3.10
v3.09
v3.09 (2026-11-18)
Bug Fixes
- A single SD-bus hiccup mid-batch could fail every remaining file in a large upload batch -- after sustained heavy SD I/O (e.g. a batch of 15+ pending CSVs), the SD/SPI bus can transiently wedge, a known condition already self-healed elsewhere via a full unmount/remount (
sdTryRecover()): every raw upload function (WiGLE/WDGoWars/Wardrift) already retries through it. The gzip-compression helpers (gzipCompressFileToFile(), used for WDGoWars;gzipCompressMergedFilesToFile(), used for WiGLE's merged archive) and the upload-status ledger writer never did, so whenever gzip uploads were enabled (the default), one wedged-bus moment could silently fail the WiGLE archive and every subsequent WDGoWars file for the rest of that boot's batch, and could also lose a just-succeeded upload's ledger entry (causing a needless re-upload next boot). All three now retry once via the same SD recovery path as the rest of the upload pipeline. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Technical Changes
- Repository cleanup -- removed ~150MB of compiled build artifacts (
.elf/.map/.bin/etc.) that had been accidentally committed across all three sketches'build/output directories;build/is now gitignored so this can't recur. Removed a leftover debug block fromwigleTestToken()that dumped WiFi/DNS internals on every check. Refreshed several stale comments (the top-of-file header inPiglet.ino, which still described a single-board WiGLE-only version of the firmware; the battery-test feature's "uncomment to enable" comments, which haven't reflected reality since it became runtime-gated via thebatteryTestconfig key). No functional changes from this section.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.09 - T-Dongle C5:
v3.09 - PigletNode:
v3.03
Full Changelog: v3.08...v3.09
v3.08
v3.08 (2026-11-16)
Technical Changes
- Removed the WDGoWars background job-tracking system entirely -- following up v3.07's fix (which stopped polling the dead
/api/v2/upload-job/<id>status endpoint but still kept jobs queued for up to 5 minutes before silently dropping them unconfirmed), there was no remaining reason to track submitted jobs at all: WDGoWars has no working API to check an import's outcome after the fact. A successful upload (HTTP 202) is now simply reported as accepted immediately, with itsjob_idlogged for manual reference; nothing is queued or checked in the background anymore. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.08 - T-Dongle C5:
v3.08 - PigletNode:
v3.03
Full Changelog: v3.07...v3.08
v3.07
v3.07 (2026-11-15)
Bug Fixes
- WiGLE "Test Token" could fail constantly even with a valid token -- the check tried 3 candidate endpoint paths in sequence, but 2 of them (
/api/v2/profile,/api/v2/user/profile) don't exist on WiGLE's API and always 404 regardless of token validity, confirmed live againstapi.wigle.net. Every check wasted a full extra TLS handshake (sometimes two) on these guaranteed-dead endpoints before ever reaching the one real path -- on this chip's narrowMALLOC_CAP_DMAheap pool, each additional back-to-back TLS session meaningfully raised the odds the whole check would fail with a memory/connect error before a real pass/fail answer was ever reached. Now hits WiGLE's documented/api/v2/profile/userendpoint directly -- one TLS session instead of up to three. A TLS connect failure also no longer falsely reports the token as "Invalid"; it's now reported as "Unknown," since a dropped connection isn't evidence the token itself is bad. - WDGoWars upload-status polling connected to a dead endpoint on every pending job, every few seconds, for up to 5 minutes -- the background job-status check polled
GET /api/v2/upload-job/<id>with the device's API key, but that path doesn't accept API-key auth at all: confirmed live, it unconditionally redirects to a login page regardless of the header, since it's a web-session-only route rather than a machine API endpoint. Every poll was therefore a guaranteed-dead TLS connection that could never resolve a real result, adding unnecessary TLS/memory pressure on top of the self-update and upload paths already competing for the same narrow heap pool. The upload itself was never affected by this (success/failure is already known from the initial upload response) -- only the later "did the import finish OK" confirmation was. Pending jobs are no longer polled over the network; they're tracked for a few minutes for logging purposes only and dropped once that window elapses, same as before but without the wasted connections. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.07 - T-Dongle C5:
v3.07 - PigletNode:
v3.03
Full Changelog: v3.06...v3.07
v3.06
v3.06 (2026-11-15)
Bug Fixes
- Self-update re-flashed the same firmware on every single boot --
fwInstallFromSD()flashed the staged/Firmware/<board>.ota.binimage viaUpdate.hand rebooted on success, but never deleted that file from the SD card. Boot's staged-install check only looks at whether the file still exists, so it kept finding the same already-installed image on every subsequent boot and re-flashing it again, forever. The staged file is now deleted immediately after a successful flash, before the reboot. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.06 - T-Dongle C5:
v3.06 - PigletNode:
v3.03
Full Changelog: v3.05...v3.06
v3.05
v3.05 (2026-11-15)
New Features
- Boot now pauses for an on-device "Update available" prompt -- when
fwCheckForUpdate()finds a newer release at boot, the device immediately shows the "Update!" banner with a live 20-second countdown, pausing the rest of the boot sequence (GPS init, boot uploads, Web UI start, scanning). Pressing the button during that window saves the pending-download marker and reboots straight into the dedicated download-only boot mode, the same action already available from the status page. If the countdown elapses with no press, the prompt is dismissed and the boot sequence continues normally -- the status page keeps showing the same banner for the rest of the session, so the update can still be started later. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.05 - T-Dongle C5:
v3.05 - PigletNode:
v3.03
Full Changelog: v3.04...v3.05
v3.04
v3.04 (2026-11-14)
New Features
- Self-update now runs as a dedicated, memory-optimized boot mode -- pressing the on-device "Download & Install" button no longer downloads firmware in the current session. Instead it saves the resolved release asset URL to the SD card and reboots into a dedicated download-only boot mode that skips GPS, the boot-upload flow, mesh preload, and the normal Web UI entirely, so the download's HTTPS connection is the very first (and only) TLS operation of that boot -- giving it the healthiest possible slice of the ESP32-C5's narrow DMA-capable heap instead of inheriting whatever the version-check's own TLS call already used up earlier in the session. Live progress (stage + percentage) is shown on the OLED/TFT throughout; the device installs and reboots automatically on success, or falls back to a normal boot if it ultimately can't connect.
- Firmware downloads wait for memory to settle and retry automatically -- before attempting the HTTPS connection, the device now pauses WiFi scanning, WDGoWars background job polling, and GPS diagnostic serial logging (all confirmed to compete for the same narrow
MALLOC_CAP_DMAheap pool), and waits up to 30 seconds for that pool to recover before connecting. If an attempt still fails, it now automatically retries the whole sequence (up to 12 attempts, 8 seconds apart) instead of giving up on the first error -- important since the on-device boot-mode flow has nobody watching a browser to click "try again". - GPS coordinates are validated before being cached or logged -- exact 0,0 ("Null Island", a real location in the Gulf of Guinea and almost certainly a GPS-less placeholder for this device), out-of-range, and non-finite values are now rejected at three layers (the position cache, scan logging, and a final backstop in the CSV writer), so a bad or missing fix can never end up written as a bogus location.
- "Delete Staged Firmware Files" Web UI button -- clears a stuck or partial download from
/Firmware/on the SD card without needing to pull the card, via a new/update/clearFirmwareendpoint.
Bug Fixes
- On-device update screen text could overlap and hide the download percentage -- the download-only boot mode's OLED/TFT status text chained lines with auto-advancing cursors (OLED) or let long status strings word-wrap into the line below (T-Dongle C5's narrower screen), so a long stage message (e.g. "Waiting for memory to free up (29s)...") could push the percentage line off-screen or draw directly over it. Each line now has its own fixed position, is truncated to what actually fits the screen width, and disables text wrap, so the layout stays stable and the live download percentage (plus KB counts on the main Piglet's larger OLED) is always visible, matching the detail already shown on the Serial console.
Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.04 - T-Dongle C5:
v3.04 - PigletNode:
v3.03
Full Changelog: v3.03...v3.04
v3.03
v3.03 (2026-11-05)
Bug Fixes
- Firmware self-update check could fragment the heap enough to break the install that followed it --
fwCheckForUpdate()buffered GitHub's entire API response viahttp.getString(). GitHub serves that response with chunked transfer-encoding (noContent-Length), and in that casegetString()skips pre-reserving its internal buffer and grows it incrementally as chunks arrive -- the same unreserved-Stringfragmentation pattern fixed in the Web UI's JSON handlers in v3.02, just in a different, less-frequently-exercised code path. This response can run several KB (full release notes + asset list) and runs immediately beforefwInstallUpdate()'s own sequence of TLS downloads, so the fragmentation it left behind directly caused those downloads to fail withSSL - Memory allocation failed, even though total free heap looked fine. The response is now buffered into a pre-reservedStreamString(single allocation) instead. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.03 - T-Dongle C5:
v3.03 - PigletNode:
v3.03
Full Changelog: v3.02...v3.03
v3.02
v3.02 (2026-11-05)
New Features
- Self-update from GitHub Releases -- every board (main Piglet, T-Dongle C5, PigletNode) now checks
github.com/Hamspiced/piglet's releases at boot (STA-connected boot only) and shows the result in a new Firmware Update Web UI card. A single Install Update click downloads the board's own firmware image over HTTPS and flashes it via the ESP32's native OTA mechanism, then reboots automatically. In the same pass, the other two boards' images are staged to/Firmware/on the SD card for the mesh-push feature below. PigletNode has no Web UI/SD card and does not get self-update; it remains a push-only OTA target. Ported from the design in olosnoks'warhogproject. - Core-pushed mesh node OTA updates -- a Piglet acting as mesh Core can push a firmware image to any connected node (PigletNode, T-Dongle C5, or a headless/XIAO Piglet) over the existing ESP-Now link, no USB required. The Core reads
/Firmware/<Board>.ota.binimages from its own SD card at boot, and the Web UI's new Mesh Nodes panel (Core mode only) lists connected nodes with an Update button and live transfer progress. The node verifies a SHA-256 of the whole image before switching boot partition, so an interrupted or corrupted transfer leaves it running its old firmware. A 1-byte board-type code, added to the existing Piglet-to-Piglet identification marker, prevents pushing the wrong board's image to a node -- every Piglet variant shares the same ESP32-C5 silicon, so the image's own chip ID alone can't tell PigletNode/Piglet/TDongleC5_Piglet apart. Ported from olosnoks'warhogproject's Core-to-node OTA engine. /Firmware/SD card convention -- the Core-push feature's staging folder, holding one.ota.binfile per board type. The self-update feature keeps it current automatically; it can also be populated manually by copying a release's assets onto the SD card, for offline/no-home-network setups. Each file is deleted before a new one is written, so an interrupted write can't leave a corrupt hybrid file behind.- On-device "Update Nodes through Core?" prompt -- a Piglet or T-Dongle C5 Piglet node reports its firmware version to its Core on every discovery handshake and heartbeat. When a connected XIAO-based node (Piglet or TDongleC5_Piglet) is running different firmware than the Core, the Core's own screen shows a confirm prompt with a 30-second countdown; a single button press on that page confirms the push (instead of advancing to the next page), and letting it time out skips that node for the rest of the session. Multiple mismatched nodes queue and are pushed one at a time. Push progress (node MAC, percent complete) is also shown on-screen.
- Auto-update for headless PigletNode nodes -- a new Auto-Update Headless PigletNode Nodes Web UI toggle (
autoUpdateHeadlessNodes, default off) lets a Core silently push a stagedPigletNode.ota.binto any connected headless PigletNode running different firmware, with no on-device confirmation (PigletNode has no screen). Retried at most once per node per session. XIAO-based nodes always use the on-screen confirm prompt instead, regardless of this setting. Recommended for use with an SD card rated at least 16GB for sustained-write reliability. - "Store Piglet Node Firmware" Web UI button -- downloads the latest
PigletNode.ota.binrelease asset to/Firmware/on demand, independent of whether the Core's own firmware is already current. Previously, a Core already on the latest release never resolved any release asset URLs (self-update checks for a newer version only), so there was no way to stage node firmware without first being out of date yourself. The Core also now reloads its staged images into PSRAM immediately after a successful stage, so a freshly downloaded image is usable without a reboot. - Manual per-node channel-range overrides -- a new Channel Overrides panel in the Web UI's Mesh Nodes card lets an operator pin a specific node (matched by MAC) to a fixed channel range instead of the automatic even split across connected nodes -- useful for a node with a directional antenna aimed at a specific band. Overrides are persisted to
/mesh_channel_overrides.cfgon the Core's SD card and survive a reboot.
Bug Fixes
- Web UI left open could eventually crash the device (
abort()in a newlib lock allocation) -- every JSON-emitting Web UI endpoint (/status.json,/update/status,/mesh/nodes.json,/mesh/channelOverrides) built its response into an emptyStringand letserializeJson()grow it via repeated reallocation. With a browser tab left open,/status.jsonalone is polled every 1.5 seconds indefinitely, so this fragmented the internal heap a little more on every single poll until a small FreeRTOS mutex allocation (used by a lazily-initialized newlib lock) could no longer find a large enough contiguous block, crashing the device -- reproducible simply by leaving the Web UI open, regardless of which page or action triggered it. Each JSON responseStringnow pre-reserves its exact needed size viameasureJson()before serialization, eliminating the incremental reallocation. Applied to both the main Piglet firmware and the T-Dongle C5 standalone firmware.
Known Issues
- ESP32 Arduino core 3.3.11 and 3.3.12 break Arduino IDE auto-reset on the XIAO ESP32-C5 -- uploads silently fail to connect unless you manually hold BOOT, tap RESET, then release BOOT. This is a regression in the native-USB handling of those core versions, not something in Piglet's own code. Use core 3.3.10 (the version this project's releases are built with) via Arduino IDE's Boards Manager to avoid it.
Configuration
- New config option:
autoUpdateHeadlessNodes-- auto-push staged firmware to out-of-date headless PigletNode nodes with no on-device confirmation (default: false).
Breaking Changes
- Partition scheme changed from
huge_apptodefault_8MB-- OTA updates (both self-update and Core-pushed mesh updates) require two app partitions, which the old single-apphuge_appscheme doesn't have. Every existing board needs one more full USB/web-flasher reflash with the new partition scheme before it can receive any OTA update; this can't be done over the air, since the partition table itself is what's changing. A board still on the old scheme cleanly reports "NODE HAS NO OTA SLOT" if a Core tries to push to it, rather than failing silently. The new scheme (3MB APP / 1.5MB SPIFFS per OTA slot) has more headroom than the old 3.00MB single-app slot, so this is a safe, no-functionality-lost change. - Release/web-flasher builds now compile with
PartitionScheme=default_8MB;release-firmware.ymlalso publishes each board's plain app image under a stable name (Piglet.ota.bin,TDongleC5_Piglet.ota.bin,PigletNode.ota.bin) as an additional release asset, which the self-update and Core-push features fetch by name.
Security Notes
- Mesh-push OTA only accepts updates from a node's already-paired Core MAC address -- a source-address check, not authentication; a spoofed MAC in ESP-Now range could in principle push firmware. The SHA-256 check is integrity-only (corruption/truncation), not a signature (authenticity). This matches the existing trust model of Piglet's ESP-Now mesh, which has no built-in authentication either. Self-update downloads use the same
WiFiClientSecure::setInsecure()TLS posture as every other upload in this codebase (no certificate pinning).
Firmware Versions
- Main Piglet (XIAO S3/C5/C6/C3):
v3.02 - T-Dongle C5:
v3.02 - PigletNode:
v3.02
Full Changelog: v3.01...v3.02