Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Trouble with background reconnection after reset (iOS)

Hello,

I'm experiencing some problems reconnecting an iOS device (possibly same thing on Android) to my peripheral in the background. This happens most of the times after a peripheral reset. With background I mean my app is closed (running in the background, not killed).

My peripheral advertises fine as usual and the phone can always connect to my peripheral if it actively scans for my device. The problem happens when the reconnection is handled by iOS in the background. Sometimes it just can't connect, probably because it can't see the advertisement packets.

One possible cause for this might be that iOS caches the advertising intervals after connection, and on disconnection it only starts scanning in those intervals to save power. Then on peripheral reset, the peripheral starts advertising in the same intervals but phased out, therefore the scan intervals and the advertising intervals would miss each other. That's just a theory.

Does anyone have an idea about what my problem is? And what can be done to solve it, either on the firmware side or on the app side?

Thanks for your help!

Parents Reply Children
  • So it looks like there isn't much to do from the NRF52 side, and most of the work needs to be done on the iOS side. Besides adjusting GAP connection parameters, I didn't really see anything to be done.

  • I talked to one of our developers and he don’t think it is a phased out scanning issue, to guarantee that you can try advertising fast, then slowing down over time and see how things work.

    How do you reconnect in the background? Is it possible to upload some code?

  • Unfortunately I'm not in charge of the mobile app development so I can't really say how the background reconnection is made. I'm just wondering if I can make life easier for the app development team somehow.

    I will ask and see if I can get some code from the iOS app here.