Repository navigation
Binary wire protocol (v1) as the default host stream - #2
Merged
Merged
Conversation
One CSV row is about 177 bytes, which is 96% of the 921600-baud link at 500 Hz. Samples are now sent as COBS-framed, CRC-16 checked binary frames of at most 103 bytes (about 56% of the link) with a sequence number. - include/wire.h: protocol v1 framing, header-only and Arduino-free - src/transport.cpp: host output behind a small interface; the CSV stream stays available as the esp32dev-csv environment - HELLO frame (board, version, git revision, rates, sensors) at boot and every 2 s; STATUS frame every second - tools/host: protocol tests run in CI, plus the golden stream generator used by the data-pipeline decoder tests - docs/wire-protocol.md: specification
Boot ROM output would otherwise be glued onto the first frame and cost it.
This was referenced Nov 13, 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.
Step 2 of the plan: the host stream becomes a binary protocol.
Why
One CSV row is about 177 bytes. At 500 Hz that is 88.5 kB/s on a link that carries 92.16 kB/s, so the UART was about 96 % full. A binary sample frame is at most 103 bytes (about 56 % of the link).
What changes
include/wire.h: protocol v1.COBS(type | body | crc16) 0x00, CRC-16/CCITT-FALSE, little-endian. Header-only with no Arduino dependencies, so the same code runs in host tests.src/transport.cpp: all host output behindtransport_*().main.cppno longer touchesSerial.HELLO(board, firmware version, git revision, rates, detected sensors; at boot and every 2 s),SAMPLE(98-byte struct with a sequence number),STATUS(ring-buffer drops and samples sent, every second),LOG(the old# ...messages).esp32dev-csvenvironment keeps the original CSV stream forpio device monitor.scripts/version.pystamps the build with the git revision.docs/wire-protocol.md: the specification. README updated.Testing
tools/host/test_wire.cpp(CRC check value, COBS round trips for every body length, no stray zero bytes, frame size) passes locally and runs in CI.tools/host/wire_dump.cppdecodes correctly with an independent Python decoder; the data-pipeline PR tests against it.Needs you
Flash this and log one session with the data-pipeline PR's logger, then compare
imu_hzwith the 415 Hz in the README's sample metadata. That number decides what the README should claim.Merge together with the data-pipeline PR: the old logger cannot read the binary stream.