NUS bt_nus_send() returns -ENOTCONN (-128) after pairing with nRF Toolbox — client never subscribes to TX notifications (NCS v3.2.4)

Hi,

I am using the Nordic UART Service (NUS) on an nRF52840 with NCS. Without pairing enabled, NUS works perfectly with the nRF Toolbox UART service — both sending and receiving data works as expected. After adding pairing/bonding (Just Works) (CONFIG_BT_NUS_SECURITY_ENABLED), NUS stops working completely:

bt_nus_send() consistently returns -128 (-ENOTCONN) even after 5+ minutes of retries — the peripheral never sees the client subscribe to NUS TX characteristic notifications.
Messages sent from nRF Toolbox to the peripheral are also not being received.
My log shows:

[00:03:41.354,492] <inf> bluetooth: Connected
[00:03:44.490,722] <inf> bluetooth: Security changed: 60:B4:A2:2C:19:ED (public) level 2
[00:03:44.552,490] <inf> bluetooth: Pairing completed: 60:B4:A2:2C:19:ED (public), bonded: 1
[00:04:06.952,972] <dbg> nus: nus_send: No connected client, skipping NUS send
[00:04:06.953,033] <err> telemetry: Failed to send telemetry over NUS: -128
Pairing and bonding complete successfully, but NUS is completely non-functional in both directions after pairing.

My question:

Does nRF Toolbox subscribe to NUS TX notifications and perform GATT service discovery correctly after pairing/bonding completes, or is this a known limitation of the app? Is there something on the peripheral side that needs to be done differently when security is enabled?

Environment:

Hardware: nRF52840
NCS version: 3.2.4
nRF Toolbox version: 4.2.0
CONFIG_BT_SMP=y
CONFIG_BT_ID_UNPAIR_MATCHING_BONDS=y
CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
CONFIG_BT_SMP_SC_PAIR_ONLY=n
Any guidance would be appreciated. Thank you.

Parents
  • Hello,

    I believe you found the source of the issue. I do also believe this application hasn't been changed since the nRF5 SDK (the NUS part at least). I see that there are commits coming from 10 months ago, but those are mainly migration of libraries, and not functional changes. 

    Back in the nRF5 SDK, the NUS sample didn't have security, and this is probably why it is not taken into consideration in the nRF Toolbox app.

    I don't have read access to the issues for this repository, but I will let the mobile application group know about your issue report. 

    As a workaround, you could use the nRF Connect for Android (/iOS). It doesn't have a specific UI for the NUS Service, but it supports reading and writing for all services. 

    Best regards,

    Edvin

Reply
  • Hello,

    I believe you found the source of the issue. I do also believe this application hasn't been changed since the nRF5 SDK (the NUS part at least). I see that there are commits coming from 10 months ago, but those are mainly migration of libraries, and not functional changes. 

    Back in the nRF5 SDK, the NUS sample didn't have security, and this is probably why it is not taken into consideration in the nRF Toolbox app.

    I don't have read access to the issues for this repository, but I will let the mobile application group know about your issue report. 

    As a workaround, you could use the nRF Connect for Android (/iOS). It doesn't have a specific UI for the NUS Service, but it supports reading and writing for all services. 

    Best regards,

    Edvin

Children
No Data
Related