-
-
Notifications
You must be signed in to change notification settings - Fork 171
ExtAdvertisement on ESP32 - data length issue #910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, I'm getting similiar error on ESP32-C3: E (7254378) NimBLE: Received HCI data length at host (165) exceeds maximum configured HCI event buffer size (70). |
I added -DDMYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE=256 to build_flags (platformIO) |
Hello I did the same, and got it to broadcast (100ms interval) up to 220 bytes. Works perfectly with 2 receiving devices , but I guess it should work with any number of them. I am still interested by h2zero's feedback on this fix, as there may be side effects, and it should be better applied in the original code.
|
Thank you for reporting this. There was a change in the available config settings and the default for this is supposed to be 257 when extended advertising is enabled. I will make this correction for the next release, in the mean time you should set this value yourself either in |
Thank you for that. FYI, all is fine with messages up to 223 bytes (+6 byte-header). With 224 bytes (=230 bytes incl. header), logs show that packet is received (NimBLEScanCallbacks: Discovered), but NimBLEAdvertisedDevice::haveManufacturerData() returns false. Maybe this is expected behavior, or another little fix with config settings could give us a few more bytes... But this is already a huge benefit vs 31 bytes, as it makes my project (real-time control of a dozen lego trains) possible ! In case this helps someone, I found that restraining the scan to a single PHY (hence avoiding channel change) on the receiver side ensures low latency & 100% reception of packets when broadcasting every 100ms. Thank you again. |
I guess you mean -DMYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE=256 ;-) |
Closing as resolved in 8f32a23 |
Hello,
Thank you for this great work.
When trying to send/receive extended advertisements (using NimBLEExt.setManufacturerdata()) with more than 28 bytes, I get the following message on the receiver's logs:
E (22095) NimBLE: Received HCI data length at host (74) exceeds maximum configured HCI event buffer size (70).
After some investigation, I found the log originates from file esp_nimble_hci.c (line 198):
The message size appears to be limited by MYNEWT_VAL(BLE_TRANSPORT_EVT_SIZE)) that translates after macro processing to MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE, which is defined (for ESP platform) in esp_nimble_cfg.h (line 1592) with a value of 70 (in line with the log message) :
Changing the value to 200 seems to solve the problem, as I managed to receive the data properly.
I guess this definition of MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE should be somehow increased to over 200 when Extended Advertisement is enabled (CONFIG_BT_NIMBLE_EXT_ADV defined).
Any help on how to do this properly (not sure what should be the correct value) will be welcome.
The text was updated successfully, but these errors were encountered: