Open
Conversation
Made with Claude AI.
Three fixes applied: BLELogInterface.h:108 — setMinPreferred(0x12) → setMaxPreferred(0x12) (bug: was clobbering the min value instead of setting max) BLELogInterface.h:42 — removed the redundant _line_len = 0 in flushLine(), collapsed the guard to a one-liner heltec_tracker/platformio.ini and sensecap_solar/platformio.ini — re-commented MESH_PACKET_LOGGING and BLE_PACKET_LOGGING
Use `lib_ldf_mode=chain+` so the LDF evaluates preprocessor conditions when scanning for library dependencies. Without this, the LDF (in default 'deep' mode) ignores it to find #include <BLEDevice.h> inside the #ifdef ESP32 block in esp32/BLELogInterface.h, pulling in the Arduino-Pico BLE library. That library only compiles correctly when PIO_FRAMEWORK_ARDUINO_ENABLE_BLUETOOTH is set (which enables the required BTstack defines), so without that flag the build fails. chain+ prevents this by honouring the #ifdef ESP32 guard.
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.
Disclaimer: this PR is indended as a starting point for the feature. The code itself is more a proof of concept, and I'm happy to go over it & clean things up. Let's first look at whether it's a feature that has the project's interest.
This PR adds support for mesh packet logging via a Bluetooth connection.
Adds a wrapper around the
Serial.print()calls forMESH_PACKET_LOGGING. The wrapper can either send to serial, as MeshCore does now, or to a BLE client.The BLE connection doesn't require any PIN, making it easy to connect with meshcore-to-mqtt. I have a matching PR for that too: Cisien/meshcoretomqtt#35
BLE MTU is set to max 256 bytes; the size actually used is also determined by the remote side. The payload will be split into multiple BLE messages when they are longer than the MTU.
For debugging independently of meshcore-to-mqtt, use this script. It uses the
bleakpackage to do BLE.I've tested this with a Heltec Wireless Tracker, and my meshcoretomqtt branch on a macbook.
Disclaimer: this PR was made with the help of Claude AI. I'm a human, though, and happy to personally work on any feedback.