1 Reply Latest reply on Jun 17, 2020 3:13 AM by PY_21

    Peripheral Discovery Issue

    MiAu_3808196

      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?

       

      Cheers,

      Mike

        • 1. Re: Peripheral Discovery Issue
          PY_21

          Hello,

           

          1. Could you please check the api result of the CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST) function in CYBLE_EVT_TIMEOUT event ? The Slow advertising interval parameters are applied to the device after an internal fast advertising interval timeout occurs. After completing the fast advertising, slow advertising will be enabled.
          2. Please check with enabling only the fast advertising parameter in the BLE Component configuration as shown in below image. Always use the latest BLE component(v3.65) in the PSoC Creator(In the PSoC Creator, Goto Projects ->Update components ->update BLE to v3.65).
          3. At the Central device, please check the scanning parameters, the best central device scanning algorithm will have shorter Scan windows and intervals in order to sequentially check each advertising channel. If you set the scan interval equal to the scan window, then the device will scan continuously.

           

          Thanks,
          P Yugandhar.