Hi guys! We are new to ESP32. Our aim is to develop a system of one central device and multiple peripheral devices, each p. device making measurements with sensors and sending those values to the central device (about once per second). Since peripheral devices are running on batteries, their current consumption has to be as low as possible.
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
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
void BLEServer::updateConnParams(esp_bd_addr_t remote_bda, uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout)
but it seems to not do anything and nRf Connect app still shows the default parameters (interval 7.5 ms, latency 0) when connecting to the server.
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 ... etc. Thanks!
Hi guys! We are new to ESP32. Our aim is to develop a system of one central device and multiple peripheral devices, each p. device making measurements with sensors and sending those values to the central device (about once per second). Since peripheral devices are running on batteries, their current consumption has to be as low as possible.
How we think the problem should be solved:
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
void BLEServer::updateConnParams(esp_bd_addr_t remote_bda, uint16_t minInterval, uint16_t maxInterval, uint16_t latency, uint16_t timeout)
but it seems to not do anything and nRf Connect app still shows the default parameters (interval 7.5 ms, latency 0) when connecting to the server.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 ... etc. Thanks!