Errors when connecting or streaming

I have realized that when I connect, sometimes I get the following errors:

RuntimeError: Channel or attrib not ready

or

RuntimeError: Error initializing the API (16)

However, I am able to connect from Android MetaWear app. Even more, after experimenting a little bit, if in the Android MetaWear app I stream from acc/gyro/sensor fusion (the kind of data that I get from my python app), and then disconnect. I am able again to connect from python app. So it seems that the Android app does something that I am missing.
I even checked out your fork of pygattlib and I am using that version now.

The other problem is that, sometimes, I subscribe to a data stream (acc/gyro or sensor fusion) but I receive no data. Then I disconnect/reconnect again and voila, there is data again.

Comments

  • I run into the same connect errors on occasion as well and they seem completely random.  It could be something with gattlib as that code has not been updated in years or even at the BlueZ level.

    I also encounter connection issues on the JavaScript side but those occur less frequently.  Noble has been a pretty solid BLE library from my experiences, far better than the available Python ones.
This discussion has been closed.