Repository navigation
bump submodules: RS485 receive-path fixes + first ArduinoLibs tests - #25
Merged
Merged
Conversation
ArduinoLibs 6d1de81 -- fixes the four receive-path defects found auditing the vendored RS485_non_blocking (stale-packet re-delivery, unchecked malloc, no packet timeout, length checks compiled out of release builds) and adds test/, the first test infrastructure in that repo: an Arduino.h shim plus 28 assertions, each paired with a negative control that confirms disabling the fix turns them red. WLED 0cf79a01 -- bridge side: refuse to run on a failed socket alloc, and keep rejected frames counted now that a NULL from getMsg() no longer means "bus empty". Also extends `make test` to cover two suites it silently skipped: the new ArduinoLibs receive-path tests, and the rs485_bridge wire-format tests, which had to be run by hand and are now run on BOTH ABIs (native and -fpack-struct=1) since the point of most of those assertions is that the two agree. make test -> ampworks sensor-sync + rs485_bridge (x2 ABIs) + ArduinoLibs + router aphelps/ArduinoLibs#10 aphelps/WLED#15 Submodule PRs merge first; these pointers are re-pointed at the merged shas before this lands. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ
ArduinoLibs 538a01b -- the packet timeout measured poll latency rather than wire time, so with the check running before update() it could discard a frame whose remaining bytes were already in the FIFO: a regression against pre-timeout behaviour, not a pre-existing bug. Now checked after update(), plus a baud-derived timeout (fixed 250 ms killed every full-size frame at 4800 baud), reachable NULL guards, and uint16_t counters to keep the ATmega328 footprint down. Two of the new tests turned out to pass with their fix disabled and are now deterministic; three uncovered paths added. 45 assertions, up from 28. WLED 2b5baa2c -- scale the timeout to the configured baud, surface timeouts on the info page (the counter existed but nothing read it), and correct two comments that still said the library's length checks are compiled out of release builds. Makefile: test-bridge guards HMTL and ArduinoLibs too, not just WLED. It compiles against headers from all three, so on a fresh clone with uninitialised submodules a bare `make` failed with a confusing missing-header error from the compiler instead of the "run ./setup.sh" message require_submodule exists to print. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ
ArduinoLibs bceedb3 (#10) -- four receive-path defects fixed, plus test/: the first test infrastructure in that repo (45 assertions, each with a verified negative control). WLED cdfef9c0 (#15) -- bridge side: refuse to run on a failed socket alloc, scale the receive timeout to the configured baud, surface timeouts on the info page, keep rejected frames counted. Both squash-merged, so this replaces the branch-tip pointers this PR opened with. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ
This was referenced Jul 30, 2026
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.
Submodule pointer bump for the receive-path fixes, plus a
make testchange that belongs in this repo. Merge the two submodule PRs first.test/: the first test infrastructure in that repoThe four defects
All found by reading Nick Gammon's vendored
RS485_non_blockingafter the ArduinoLibs#5 self-review turned out to have verified byte-identity and packaging but never the logic. Full detail in the submodule PR; in brief:SET_ADDRESSto flash on receiptbegin()'smallocis unchecked/json/infosays healthygetMsg()'s length checks live inside#if DEBUG_LEVEL >= DEBUG_TRACEThe vendored library is untouched — every fix is in
RS485Utils, so it stays byte-identical to upstream.make testnow runs what it claimed toTwo suites were being silently skipped:
rs485_bridgewire-format tests, which had to be run by hand. They now run on both ABIs — native and-fpack-struct=1— since the point of most of those assertions is that an ESP32 and an ATMega328 agree, and running only one ABI cannot show that.That is not a cosmetic change: the socket-header packing bug merged earlier today was invisible partly because every automated check ran on one ABI at a time.
Verification
make testgreen across all four suites;pio run -e ampworksand-e usermodsboth SUCCESS; 28 receive-path assertions each paired with a negative control confirming that disabling the fix turns them red.🤖 Generated with Claude Code
https://claude.ai/code/session_013HqzdRdTRnreSvevaQGQSJ