Nordic BLE central trying to connect to 3rd party sensor - getting 0x3b error

Hello, 

I am on conenct SDK 2.6.0 and trying to run the Zephyr Bluetooth:Central example on the nrf5340 dk to connect to a Minew S4 door sensor and get data from it. Here is the code, central - Copy.zip

I have modified the sample code to setup connection parameters and to handle connection callbacks. Here is my output: 

As you can see, disconnect happens right after connection. The error code 0x3b does not help. Here is the wireshark output: ble_sniffer_nrdic.pcapng.


I tried looking up documentation on these sensors but they are not available from the manufacturer.  

Thanks in advance for any support on this. 

Best, 

Sid

Parents
  • Hello Sid,

    You can find the disconnect reasons in hci_types.h (ncs\zephyr\include\zephyr\bluetooth\hci_types.h).

    #define BT_HCI_ERR_UNACCEPT_CONN_PARAM          0x3b

    So it claims that it doesn't like the connection parameters. 

    What I find strange is that it doesn't request a connection parameter update either. It just disconnects after exactly 4 seconds. 

    In a BLE connection, it is always the central that has the final saying in connection parameters (connection interval, supervision timeout and latency). However, the peripheral can request connection parameter updates with specific connection parameters. If the central doesn't give the connection the connection parameters that it wanted, the peripheral can choose to just accept whatever connection parameters that is provided by the central, or it can choose to disconnect. 

    The thing that is a bit strange here is that the peripheral doesn't request a connection parameter update, and still it disconnects with "BT_HCI_ERR_UNACCEPT_CONN_PARAM". So either they only want to connect to a device that knows what parameters they want, or it is something else that they want (some proprietary check), and they just claim that it is disconnecting due to unacceptable connection parameters. 

    Do you have anything that is able to connect to the device? A mobile phone using a certain app? A hub of some sort? If so, you can try to capture a sniffer trace of that connection, and then use that to see what kind of connection parameters it will accept. If it still doesn't work, is there something else going on once the devices connect? We do see from time to time that someone wants their devices only to be connectable from their own mobile app, for instance. One way to do this (kind of, at least), is to send some message directly after connecting. If that packet is not received within e.g. 4 seconds, disconnect from the central. Do you see any other messages when connecting from your phone? Use the sniffer trace of a working connection to see if you can "mimic" that connection.

    Best regards,

    Edvin

  • Thank you Edvin. 

    My apologies with the delay in replying. But your suggestions worked out great. We communicated with the company to get their app up and running with the sensors. We then sniffed the packets and replicated them with nordic chips. And it works! 

    Thanks again for the suggestion above.

    Regards

    Sid

Reply Children
No Data
Related