Repository navigation
bt: add AT+STATUS runtime diagnostics and fix the peripheral interval range - #6
Merged
Merged
Conversation
The peripheral (telemetry) role asked for the connection interval with min_int and max_int swapped, so the update carried min > max and no central can apply it. Set the range the right way round.
A trainer link can look broken while the module is working: the counters make the difference visible from the radio side. AT+STATUS reports the framed notifications forwarded, malformed payloads, UART packets/bytes, the worst UART write and BLE->UART latency (average and worst) and the notification gap statistics.
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.
bt: add AT+STATUS runtime diagnostics and fix the peripheral interval range
Summary
Two pieces of the
anchor-portwork that are worth having indevelop, withoutbringing the rest of that branch:
was built with
min_intandmax_intswapped, so it carriedmin > maxandno central can apply it. Both are set the right way round now.
AT+STATUS, a project extension that dumps the runtime countersof the central (trainer master) data path.
Why
The diagnostics come from a real support case: a radio reported "trainer signal
lost / recovered" in a loop while the BLE link was fine (the tracker's LED
stayed solid). With
AT+STATUSit took one command to show that the module wasreceiving and forwarding every frame, and that the frames were being dropped on
the radio side. Without it, the only signal is "the trainer doesn't work".
Output
rxmalformed0x7E-framed)uartPkts/uartByteswrMaxUsrxToUartMaxUs/rxToUartAvgUsgapMaxMs/gaps100Implementation notes
AT+STATUSdump, sono lock is added to the data path; torn reads are acceptable for a dump.
AT+STATUSpauses the trainer passthrough while it isparsed; the handler restores it immediately (the command does not touch the
link).
tools/at_bench.pychecks that the stream survives it.Testing
pio test -e native: 23/23.C3SuperMini,C3SuperMini_nimble,ESP32_DEV38P,ESP32_DEV38P_nimble.tools/at_bench.py: 18/18 (the bench now coversAT+STATUS).no gaps over 100 ms, and the rate is unchanged right after
AT+STATUS.malformed=0,uartPkts==rx,gaps100=0.doc/BENCH.mdandREADME.mdupdated (command table, check count, validationmatrix).
Notes
The rest of
anchor-port(bounded BLE->UART queue, 7.5 ms/2M link tuning,ROLE0 auto-detection and the CRSF viewer compatibility) stays in that branch:
the measurements show no benefit over the direct write on the current hardware,
and the ROLE0 auto-detection changes peripheral behaviour by default.