[esp32_ble_client] Reduce GATT data event logging to prevent firmware update failures - #13252
Conversation
|
👋 Hi there! I've automatically requested reviews from codeowners based on the files changed in this PR. @jesserockz - You've been requested to review this PR as codeowner(s) of 2 file(s) that were modified. Thanks for your time! 🙏 |
|
To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file: external_components:
- source: github://pr#13252
components: [esp32_ble_client]
refresh: 1h(Added by the PR bot) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #13252 +/- ##
==========================================
- Coverage 73.79% 73.76% -0.03%
==========================================
Files 53 53
Lines 11329 11329
Branches 1538 1538
==========================================
- Hits 8360 8357 -3
- Misses 2570 2572 +2
- Partials 399 400 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses firmware update and pairing failures in BLE devices proxied through ESPHome by reducing logging verbosity of high-frequency data transfer events. When updating firmware or pairing with BLE devices, thousands of GATT data events can generate excessive UART output that introduces timing delays, causing operations to fail.
Changes:
- Renamed
log_gattc_event_()tolog_gattc_lifecycle_event_()for connection lifecycle events that remain at DEBUG level - Added
log_gattc_data_event_()helper that logs high-frequency data transfer events at VERBOSE level - Moved 7 data transfer event types (READ/WRITE operations, NOTIFY, REG/UNREG_FOR_NOTIFY) and unknown events to VERBOSE logging
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| esphome/components/esp32_ble_client/ble_client_base.h | Added declaration for new log_gattc_data_event_() function and renamed log_gattc_event_() to log_gattc_lifecycle_event_() |
| esphome/components/esp32_ble_client/ble_client_base.cpp | Implemented both logging functions with appropriate log levels, updated all GATT event handlers to use the correct function, and added comprehensive comments explaining the rationale |
Memory Impact AnalysisComponents:
📊 Component Memory Breakdown
🔍 Symbol-Level Changes (click to expand)Changed Symbols
New Symbols (top 15)
Removed Symbols (top 15)
This analysis runs automatically when components change. Memory usage is measured from a representative test configuration. |
|
thanks |
… update failures (#13252)
What does this implement/fix?
Reduces BLE GATT event logging from DEBUG to VERBOSE level to prevent failures when updating firmware on BLE devices through Bluetooth Proxy.
When using Bluetooth Proxy to update firmware on end BLE devices (locks, sensors, etc.) or pair with them, data transfer events (notifications, reads, writes) fire rapidly. Previously these were logged at DEBUG level - a single firmware update pushed to an end device can generate 10,000+ log messages. The UART write delays from this log flood cause timing issues that make these operations fail.
Changes:
log_gattc_event_()tolog_gattc_lifecycle_event_()for claritylog_gattc_data_event_()helper that logs at VERBOSE levelESP_GATTC_READ_CHAR_EVTESP_GATTC_WRITE_CHAR_EVTESP_GATTC_NOTIFY_EVTESP_GATTC_READ_DESCR_EVTESP_GATTC_WRITE_DESCR_EVTESP_GATTC_REG_FOR_NOTIFY_EVTESP_GATTC_UNREG_FOR_NOTIFY_EVTTypes of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml:Checklist:
tests/folder).If user exposed functionality or configuration variables are added/changed: