Add companion radio debug bot firmware variant (multi-board)#2755
Closed
zfouts wants to merge 4 commits into
Closed
Add companion radio debug bot firmware variant (multi-board)#2755zfouts wants to merge 4 commits into
zfouts wants to merge 4 commits into
Conversation
…on-parse-failure Fix: CMD_SEND_RAW_PACKET not freeing packet on parse failure
A separate firmware type layering a mesh debug bot on top of the stock
BLE companion example without modifying upstream sources. Replies to
!-prefixed commands (!ping, !rf, !path, !status, !stats, !neighbors,
!uptime, !time, !ver) from direct messages or allow-listed channels,
with rate limiting.
Runtime config rides the companion protocol's custom vars ("bot",
"bot.channels") settable via meshcore-cli or the phone app, persisted
to flash. Envs for Xiao S3 WIO, Xiao nRF52, Heltec V3, Heltec V4,
RAK4631, RAK3401 (WisMesh 1W Booster), T1000-E and Heltec T114 in
variants/bot_envs/platformio.ini.
875b4a3 to
65fef12
Compare
Author
|
Closing as this should not be a core feature. |
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.
Implements the built-in debug bot discussed in #2754
What this adds
A new opt-in firmware type: the stock BLE companion with a small mesh debug
bot built in, for range testing and checking pathing in your local mesh.
When the node gets a direct message starting with
!it replies over themesh with diagnostics, and the message still gets forwarded to the phone app
like normal.
Commands:
!ping(the requester's SNR/RSSI/hop count into the node),!rf,!path(hop hashes resolved to contact names),!status,!stats,!neighbors,!uptime,!time,!ver.It can also answer in group channels, but only ones on an allow-list, which
is empty by default. So no spamming Public.
Keeping it polite on the airwaves
Replies are rate limited three ways: a global minimum gap between replies, a
per-sender cooldown, and a hard cap per minute. A flood of
!messages won'tturn the node into an airtime hog. Replies never start with
!so bots can'ttrigger each other, and unknown commands are ignored silently.
Runtime configuration
No mesh-side config, so nobody on the mesh can mess with your bot. It's
controlled through the existing custom vars frames (CMD_GET_CUSTOM_VARS /
CMD_SET_CUSTOM_VAR), e.g. with meshcore-cli:
Settings persist to flash and survive reboots.
Design: zero changes to existing files
Everything lives in
examples/companion_radio_bot/plus one env file(
variants/bot_envs/platformio.ini). No upstream file is modified, so thiscan't break any existing build:
main.cppincludes the stock companionmain.cppwithMyMeshrenamedto a
BotMeshsubclass that overridesonMessageRecv/onChannelMessageRecv. The env links the original symbol back with-Wl,--defsym,the_mesh=the_bot_mesh.BotTarget.cppcompiles the board's stocktarget.cppwith the globalsensorsobject swapped for a thin subclass that adds the two customvars. Works unmodified across boards, including the T1000-E's custom
T1000SensorManager.MyMesh's public API. Stock builds never compile anyof these files.
Boards
Xiao_S3_WIO,Xiao_nrf52,Heltec_v3,heltec_v4,RAK_4631,RAK_3401(WisMesh 1W Booster),t1000e,Heltec_t114, each as<board>_companion_radio_ble_bot. Adding another board is about 12 linesof platformio.ini that extend its stock BLE companion env. Full docs in
examples/companion_radio_bot/BOT_README.md.Testing
RAK WisMesh 1W Booster (RAK3401 + RAK13302).
sensorsresolves to the wrapper andthe_meshto the bot subclass on both architectures.