This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why am I seeing an "immediate" disconnect?

I’m attempting to use an nRF51 dongle with connectivity_115k2_with_s130_1.0.0.hex burned on to it. I’m using the dongle as a central, attempting to connect to a peripheral. Upon connect, I’m seeing an almost immediate disconnect. In the same environment using different centrals (BlueZ HCI-base, and an iPhone), I'm able to connect to the peripheral with no problem.

Here are some traces. You’ll notice that the disconnect code is 62 (0x3e).

debian@beaglebone:~/ttm$ ./main.py 
Log: Successfully opened uart. Port name: /dev/ttyACM0. Baud rate: 115200. Flow control: none. Parity: none
Log: [Write] 0xC0
Log: [Write] 0x00
Log: [Write] 0x2F
Log: [Write] 0x00
Log: [Write] 0xD1
Log: [Write] 0x01
Log: [Write] 0x7E
Log: [Write] 0xC0
Log: [Read] 0xC0 0x00 0x2F 0x00 0xD1
Log: [Read] 0x02 0x7D 0xC0
Log: [Read] 0xC0 0x00 0x2F 0x00 0xD1 0x01
Log: [Read] 0x7E 0xC0
Log: [Write] 0xC0
Log: [Write] 0x00 0x2F 0x00 0xD1 0x02 0x7D 0xC0
Log: [Read] 0xC0 0x00 0x3F 0x00 0xC1 0x03 0xFC
Log: [Read] 0x11 0xC0
Log: [Write] 0xC0
Log: [Write] 0x00 0x3F 0x00 0xC1 0x04 0x7B 0x11 0xC0
Log: [Write] 0xC0
Log: [Write] 0x00
Log: [Write] 0x3F
Log: [Write] 0x00
Log: [Write] 0xC1
Log: [Write] 0x03
Log: [Write] 0xFC
Log: [Write] 0x11
Log: [Write] 0xC0
Log: [Read] 0xC0 0x00 0x3F 0x00 0xC1 0x04
Log: [Read] 0x7B 0x11 0xC0
Log: [Write] 0xC0
Log: [Write] 0xDB 0xDC 0x3E 0x00 0x02 0x00 0x66 0x01 0x31 0x74 0xC0
Log: [Read] 0xC0 0x08 0x00 0x00 0xF8 0xC0
Log: [Read] 0xC0 0xC8 0xBE 0x00
Log: [Read] 0x7A 0x01 0x66 0x00 0x00 0x00 0x00 0x08 0x59 0x00
Log: [Read] 0x67 0x00 0x18 0x94 0xC0
Log: [Write] 0xC0
Log: [Write] 0x08 0x00 0x00 0xF8 0xC0 0xC0 0xC9 0x8E 0x00 0xA9 0x00 0x60 0x01 0x00 0x00 0x00 0x00 0x00 0x3D 0x1D 0xC0
Log: [Read] 0xC0 0x10 0x00 0x00 0xF0
Log: [Read] 0xC0 0xC0 0xD1 0x6E
Log: [Read] 0x00 0xC1 0x01 0x60 0x08 0x00 0x00 0x00 0x5D 0x10
Log: [Read] 0xC0
Log: [Write] 0xC0
Log: [Write] 0x10 0x00 0x00 0xF0 0xC0 0xC0 0xD2 0x8E 0x00 0xA0 0x00 0x68 0x25 0x00 0x00 0x00 0x01 0x01 0x92 0x75 0xC0
Log: [Read] 0xC0 0x18 0x00 0x00 0xE8 0xC0
Log: [Read] 0xC0 0xDA 0x6E 0x00 0xB8 0x01
Log: [Read] 0x68 0x00 0x00 0x00 0x00 0x9A 0xC3 0xC0
Log: [Write] 0xC0
Log: [Write] 0x18 0x00 0x00 0xE8 0xC0 0xC0 0xDB 0xDD 0xCE 0x01 0x56 0x00 0x88 0x01 0x00 0xB6 0xCB 0x1D 0x86 0x02 0x34 0x01 0x01 0x00 0x40 0x01 0xF0 0x00 0x05 0x00 0x01 0x28 0x00 0x50 0x00 0x00 0x00 0x2A 0x00 0xD2 0x17 0xC0
Log: [Read] 0xC0 0x20 0x00 0x00 0xE0 0xC0
Log: [Read] 0xC0
Log: [Read] 0xE3 0x6E 0x00 0xAF 0x01 0x88 0x00 0x00 0x00
Log: [Read] 0x00 0x3C 0x5E 0xC0
Log: [Write] 0xC0
ble connect status = 0
Log: [Write] 0x20 0x00 0x00 0xE0 0xC0
Log: [Read] 0xC0 0xE4 0xDE 0x01 0x3D 0x02
Log: [Read] 0x10 0x00 0x00 0x00 0x00 0xB6 0xCB 0x1D 0x86 0x02
Log: [Read] 0x34 0x01 0x25 0x7F 0xDA 0x7A 0xEC 0xEA 0x02
Log: [Read] 0x00 0x50 0x00 0x50 0x00 0x00 0x00 0x2A 0x00 0x5B
Log: [Read] 0xE9 0xC0
Log: [Write] 0xC0
Got event id (16)
Log: [Write] 0x28 0x00 0x00 0xD8 0xC0
Connection Status = 1
connection added: {0L: <ble.connection instance at 0xb47cc3a0>}
Log: [Read] 0xC0
Log: [Read] 0xE5 0x6E 0x00 0xAD 0x02 0x11 0x00 0x00 0x00 0x3E 0xEB 0xDA 0xC0
Log: [Write] 0xC0
Log: [Write] 0x30 0x00 0x00 0xD0 0xC0
Got event id (17)
disconnect: 0
disconnect reason = 62
Connection Status = 0

I've tried setting compatibility mode. That makes no difference.

I'm also attaching Frontline sniffs of the interaction.

Any help would be appreciated.

Thanks.

NordicDisconnect.cfa

democapture.pcapng

democapture2.pcapng

democapture3.pcapng

testAtestB.pcapng

testA.pcapng

TestA-2.cfa

TestB-2.cfa

  • Hi Jimvert,

    Could you give us more information about the peripheral device ? Which chip, BLE stack running on it. Which nRF51 dongle are you using ?

    From the trace you provided, what I can find is that the peripheral didn't catch the connect request, or catched but ignored it (whitelist for example) and the central tried to send 6 connect event packet until it gave up. That's why you saw disconnection almost immediately.

  • The peripheral is based on the BGM111 chip running their latest Geko stack. The nRF51 is www.digikey.com/.../5022448. I'm running a custom profile there.

    On the peripheral side, I do see the connection come in at the application level, so the central is recognized. I have no security set on the peripheral. The disconnect code I see on the peripheral size is 0x023e, which is "Connection Failed to be Established".

    As I mentioned earlier, I see no problem connecting from an iPhone or BlueZ to this peripheral.

  • From the trace, I couldn't find any packet from the BGM111 (address 0x3402861dcbb6 ) back to the central captured by the sniffer. Actually I couldn't find any packet from the device with address 0x3402861dcbb6 and also any other advertising packet from any devices. This is strange.

    I would suggest you to capture another sniffer trace with the iPhone connect to the device, and then our device trying to connect to the device ( in one trace).

    Also please try with our sniffer, it could be more sensitive and can capture the advertising packets.

  • I updated the case with the capture. The nRF51-to-BGM connection takes place in the first 50-packets. This is followed by the iPhone connection. What's interesting is that during the nRF51 connection no traffic other than the advertising requests from the BGM are seen. The nRF51 is performing active scanning. Those don't even show up. Again, though, the application on both sides of the connection do get notifications of the connection.

  • I should point out that I don't perform an explicit scan using sd_ble_gap_scan_start() for the BGM prior to attempting a connection. That is, I know the public address of the BGM and attempt a direct connection with that address using sd_ble_gap_connect().

Related