Open vliedel opened 3 years ago
Has it really failed to connect in the first example or did it immediately lose connection afterwards.
I think many of these issues relate to just crappy bluetooth hardware. We know that this is highly dependent on the usage of supported BLE hardware, like an external BLE dongle. Most laptops or raspi native bluetooth chips are just unreliable to use together with bluepy.
Additionally, there might be a version mismatch with the version of bluez on de host and the one that's bundled with bluepy.
Before handling the issues in code, maybe first check that to see if the problem is at a lower level.
I would like to remark that most of our current hardware is newer than the software that comes with bluepy. If you look at https://github.com/IanHarvey/bluepy you see that there is a version of bluez-5.47
which is 3 years old.
Hence, regarding the possible source of bugs it is in this order:
I've seen bug reports where bluepy-helper
became a zombie, however, I'm assuming here a simple bug. Just run with strace
and you'll probably find a mismatch in reporting connection state or something like that.
When calling
connect()
, it sometimes fails like:Often followed by some other error:
Here is a hackish way to see if the connect was successful: https://github.com/Kvanr23/CrownstoneTestSuite/blob/7ef388ecd7ab6ce0d58f13a6a4e4ae49e87f3677/Switching.py#L184