We are having some on-going issues with the reliability of Peripheral discovery when we are running multiple units simultaneously.
In some of our applications, there are up to 18 devices that are advertising, and on first power up, it can take anywhere from a few seconds to 5 minutes or more for all of the devices to be discoverable. I am monitoring the "discoverability" of the Peripherals using multiple approaches to confirm its an issue with the Peripherals (our custom App, our custom Central device, the CySmart App and the LightBlue App). In all circumstances, I am seeing a similar issue with the speed at which all of the devices become visible during a scan.
I am monitoring the status of one of these devices by sending repeated calls to CyBle_GetState() and sending the result out via the UART, and I can see that the Peripherals are thinking they are in the CYBLE_STATE_ADVERTISING state, yet still remain invisible when I'm searching for them via any of my methods.
I have the Peripherals set up with:
- Fast advertising - 20msec interval with 10sec timeout (have tried many different variants of this, without any real change to the result)
- Slow advertising interval 1000 - 10240 msec
- Every time I detect a Fast advertising timeout (via CYBLE_EVT_TIMEOUT) I make a call to CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST) to get things going again, so it shouldn't really be spending much, if any, time in Slow Advertising
- Every time I detect CYBLE_EVT_STACK_ON, CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP (with CyBle_GetState() == CYBLE_STATE_DISCONNECTED) or CYBLE_EVT_GAP_DEVICE_DISCONNECTED I'll also make a call to CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST) to get things going again
- In my main loop, I call CyBle_ProcessEvents() about every 10msec, although I have toyed around with this (have done it considerably faster - sub-millisecond frequency) without any change in performance.
Some times all my devices appear almost simultaneously, and briefly after the inital power on code has completed. Other times I'll get multiple units that just won't be discoverable for several minutes or more.
Anyone got any ideas on what I can do to resolve this issue? Or give me some pointers on where to go looking?