How to use CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_AUTHEN

Hello.

I am trying DFU with reference to DevAcademy Lesson 9. I am glad to see that it has been updated for v2.7.0 - v2.9.0.
I am interested in the following settings.

Also, it’s highly recommended to authenticate and encrypt the connection where the DFU will take place. This can be done by enabling CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_AUTHEN. When this option is enabled, a 6-digit passkey will be displayed on your serial terminal, which must be entered into the phone app.

I tried it right away, but an error occurred in the Device Manager App. Also, the Passkey was not displayed in the serial terminal.

The DFU settings follow Exercise 5 – FOTA over Bluetooth Low Energy and Simultaneous updates for both cores of the nRF5340.
What should I refer to for any missing settings or implementations?

Thanks for reading.

a.da

Parents
  • Hello,

    I tried that exercise just now, and it is working fine on my side. After selecting the swap type "Test and Confirm," you will receive a pairing and connection request, where you will be prompted to enter the passcode generated in the serial terminal. I am attaching a screenshot that I received while testing the exercise.

    I used nrf5340dk and NCS v2.9.0

    Do you have any logs showing any issue from the nRF device?

    Kind Regards,

    Abhijith

  • Hi Abhijith, thanks for your reply.

    First, I must apologize. I was using the wrong sample as the base.
    (I was using another sample that I frequently use instead of the Peripheral LBS Sample.)
    I am truly sorry for taking up your unnecessary time.

    Please allow me to confirm if my understanding is correct.

    • Part of this authentication logic is within the main.c of the Peripheral LBS Sample.
    • To enable authentication in other samples or custom projects, it is necessary to separately adapt and modify the logic from the Peripheral LBS Sample.

    I mistakenly thought that simply enabling CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_AUTHEN would activate the authentication logic within the SDK.

    Kind regards,

    a.da

  • Hello,

    a.da said:
    First, I must apologize. I was using the wrong sample as the base.
    (I was using another sample that I frequently use instead of the Peripheral LBS Sample.)
    I am truly sorry for taking up your unnecessary time.

    No worries

    a.da said:
    Part of this authentication logic is within the main.c of the Peripheral LBS Sample.

    Yes, that is true. If you look at the main.c file of the peripheral_lbs sample, you can see that CONFIG_BT_LBS_SECURITY_ENABLED is defined. This configuration changes the authentication mechanism when enabled. However, this authentication is only for the normal LBS connection. If you enable CONFIG_MCUMGR_TRANSPORT_BT_PERM_RW_AUTHEN, DFU will require authentication before allowing firmware updates.

    For passkey display, auth_passkey_display() is used. Also, see the authentication callback.

    Kind Regards,

    Abhijith

  • Hi Abhijith,

    By porting the authentication mechanism from the Peripheral LBS Sample, I was able to confirm that authentication is required before DFU in other samples as well.
    I will try other authentication mechanisms as well.

    Thank you for your support.

    Kind regards,

    a.da

Reply Children
No Data
Related