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
ESP32 BLE client connect to multiple servers #6926
Comments
@UmangSuthar101 Let me know is the issue still occurs. |
@SuGlider , as you mentioned I update the esp-arduino to latest version 2.0.3 and again I got the following log check this: Pulse: 84 |
@chegewara - Could you please help @UmangSuthar101 on this issue? Thanks! |
Greetings of the day, @SuGlider & @chegewara could you plz help me with this issue, its very difficult for me to get multiple ble server data to ESP-32 ble client !!! |
This is low level error/warning log. I can only guessing it may be related to low memory, but this should be asked on esp-idf. |
@chegewara I asked espriff team and they suggested me asking on esp-Arduino. And this is not a warning log because after this line I cann't able to connect any BLE servers. I also try this code on 8MB module but the same error show me, whenever I connect multiple BLE servers. Is there any proper example that connects multiple BLE servers to ESP-32 BLE client?? Suggests me. |
Again, This is not problem with flash, so 4MB or 8MB makes no difference, but you should try to switch to NimBLE library. |
@chegewara ok, get it!! I'll check NimBLE. But is there any example or reference link(with ArduinoBLE library) which already connects multiple servers to the ESP BLE client, if that one gives me success then I will go through it? |
Im pretty sure you can find some, but nothing i am aware of. |
There is an IDF example of GATTC connecting to 3 BLE Servers: Tutorial and explanation: |
@UmangSuthar101 |
The best and more stable BLE stack is the "NimbleBLE".... |
Hi, this program is sort of working but need further improvement:
|
I think UmangSuthar101 was interested in using Arduino API not IDF. I have the same question and have not found any good example so far. |
SL06 BLEDevice::createClient(); overwrites a pointer in BLEdevice so making second client will likely break some callback events to 1st one going through that pointer and create memory leaks. The BLEDevice does not support multiple instances either. There is no reference to the client instance in call backs so I do not see how the connection is managed. The lack of any example lets me to conclusion that was not written to support multiple server connections properly. |
petrrpancon - I would be interested in the code when finished. I'm trying to connect a single ESP32 client to multiple identical BLE motion sensors (with different addresses) at the same time and read their notification data; Arduino IDE. |
@petrrpancon could share the code please, I'm trying to connect more than two clients and get their rssi continously |
Hi, the code is part of a project and I can not easily extract it, but let me show what i did.
After the connection i run each client in its thread. It seem to work fine but don't expect a production quality from the arduino code. especially with threads. Esp32 had limit of 4 connections so be aware of that too. |
Board
ESP32 DevKitc V4
Device Description
Development Kit: ESP32 DevKitc V4(attached picture)
Module or chip used: ESP32-WROOM-32
Compiler version: Extensa-esp32-elf-GCC
Hardware Configuration
GPIO(34) connected to the resistor n/w for getting analog value of the battery!!
Version
v1.0.6
IDE Name
Arduino IDE
Operating System
Windows 10
Flash frequency
80 MHz
PSRAM enabled
no
Upload speed
921600
Description
I upload the code for the BLE multi-client in this module.
After some time such logs appear in the console:
....
lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 2)
....
lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)
BLE disconnects happen too often and show me these types of logs.
Expected Behavior
simultaneously
Sketch
Debug Message
Other Steps to Reproduce
I go thruogh the espriff forum and also check github for HCI error but nothing get any solution.
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: