How we think the problem should be solved:
*using BLE
*so-called peripheral devices are servers and the central device is a client
*servers go to light sleep as much as possible
*client connects to servers once and remains connected
*client gets data from servers' characteristics
We have tried using Neil Kolban's library (https://github.com/nkolban/ESP32_BLE_Arduino)
The problem is that once a server is put to light sleep the connection is immediately lost. We suppose that the problem is related to latency and connection interval, because it seems that by default latency is 0 and connection interval is 7.5 ms. We have tried setting higher latency and connection interval by using this function
Code: Select all
void BLEServer::updateConnParams(esp_bd_addr_t remote_bda, uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout)
We would appreciate it a lot when somebody could point us in the right direction, for example mentioning whether our logic is faulty to begin with or providing some example codes / sources, recommending another library ... etc. Thanks!
PS. We are aware of the automatic light sleep on ESP32 (https://github.com/espressif/esp-idf/is ... -500312453), and got it working. But we haven't been able to fully understand any of esp-idf BLE examples as they are veery long. So any tips on getting a BLE communication going with esp-idf would be very much appreciated.