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

Issues with nDK52840 Bluetooth Connections and Error Messages

I'm currently in the prototyping phase of getting two nDK52840 boards talking to each other. I currently have one board flashed with the central role, and another board flashed with the peripheral role through the provided samples from Zephyr.

I can connect to the peripheral board just fine with my phone through the nRF Connect - the connection between my phone and the peripheral (which I monitor through PuTTY) never drops, even when I back away to fairly far distances. 

When I try and have the central and peripheral boards connect to each other, the connection seems to connect and disconnect very rapidly between the two boards. In the testing readme, it states that the central will scan for devices, and then connect to the device with the strongest signal. In order to eliminate any variability from that feature, I simply hard-coded in a MAC for the peripheral, and I hard coded the scan for the central to only connect to that MAC. However, this did not fix the issue, as the issue persisted before I even made these changes. 

My questions are this:

1.) Where can I find the documentation for the disconnect reasons? I have searched through both the Zephyr Bluetooth API documentation and the Nordic Infocenter's bluetooth documentation and I cannot seem to find what these error codes mean.

2.) What can I do to fix this connectivity issue?

Here is the serial monitor output from the central: 

Connected: 4a:4f:78:c5:fc:50 (random)
Disconnected: 4a:4f:78:c5:fc:50 (random) (reason 22)
Device found: 84:eb:18:2d:39:f9 (public) (RSSI -81)
Device found: 5d:e3:61:21:84:b8 (random) (RSSI -74)
Device found: 4a:4f:78:c5:fc:50 (random) (RSSI -14)
Connected: 4a:4f:78:c5:fc:50 (random)
Disconnected: 4a:4f:78:c5:fc:50 (random) (reason 22)
Device found: 5d:e3:61:21:84:b8 (random) (RSSI -76)
Device found: 4a:4f:78:c5:fc:50 (random) (RSSI -14)
Connected: 4a:4f:78:c5:fc:50 (random)
Disconnected: 4a:4f:78:c5:fc:50 (random) (reason 22)
Device found: 5d:e3:61:21:84:b8 (random) (RSSI -70)

And here is the serial output from the peripheral: 

Advertising successfully started
Connected
Disconnected (reason 19)
Connected
Disconnected (reason 19)
Connected
Disconnected (reason 19)
Connected
Disconnected (reason 19)
Connected
Disconnected (reason 19)

Related