The chip reports what it has been configured to be - #5
Merged
Merged
Conversation
kRadioStats carried four counters. It now carries the radio: receive gain register, transmit power, front-end line, mode, spreading factor, coding rate, frequency, bandwidth, preamble, IRQ mask and flags. The engine reads it on length, so a peer that stops at sixteen bytes still parses and an older node still runs. The reason is that a board profile is a datasheet claim about hardware and not a claim about the firmware running on it. Until the chip reported its own state there was no way to tell a node whose firmware configured it correctly from one whose firmware did not - which is exactly the pair of faults MeshCore 1.17.1 fixed, receive gain reverting after an AGC reset and a transmit-enable line that never went high. The front-end line is three states rather than a flag, and it is latched at the moment of transmission rather than read live. RadioLib holds the line low while receiving and raises it just before SetTx, so the current level says only whether the node happens to be listening; reading it live docked an idle node 25 dB for the ordinary state of waiting. A node that has not transmitted has not answered the question, and says so. bridge/main.cpp writes the same payload in the same order. Two writers of one wire format is the arrangement RadioServerSX1262 exists to avoid and is only tolerable while they stay identical - an emulated node and a native one reporting different shapes would make every comparison between them a comparison of our own code. main.cpp reports the front end as "not answered" rather than "module out", because a native node has no such pin wired and reporting the line low would be true of the pin and false about the board. VirtualSX1262 also handles two commands it had defined and never acted on. SetTxParams is why transmit power was readable at all. Calibrate returns the gain register to its reset default, which is the mechanism behind the 1.17.1 fault: MeshCore's own AGC reset re-applies a compile-time macro over whatever the operator set at runtime, and on a variant without that macro - this one included - re-applies nothing at all. kSetFem carries the enable line in from the emulator. It arrives as a command rather than over SPI because the firmware drives it as an ordinary GPIO: the module sits beside the radio, not inside it, and the chip has no idea whether its output reaches an antenna. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
kRadioStatscarried four counters. It now carries the radio: receive gainregister, transmit power, front-end line, mode, SF, CR, frequency, bandwidth,
preamble, IRQ mask and flags.
A board profile is a datasheet claim about hardware, not a claim about the
firmware running on it. Until the chip reported its own state there was no way
to tell a node whose firmware configured it correctly from one whose firmware
did not — which is exactly the pair of faults MeshCore 1.17.1 fixed: receive
gain reverting after an AGC reset, and a transmit-enable line that never went
high.
Wire format
Read on length, so a peer that stops at 16 bytes still parses and an older
node still runs.
Transmit power is
int8with−128meaning never set, because0is a levela radio can legitimately be set to and cannot also mean "unset".
Three decisions worth reviewing
The front-end line is latched at transmit, not read live. RadioLib holds it
low while receiving and raises it just before
SetTx, so the current level saysonly whether the node happens to be listening. Reading it live docked an idle
E22 25 dB for the ordinary state of waiting — caught by running it, not by a
test. Hence three states: a node that has not transmitted has not answered the
question.
bridge/main.cppwrites the same payload in the same order. Two writers ofone wire format is the arrangement
RadioServerSX1262exists to avoid, and isonly tolerable while they stay identical — an emulated node and a native one
reporting different shapes would make every comparison between them a comparison
of our own code. Worth a second opinion on whether to share the encoder instead.
main.cppreports the front end as "not answered", never "module out." Anative node has no such pin wired;
SimHalowns an array of pins and nothingdrives an enable line into it. Reporting the line low would be true of the pin
and false about the board, and would dock every native node on a board that has
a module for a fault it did not have.
Also
VirtualSX1262handles two commands it had defined and never acted on.SetTxParamsis why transmit power is readable at all.Calibratereturns thegain register to its reset default — the mechanism behind the 1.17.1 fault,
where MeshCore's AGC reset re-applies a compile-time macro over whatever the
operator set at runtime, and on a variant without that macro (this one included)
re-applies nothing at all.
kSetFem = 0x06carries the enable line in from the emulator, as a commandrather than over SPI because the firmware drives it as an ordinary GPIO.
Verified
radioserverandsimple_repeaterboth build clean from this branch. TheWindows/TCP work from #4 is untouched — this was ported on top of it rather
than copied over it, which was a live risk: the tree it was developed in
predated that merge.
Consumers
Needs
MeshBench/meshbench#64, which parses the extended payload and drivesthe node window's Radio tab. Release binaries need rebuilding for any of this
to reach a running sweep.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HFhR9GR4JzRuXgf2DcimqD