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

Can't restore Bonding

Hi,

I have a problem at restoring the bonding that is saved on Android EEPROM. I'm using Nordic 8001

I'm using the example from proximity. I modified the services.h using NRFGO to support ANCS and i added 2 characteristic for talking with the iOS phone. At some point everything worked fine, but now i have a big problem at restoring the Bond. The restore bonding functions are the functions from proximity template, so i don't thing there is a problem at the code. I think there is a problem at the NRGO settings. What can cause problem at bonding process?

I attached the setup.xml file for NRFGO.

Thank you!

proximity_setup.xml

  • Have you based your code on the latest version of the ble-sdk-arduino ? Can you also enable debug printing using the option in the lib_aci_init() and post your trace in this thread ?

    You could also look at these pages to see if they help

    http://i.got.nothing.to/code/on/avr-for-ble-and-ios/ https://github.com/guyzmo/avr_nrf_ancs_library

  • First run, when i do bonding:

    Arduino setup C1 :1, E, E3 :3, 84, E, 0, E4 :4, 81, 3, 0, 2, Evt Device Started: Standby C5 :5, 10, B4, 0, 50, 0, No Bond present in EEPROM. Advertising started : Waiting to be connected and bonded E3 :3, 84, 10, 0, E15 :F, 85, 3, 4B, 7E, D8, 5C, F8, 51, 18, 0, 0, 0, 48, 0, 5, Evt Connected [...bla, bla, bla...] Evt link connection interval changed C2 :2, 11, 1, DISCONNECT!!!! E3 :3, 84, 11, 0, E3 :3, 86, 3, 16, Evt Disconnected. Link Lost or Advertising timed out C1 :1, 7, E30 :1E, 84, 7, 1, 1, 4, 2, 3, 0, 8, A, 0, B, 1, 0, 0, E, 1, 64, 0, F, 2, 1, 0, 0, 12, 9, 0, 0, 2, 3, C1 :1, 7, E30 :1E, 84, 7, 1, 2, 1, 0, 0, 0, 0, 0, 16, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, C1 :1, 7, E29 :1D, 84, 7, 1, 3, 0, 0, 0, 18, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, C1 :1, 7, E30 :1E, 84, 7, 1, 4, 0, 19, 2, 1, 0, 0, 1B, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1C, 2, 1, 0, 0, 1E, 6, FF, C1 :1, 7, E29 :1D, 84, 7, 1, 5, FF, FF, FF, FF, FF, C, 4, 7, 0, F, 0, 10, 1, 8, 0, 12, 0, 13, 1, 9, 0, C, 0, D, 1, C1 :1, 7, E30 :1E, 84, 7, 1, 6, A, 0, 8, 0, 9, 1, 10, 5A, CB, A0, 79, 83, 6E, D8, 1, 1, 4B, 7E, D8, 5C, F8, 51, B7, 78, CA, 33, C1 :1, 7, E30 :1E, 84, 7, 1, 7, 10, 36, 11, 1C, FB, 2A, 84, 9E, 87, 5, 1C, EE, 18, 62, 9B, B1, F6, 0, 82, 4E, 5E, 95, 96, D8, 5B, 13, C1 :1, 7, E30 :1E, 84, 7, 1, 8, DD, CC, 82, 33, 3B, 8B, A, 34, 69, 6, D9, D5, 3B, 1E, 0, 0, 0, 0, 0, 0, 0, 0, FE, 2F, 0, 0, C1 :1, 7, E28 :1C, 84, 7, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 2, 91, 59, Dynamic Data read and stored successfully

    Second run, when i should restore the bond from eeprom:

    Arduino setup C1 :1, E, E3 :3, 84, E, 0, E4 :4, 81, 3, 0, 2, Evt Device Started: Standby Previous Bond present. Restoring Using existing bond stored in EEPROM. To delete the bond stored in EEPROM, connect Pin 6 to 3.3v and Reset. Make sure that the bond on the phone/PC is deleted as well. C28 :1C, 8, 1, 4, 2, 3, 0, 8, A, 0, B, 1, 0, 0, E, 1, 64, 0, F, 2, 1, 0, 0, 12, 9, 0, 0, 2, 3, E3 :3, 84, 8, 1, C28 :1C, 8, 2, 1, 0, 0, 0, 0, 0, 16, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, E3 :3, 84, 8, 1, C27 :1B, 8, 3, 0, 0, 0, 18, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, E3 :3, 84, 8, 1, C28 :1C, 8, 4, 0, 19, 2, 1, 0, 0, 1B, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1C, 2, 1, 0, 0, 1E, 6, FF, E3 :3, 84, 8, 1, C27 :1B, 8, 5, FF, FF, FF, FF, FF, C, 4, 7, 0, F, 0, 10, 1, 8, 0, 12, 0, 13, 1, 9, 0, C, 0, D, 1, E3 :3, 84, 8, 1, C28 :1C, 8, 6, A, 0, 8, 0, 9, 1, 10, 5A, CB, A0, 79, 83, 6E, D8, 1, 1, 4B, 7E, D8, 5C, F8, 51, B7, 78, CA, 33, E3 :3, 84, 8, 1, C28 :1C, 8, 7, 10, 36, 11, 1C, FB, 2A, 84, 9E, 87, 5, 1C, EE, 18, 62, 9B, B1, F6, 0, 82, 4E, 5E, 95, 96, D8, 5B, 13, E3 :3, 84, 8, 1, C28 :1C, 8, 8, DD, CC, 82, 33, 3B, 8B, A, 34, 69, 6, D9, D5, 3B, 1E, 0, 0, 0, 0, 0, 0, 0, 0, FE, 2F, 0, 0, E3 :3, 84, 8, 1, C26 :1A, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 2, 89, 1C, E3 :3, 84, 8, 88, Bond restore failed. Delete the bond and try again. C5 :5, 10, B4, 0, 50, 0, No Bond present in EEPROM. Advertising started : Waiting to be connected and bonded E3 :3, 84, 10, 0, E15 :F, 85, 3, 4B, 7E, D8, 5C, F8, 51, 18, 0, 0, 0, 48, 0, 5, Evt Connected C5 :5, 10, B4, 0, 50, 0, C1 :1, 9, E17 :11, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Evt Pipe Status Service Discovery is still going on. E3 :3, 84, 10, 83, ACI Command 10 Evt Cmd respone: Status 83 E12 :C, 84, 9, 0, 0, 0, 2, 3, 1, 0, 0, 0, 0, C11 :B, D, 4, 0, 0, 2, 3, 1, 0, 0, 0, 0, E3 :3, 84, D, 0, E7 :7, 87, 1, 2, 1, 0, 0, 0, 1 E3 :3, 86, 3, 24, Evt Disconnected. Link Lost or Advertising timed out

    I know these links. I studied them all. The version i am using is the version that was on git like 1 week ago.

  • If you look in proximity example, in the "bond_data_restore" function, my code ends here:

    if (0 >= write_dyn_num_msgs) { //should have returned earlier return ACI_STATUS_ERROR_INTERNAL; }

    I don't receive ACI_STATUS_TRANSACTION_COMPLETE. I really don't understand why because the same code used to work yesterday. :(

  • Looks like the Write Dynamic data failed with a CRC mismatch

    E3 :3, 84, 8, 88,

    Event : Length = 3 bytes (in decimal) Length = 0x03 (Hex) Event opcode = 0x84 (Hex) Command code for which this event is associated with = 0x08 (Write Dynamic Data) Status code = 0x88 = ACI Status Error CRC Mis match (See appendix in nRF8001 PS v1.2)

    = I can also see that the last message used in the Read Dynamic data is different from the last message in Write Dynamic Data

    Read Dynamic Data

    C1 :1, 7, E28 :1C, 84, 7, 2, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 2, 91, 59,

    Write Dynamic Data

    C26 :1A, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 2, 89, 1C, E3 :3, 84, 8, 88,

    As you can clearly see the last 2 bytes alone are different and this, I suspect , is the reason for the CRC failure.

  • Thank you! I changed some settings in NRFGo and now it works...

Related