Automatic advertising fails but app is not informed

NCS 2.8.0

NRF52840

BLE device acting as central and peripheral

I encountered a problem similar to the one described here  bt_adv: Controller cannot resume connectable advertising 

Specifically during scanning the peripheral-mode connection disconnects and in some cases the automatic advertising restart fails.

I see this error on the logging

[00:02:06.023,773] <inf> my_ble: Disconnected as peripheral: 4B:77:76:10:5F:45 (random), reason 0x13
[00:02:06.024,200] <wrn> bt_hci_core: opcode 0x2005 status 0x0c
[00:02:06.024,230] <wrn> bt_id: cmd disallowed
[00:02:06.024,230] <err> bt_adv: Controller cannot resume connectable advertising (-13)

After this point the advertising does not restart until I stop and re-start. 

Is there an error notice sent to the app so that I can start recovery?  

I'm trying to fix the issue with:  

CONFIG_BT_SCAN_WITH_IDENTITY=y

But I'm concerned there may be other cases where this type of failure could occur.

Parents
  • Hi,

    I suspect that you are seeing the issue discussed here. Increasing the maximum connection by setting CONFIG_BT_MAX_CONN should solve the issue in this case.

    For reference, the way to handle re-starting advertising is changes in nRF Connect SDK 3.0 to avoid this issue, where the application is always responsible for restarting advertising after the previous connection shas ended and all clean-up has been performed, so that the stack is ready to restart advertising. This is sgnalled to the application via the recycled callback. This approahc is more robust and recommended. You can see an example here.

Reply
  • Hi,

    I suspect that you are seeing the issue discussed here. Increasing the maximum connection by setting CONFIG_BT_MAX_CONN should solve the issue in this case.

    For reference, the way to handle re-starting advertising is changes in nRF Connect SDK 3.0 to avoid this issue, where the application is always responsible for restarting advertising after the previous connection shas ended and all clean-up has been performed, so that the stack is ready to restart advertising. This is sgnalled to the application via the recycled callback. This approahc is more robust and recommended. You can see an example here.

Children
No Data
Related