This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51422 Central not always detecting peripheral's beacon and ble services

Hello,

I am developing two systems. One is a peripheral that advertises both a beacon and a ble peripheral custom service (using nRF51822 with s110 softdevice). The second is a central that is supposed to both detect the beacon and be able to connect to the first system's peripheral service (using nRF51822 with s130 softdevice).

in on_ble_central_evt(ble_evt_t * p_ble_evt), just as in the examples, I parse the advertising report and check if the UUID matches that of the custom service. I also parse the report with another function to see if it is a beacon broadcast with the desired UUID.

If the peripheral advertises either as a beacon or as a ble service, I can successfully detect those cases. However, if I make it advertise both, very often the ble service seems to shadow the beacon, and I am never able to detect the beacon broadcast. I know both are there, because the Master Control app shows both (the entry for the peripheral alternates between beacon and ble service). If the central does detect the beacon, it seems to be able to successfully detect both the beacon and the peripheral from that point on. But each time I turn on the peripheral, it is almost a random chance whether the central will detect the beacon at all.

Is there something I should be doing to allow the central to see both the beacon and the peripheral service reliably? Alternatively, is there a way to have the softdevice preferentially look for a beacon? If so, I could force it to look for the beacon periodically.

Note that because the beacon and the peripheral are generated by the same device, they share the same peer address, and I wonder if that causes any issue on detection by the central.

Thanks!

EDIT: I was able to get this working somewhat by making the advertising interval for the ble service much longer than that of the beacon (e.g. beacon @ 500ms, ble service @ 2000ms), but still there are long periods where it sees only the ble service and not the beacon.

Parents
  • Seems to be working fine here. I tested with SDK 10.0.0 on PCA10028. I just added a app_beacon_start() after ble_advertising_start(). I didn't modify the intervals in the example, 400 ms for the beacon, and 480 ms for the hrs.

    Here is the sniffer trace.

  • I also have the beacon and peripheral service working together. The problem is that on my other device, running as a central (S130), I can have periods where it seems to stop seeing the beacon advertising packets. During these periods, the Master Control Panel shows both the beacon and the service, but as the debug log below shows, my central scanner doesn't pick up the beacon. It was much worse when the BLE service was advertising more frequently (480ms vs. 2000ms). My application relies on being able to pick up the beacon at least every 20 seconds, but during these periods, it can go > 30 seconds without registering the beacon.

    (Most of the time both beacon and BLE service are found)
    [11:45:23] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:24] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:25] BLE service identified
    [11:45:26] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:26] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:27] BLE service identified
    [11:45:28] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:28] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:30] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:31] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:31] BLE service identified
    [11:45:33] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:33] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:34] BLE service identified
    [11:45:35] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:36] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:36] BLE service identified
    [11:45:38] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:39] BLE service identified
    ...
    (Periodically, the beacon stops being found by the central)
    [11:51:23] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:24] BLE service identified
    [11:51:25] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:26] BLE service identified
    [11:51:28] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:29] BLE service identified
    [11:51:33] BLE service identified
    [11:51:35] BLE service identified
    [11:51:38] BLE service identified
    [11:51:40] BLE service identified
    [11:51:43] BLE service identified
    [11:51:45] BLE service identified
    [11:51:49] BLE service identified
    [11:51:51] BLE service identified
    [11:51:54] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:56] BLE service identified
    [11:51:57] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:59] BLE service identified
    [11:51:59] Beacon identified: M: 13330 m: 30806 P: -61
    [11:52:02] Beacon identified: M: 13330 m: 30806 P: -61
    [11:52:03] BLE service identified
    
Reply
  • I also have the beacon and peripheral service working together. The problem is that on my other device, running as a central (S130), I can have periods where it seems to stop seeing the beacon advertising packets. During these periods, the Master Control Panel shows both the beacon and the service, but as the debug log below shows, my central scanner doesn't pick up the beacon. It was much worse when the BLE service was advertising more frequently (480ms vs. 2000ms). My application relies on being able to pick up the beacon at least every 20 seconds, but during these periods, it can go > 30 seconds without registering the beacon.

    (Most of the time both beacon and BLE service are found)
    [11:45:23] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:24] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:25] BLE service identified
    [11:45:26] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:26] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:27] BLE service identified
    [11:45:28] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:28] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:30] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:31] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:31] BLE service identified
    [11:45:33] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:33] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:34] BLE service identified
    [11:45:35] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:36] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:36] BLE service identified
    [11:45:38] Beacon identified: M: 13330 m: 30806 P: -61
    [11:45:39] BLE service identified
    ...
    (Periodically, the beacon stops being found by the central)
    [11:51:23] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:24] BLE service identified
    [11:51:25] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:26] BLE service identified
    [11:51:28] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:29] BLE service identified
    [11:51:33] BLE service identified
    [11:51:35] BLE service identified
    [11:51:38] BLE service identified
    [11:51:40] BLE service identified
    [11:51:43] BLE service identified
    [11:51:45] BLE service identified
    [11:51:49] BLE service identified
    [11:51:51] BLE service identified
    [11:51:54] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:56] BLE service identified
    [11:51:57] Beacon identified: M: 13330 m: 30806 P: -61
    [11:51:59] BLE service identified
    [11:51:59] Beacon identified: M: 13330 m: 30806 P: -61
    [11:52:02] Beacon identified: M: 13330 m: 30806 P: -61
    [11:52:03] BLE service identified
    
Children
No Data
Related