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

Cannot Re-pair nRF8001 in iOS

I have an application based on the ble_HID_keyboard_template (uses STM32F072 instead of Arduino). The first time I pair my iPhone 5 (iOS 8.1.1) with the nRF8001, everything is fine and it receives key presses. However, if I then instruct the phone to forget the nRF8001, and try to pair again, the phone no longer receives key presses (but says the nRF8001 is connected).

I don't get any error events from the nRF8001. When comparing the events I see between a working pairing and failed pairing, everything is the same except for one thing. The timing event:

Working: E7 :07, 89, 0C, 00, 04, 00, 2C, 01 ---Timing change received conn Interval: 0x0C

Not working: E7 :07, 89, 18, 00, 00, 00, 48, 00 ---Timing change received conn Interval: 0x18

It is always the case that if I get a timing of 0x18, no key presses come through. If I get 0x0C, keys work.

If I tell the phone to forget the nRF8001, and then toggle Bluetooth off/on, pairing works again (timing is 0x0C). But fails on a re-pair as usual.

I'm not sure if the timing is the root cause, or a symptom, but it's all I have to go on. I have tried setting timing explicitly with lib_aci_change_timing (instead of lib_aci_change_timing_GAP_PPCP), but no joy.

The phone works with a real bluetooth keyboard just fine. I haven't tried pairing my nRF8001 application to any other platforms yet, so I cannot isolate this to nRF8001 <-> iOS specifically, or just an issue with my application code.

Parents
  • If you delete the bond in iOS you will also have to do this on the peer (nRF8001), did up do this? Since iOS is changing it's address every 15 minutes, we cannot enable the white list when bonded to an iOS device, which is why you are able to connect to the device again.

    Are you checking for pipe error events? You should also make sure that you are saving and restoring dynamic data correctly on the nRF8001 so you don't lose the bond information on power toggles.

  • Thank you for the reply. The problem persists even after toggling the reset pin on the nRF8001, which I assume would wipe the bonding data on it. If that doesn't wipe the bonding data, would you mind telling me how to do so? I'm using the Arduino SDK and see no way to clear the bond data from the nRF8001, only upload existing bond data to it. And yes, I have debugging turned on, so I should see all events, and none of them have been errors while reproducing this issue.

Reply
  • Thank you for the reply. The problem persists even after toggling the reset pin on the nRF8001, which I assume would wipe the bonding data on it. If that doesn't wipe the bonding data, would you mind telling me how to do so? I'm using the Arduino SDK and see no way to clear the bond data from the nRF8001, only upload existing bond data to it. And yes, I have debugging turned on, so I should see all events, and none of them have been errors while reproducing this issue.

Children
No Data
Related