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

nrf51 does not respond to bluetooth message

I am using nrf51 running as a peripheral and an iphone app as central. It works OK when I first use the iphone app to connect to nrf51. Then I quit the iphone app and let the nrf51 run in an idle mode with ble.waitForEvent(); If I restart the iphone app within a short time period, e.g., 1min, it can connect to nrf51 and work correctly with it. However if I wait longer time, e.g., 5-10mins, to restart the iphone app and connect to the nrf51, it can only discover the nrft1 advertising. The nrf51 does not respond to any message sent from the iphone App.

It seems that waiting in a idle mode with ble.waitForEvent() works only for a rather short period of time. The system would not function properly if there is no central device connect to it in a while. What could be the problem? Thanks!

  • iOS behavior with BLE when it is in Central role used to be following (probably still is):

    • Once mobile pp on top of iOS asks for link termination it can take up to several seconds (10?) before BLE chipset really sends LL_TERMINATE.
    • However if Peripheral device on the other side of the link sends LL_TERMINATE it disconnects pretty much immediately.

    So the workaround is to define custom indication/command on BT LE APP layer (on top of GATT) which signals that device (be it iOS or anything else) wants to disconnect quickly. Then mobile app developer can use it to speed up the process (if Peripheral side implements it of course;).

  • @toney1980 Which iOS app are you using? Do you see the same reconnect issue if you test with another platform. e.g. nRF connect for PC or Android?

Related