On one device the bluetooth works perfectly fine, but on the other I'm unable to connect over bluetooth and I see the following errors in the logs ( -170 = SYSTEM_ERROR_NOT_FOUND):
What is strange is that the bluetooth used to work fine on both devices and rolling back to previous version of my code from before the occurrence of the error now also generate this error.
It appears that Channel error occurs only in one place in Device OS:
This is handling a connection attempt on the BLE setup service. It would appear that something is attempting to establish a BLE setup session. It's possible that whatever is connecting is also disconnecting, possibly before the handshake completes. That matches the screenshot of the Android log, which seems to indicate connection followed by immediate disconnection.
I'd try increasing the log level to LOG_LEVEL_TRACE as there are other debugging messages in the setup control request handler.
Blockquote
It's possible that whatever is connecting is also disconnecting, possibly before the handshake completes. hat matches the screenshot of the Android log, which seems to indicate connection followed by immediate disconnection.
Are you shure? Because the android log say the connection is terminated by the peer:
Connection terminated by peer (status code 19)
I created this minimalistic code that generates the error.
Before uploading the code I do a factory reset of the board, then I do a setup with the browser. At this moment the device broadcast BLE under the name Boron_XXXX and I'm able to connect to it. Then I flash my code and I'm unable to connect to the BLE anymore on two of our 4 board (I tested it on more boards).
Did you ever get to the bottom of this? I just came across this behavior today.
My custom phone app, Lightblue and NRF immediately disconnect.
The biggest issue here is that the particle device is still returning true for BLE.connected(), even though it has not successfully connected to my phone. I have tried different phones, and I will also try a different B5SOM.
CONTEXT:
Running firmware 5.6.0, will test older firmwares.
Nrf app is also saying that the peer is disconnecting
I have just tested with a new B5SOM and the issue is no longer there, it works perfectly using the same firmware.
My concern here is that first SOM was working correctly and then it suddenly started showing this behavior. And the fact that once it exhibits this behavior the particle device thinks it is connected via bluetooth. This means that our devices can get stuck in Bluetooth mode. I could add a timer to disconnect bluetooth after x amount of minutes, to restore normal operation to our device, but then bluetooth will just no longer work until a new SOM has been installed.
@cedric you have seen this problem on two devices yeah? If you don't mind me asking how many devices have you been using?
Can anyone from particle let me know if other customers have reported a similar bluetooth failure?
We have it on 2 out of 8 devices. It happened to the 2 devices at the same time, so I guess it is probably a combination of firmware and some other circumstance.