Skip to content

BLE mesh packet logging#35

Open
sybrenstuvel wants to merge 5 commits intoCisien:mainfrom
sybrenstuvel:sybren/ble-packet-logging
Open

BLE mesh packet logging#35
sybrenstuvel wants to merge 5 commits intoCisien:mainfrom
sybrenstuvel:sybren/ble-packet-logging

Conversation

@sybrenstuvel
Copy link
Copy Markdown

@sybrenstuvel sybrenstuvel commented Mar 15, 2026

This PR adds support for connecting to BLE devices for mesh packet logging.

Corresponding MeshCore PR: meshcore-dev/MeshCore#2039, which adds BLE mesh packet logging support to MeshCore.

This approach has a few notable aspects:

  • The config TOML will need to contain the MeshCore device's public and potentially also the private key. This is necessary because there is no serial connection, and thus meshcoretomqtt cannot retrieve those keys by itself. I also thought it would be a bad idea to extend the BLE protocol to allow fetching those, as then anyone with a Bluetooth scanner would be able to do this.
  • Because I found it annoying that I'd have to install NodeJS just for the token auth, this PR also includes a pure-Python implementation for the auth token generation. Let me know if that's acceptable, or it should be pulled out into another PR.

I've tested this with my branch of MeshCore on a Heltec Wireless Tracker, and this PR on a macbook.

Limitation: this PR doesn't deal with statistics, as those are requested by meshcoretomqtt via the serial connection. In order to implement that over BLE, that needs to be designed first. For one, that would need some reconsideration whether it's desirable to expose via unauthenticated BLE calls.

Disclaimer: this PR was made with the help of Claude AI. I'm a human, though, and happy to personally work on any feedback.

@Cisien
Copy link
Copy Markdown
Owner

Cisien commented Mar 17, 2026

It would be nice to split the python signing implementation into its own change.

I dont really like the idea of storing the keys in config and would rather see it available in the protocol. Ideally the node does the signing and the private key never leaves the node (like companions do)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants