BLE service discovery behaviours are different on two central devices via "nRF Connect APP"

Hi Support team,

I met a strange problem on my IoT device, which provided a BLE service.

One month ago, I could use nRF_Connect_APP with my mobile phone(phone_A) to find the service and read/write data.
But I can't find the service now, the Bluetooth connection is successful, but it always returns the "No services found".

I used nRF_Connect_APP on another old mobile phone (phone_B), and the service can be discovered successfully.

The firmware on the IoT device is the same.
I caught the two logs with debug level on nRF_Connect_APP and attached them here, could you help me have a look, maybe it need some settings on the nRF_Connect_APP?

Thank you very much

Best regards,
Yanpeng Wu

nRF Connect, 2025-02-04
BDS_IOTDL (D4:42:28:03:50:D8)
D	10:35:17.204	gatt.close()
D	10:35:17.208	wait(200)
V	10:35:17.412	Connecting to D4:42:28:03:50:D8...
D	10:35:17.412	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	10:35:17.518	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	10:35:17.518	Connected to D4:42:28:03:50:D8
V	10:35:17.522	Discovering services...
D	10:35:17.522	gatt.discoverServices()
D	10:35:17.537	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I	10:35:17.869	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D	10:35:17.907	[Callback] Services discovered with status: 0
I	10:35:17.907	Services discovered
V	10:35:17.907	No services found 
I	10:35:17.951	PHY updated (TX: LE 2M, RX: LE 2M)
I	10:35:18.049	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 5000ms)
I	10:35:22.825	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 420ms)
V	10:35:27.412	Disconnecting...
D	10:35:27.412	gatt.disconnect()
D	10:35:27.432	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I	10:35:27.432	Disconnected
D	10:35:28.547	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
V	10:35:29.557	Starting pairing...
D	10:35:29.557	device.createBond()
D	10:35:29.593	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDING (11)
D	10:35:29.778	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D	10:35:29.778	gatt.close()
D	10:35:29.779	wait(200)
V	10:35:29.980	Connecting to D4:42:28:03:50:D8...
D	10:35:29.980	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	10:35:29.995	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	10:35:29.995	Connected to D4:42:28:03:50:D8
D	10:35:30.153	[Broadcast] Action received: android.bluetooth.device.extra.PAIRING_VARIANT, pairing variant: PASSKEY CONFIRMATION, key: 144255
I	10:35:30.256	PHY updated (TX: LE 2M, RX: LE 2M)
I	10:35:30.556	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
I	10:35:30.650	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 5000ms)
I	10:35:34.797	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
I	10:35:34.880	Connection parameters updated (interval: 30.0ms, latency: 0, timeout: 420ms)
D	10:35:37.570	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BONDED (12)
I	10:35:37.571	Device bonded
D	10:35:37.573	wait(1600ms)
V	10:35:39.175	Discovering services...
D	10:35:39.175	gatt.discoverServices()
D	10:35:39.184	[Callback] Services discovered with status: 0
I	10:35:39.184	Services discovered
V	10:35:39.184	No services found 
nRF Connect, 2025-02-04
BDS_IOTDL (D4:42:28:03:50:D8)
D	10:30:29.550	gatt.close()
D	10:30:29.556	wait(200)
V	10:30:29.761	Connecting to D4:42:28:03:50:D8...
D	10:30:29.761	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	10:30:30.017	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	10:30:30.017	Connected to D4:42:28:03:50:D8
V	10:30:30.055	Discovering services...
D	10:30:30.055	gatt.discoverServices()
D	10:30:30.057	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I	10:30:30.529	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D	10:30:30.723	[Callback] Services discovered with status: 0
I	10:30:30.723	Services discovered
V	10:30:30.776	Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
- Client Supported Features [R W] (0x2B29)
- Database Hash [R] (0x2B2A)
Generic Access (0x1800)
- Device Name [R] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Provision (00001543-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001544-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001545-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001546-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001547-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001548-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001549-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001550-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001551-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001552-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001553-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001554-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001566-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001567-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001568-1212-efde-1523-785feabcd123)
- Unknown Characteristic [W] (00001569-1212-efde-1523-785feabcd123)
- Unknown Characteristic [I R] (00001570-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
D	10:30:30.776	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D	10:30:30.780	gatt.setCharacteristicNotification(00001570-1212-efde-1523-785feabcd123, true)
I	10:30:30.799	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
I	10:30:35.278	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 420ms)

Parents Reply Children
  • Hi Simonr,

    It's a nRF5340 custom board and the problem is fixed now. The BLE on our custom board is used for the system provision, which allows boned central to configure it only.


    what I changed to fix this problem is:
    1. Disable the settings for BLE and force the central device to bond for every connection request.

            CONFIG_BT_SETTINGS=n


    2. Set the Security with Mode 1 Level 4, and ensure the central device bond with Passkey Confirmation(Numeric Comparison):

            CONFIG_BT_SMP=y
            CONFIG_BT_BONDABLE=y
            CONFIG_BT_PRIVACY=y
            CONFIG_BT_SMP_SC_ONLY=y
            CONFIG_BT_SMP_APP_PAIRING_ACCEPT=y
            CONFIG_BT_SMP_ENFORCE_MITM=y

    And in the on_connected_cb, set bt_conn_set_security(conn, BT_SECURITY_L4 | BT_SECURITY_FORCE_PAIR).

    After these changes, Both phones bonded with the target and discovered the services successfully. A little difference is one phone discovers the services automatically after a secure connection, and the other phone needs to discover manually (click Discover Services in the nrf connect for mobile APP ). Both read/write via BLE are successful.

    Now I use the APP "nrf connect for mobile" to configure my device, I need to develop a Windows-based dialog program for this purpose. Could you help give some suggestions for this? (1) Need I use a Nordic dongle on my laptop? I found my laptop can scan and find the target, but can not connect it stable (short connected then disconnected for an unknow reason). (2) For the Windows dialog program, are there any open sources or tools I can base on to develop it quickly? Thank you very much.

    Best regards,
    Yanpeng Wu

Related