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

nrf52840 pdk multirole

Hi,

I am trying to set an nrf52840 pdk (with SDK14 and s140_nrf52840_5.0.0-2.alpha) as peripheral and central at the same time and another nrf52840 pdk just as a peripheral . First the multirole pdk start advertising and smart phones can communicate with it via pairing by using static passkey with MITM . Then i send a command from the phone to tell the pdk start scanning for another nrf52840  pdk wich acts just as a peripheral and its characteristics are protected by static passkey with MITM as well. Everything  works fine utill i start dicovery for nrf52840  pdk(just peripheral) services from the multirole nrf52840 pdk (wich now act as central), I get  Collector did not use MITM from the peripheral side and disconnecting, and on the multirole side i get Disconnected with error 13 which means Operation timed out. So my question is :

Is its possible to pair two nrf52840 pdk with static passkey? note that i use sd_ble_gap_auth_key_reply() to answer the passkey from the central to the peripheral, which i am not sure if it's the right way! My idea is based on ble_app_multirole_lesc example.

Parents
  • Hi Nahro,

    Please try to test with a single connection first. Just to make sure the problem was not because you have multiple roles and for some reasons the peer manager messed up. 

    Secondly, doing service discovery shouldn't cause any issue with encryption level. You only receive rejection from the peer when you try to do a read/write that require the connection to be encrypted by MITM. 

    Also the peer shouldn't disconnect because the link was not encrypted at correct level. Unless it's how the application designed. 

    Using sd_ble_gap_auth_key_reply() to tell the softdevice what the passkey is (when the peer device display it) is the correct way. 

    I would suggest you to get a sniffer trace to see what exactly happens over the air. 

  • Hi Hung,

    Now I tested with single connection and I get  Collector did not use MITM from the peripheral side(i have MITM in both) and disconnecting, and on the central side i get Disconnected with error 13. it never reachs BLE_GAP_EVT_AUTH_KEY_REQUEST in central  device to send the passkey with the  sd_ble_gap_auth_key_reply().

    I added if statement in pm_evt_handler in central program(i have the same if statement in peripheral program that is why i get Collector did not use MITM) to check if the peripheral have the MITM, i get the same error (did not use MITM) which means both sides did not authenticated  with MITM while i enabled MITM in peer_manager_init in both sides!!

    I get MITM authentication while i connect to the peripheral device with smart phone without any problems.

  • How do you configure the central and peripheral regarding the IO capability ? I mean which device you configured to be keyboard and which one was display ? 


    I suspect that you don't have IO capability so MITM is not possible. That's why you have "Collector did not use MITM" and get disconnection. 

    Note that when you do static passkey with BLE_GAP_OPT_PASSKEY, you only set it up on one peer as the display. The other peer should be configured as keyboard, with no static passkey. 

    I would suggest you to test with the ble_app_gls example, we use passkey in this example. 

     

  • The peripheral is BLE_GAP_IO_CAPS_DISPLAY_ONLY and the central is BLE_GAP_IO_CAPS_KEYBOARD_ONLY. As you said i don't have keyboard in central and i use NRF_LOG_INFO to display the static passkey in the peripheral. I can connect to the peripheral via smart phone and i was thinking i can do the same with the pdk as central but instead of entering the passkey via keyboard i use sd_ble_gap_auth_key_reply() function to pass the static passkey. I am wondering if there is any othe solution to do that whit static passkey in central side without having any keyboard?

  • Hi Nahro, 

     

    Sorry for the late response, it's been the Easter vacation last week.I don't see any reason that wouldn't work. You can have a look at this sequence chart to see how bonding with passkey work (in this case we skip the part that User enter the passkey)

  • Hi Hung,

    Yes it works, I do not know what to mark as answer  Smiley

Reply Children
No Data
Related