I am trying to maintain consistent connectivity with the sensor and connect to it as fast as possible when it is in the range. However, sometimes the sensor takes much longer to connect as it has trouble discovering the services or the characteristics. I call device.connect() continuously from python (with ~1s breaks in between), I receive the Connected message, but immediately after that I get one of the following errors:
mbientlab.warble.WarbleException: Failed to discover gatt services (status = 1)
mbientlab.warble.WarbleException: Failed to discover gatt characteristics (status = 1)
This loop can continue for minutes!
I am using the latest combination of warble/PyWarble/Python SDK (I compiled the latest HEAD of warble). Meanwhile from a similar distance I easily connect to the sensor through the iOS app.
Do you have any idea how to make the behavior more reliable? I can play with the c++ code and try to understand what exactly causes this error or I can run some experiments if you have any advice.