-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runs for X minutes and then dies contd... (bluetooth stack instability?) #14
Comments
I think next steps are to try a newer version of Again, this doesn't happen initially for a while but only starts to happen after enough successive sensor reads. It seems there is a bit of chance or some condition that must be hit for the bug to appear. For comparison, a
|
Any updates on this issue @trinitronx ? I have been running into the same issue with multiple devices (AirThings stops connecting to the RPi). I am able to collect data for ~7 days at a 5-minute ping before losing connection with what looks like no hope to re-establish communication (has been two weeks since I have gotten any data). Just thought I would check-in and see if you had re-visited this issue. I have some things I can check in the meantime: |
I believe the issue described in #4 is still happening as of latest
Raspbian GNU/Linux 9 (stretch)
+ bluetooth stack components:Based on my experiences and experimentation, it appears that the issue is in the underlying code powering this script either
bluepy
,bluez
, broadcom drivers, or some combination? Some searching online shows many others are having similar Bluetooth stack instability on Raspbian.I've been trying to get this code running as a long-term solution for reading and sending metrics to Graphite. I should note that so far I've been prevented from running the script as-is on Python 2.7 because I was unable to install
bluepy
viapip
package. However, I was able to get the Python3 version from piwheels so I could move forward just converting all theprint
statements in this script to use parenthesesprint()
.After testing out the script on the host, I found that I had to add kernel capabilities to the
bluepy_helper
binary. This binary is installed as part ofbluepy
and must have been why the Python 2.7 version frompip
could not install a wheel or compile on the Raspberry Pi.After running the script for a while, I've seen various ways in which it fails or eventually hangs. This always seems to happen after some varying period of time. I've tried also adding a SystemD unit which is supposed to restart the process and reset the
hci0
device, yet eventually each time the code hangs. I'm collecting the various exceptions in logs to see how to handle them.SystemD Unit:
Error examples &
strace
debugging:I tried getting an
strace
after finding thatbluepy-helper
had hung:The text was updated successfully, but these errors were encountered: