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.

Reply
  • 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.

Children
Related