-
Notifications
You must be signed in to change notification settings - Fork 36
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
Scanning just stops working suddenly without any reason. #95
Comments
I experienced the same random hanging, did some debugging and managed to find out that the culprit was PyGATT. The good thing is someone apparently fixed the issue: peplin/pygatt#291 Unfortunately, the commit peplin/pygatt@16e15db has not been pushed yet so the latest release doesn't include it. The workaround is to apply the commit manually to the file pygatt/backends/gatttool/gatttool.py |
Hmm, last activity on that commit in Aug 2020. Anything that can be done to help pushing this to latest release? |
The owner is looking for a new maintainer (see peplin/pygatt#229). |
It was still hanging so I went the hard way: Amend BS440.py
Create a small script
Set up cron job as root
The file lastscan.ts should be touched every 10 seconds. The cron job is called every minute and will restart the BS440 service if the lastscan.ts has not been touched for more than a minute. Now let's rock 🤘 |
I picked this up again. Updated the 440 library because some movement happend on github here. Hope this will fix the issue now together with your input. I'll let you know! |
I again had to solve 2 other issues that caused the service to stop. First is probably some system updates which did reset the capabilities set for Second, I found out that time to time my Bluetooth adapter and HDD ( 😱 ) would fail because of some Autosuspend USB devices feature. Disabling the feature solved the problem.
|
Hi there,
There seems to be something odd here. Running the script, after a while (sometimes 30 minutes, sometimes 90 minutes, or anything between), the scan stopped working. It just stops.
E.g. output from the log:
`Tue, 12 Jan 2021 13:59:32 INFO Configured plugins: BS440influxdb
Tue, 12 Jan 2021 13:59:32 INFO Loading plugin: BS440influxdb
Tue, 12 Jan 2021 13:59:32 INFO init Initialising plugin: BS440influxdb
Tue, 12 Jan 2021 13:59:32 INFO init Read config from: /home/pi/BS440/plugins/BS440influxdb.ini
Tue, 12 Jan 2021 13:59:32 DEBUG init tags: person
Tue, 12 Jan 2021 13:59:32 INFO All plugins loaded.
Tue, 12 Jan 2021 13:59:32 INFO BS440 Started
Tue, 12 Jan 2021 13:59:33 INFO init_ble_mode hci0 Set Low Energy complete, settings: powered ssp br/edr le secure-conn
Tue, 12 Jan 2021 13:59:33 DEBUG start gatttool_cmd=gatttool -i hci0 -I
Tue, 12 Jan 2021 13:59:33 INFO scan Starting BLE scan
Tue, 12 Jan 2021 13:59:33 INFO run Running...
Tue, 12 Jan 2021 13:59:43 INFO scan Discovered XX:XX:XX:XX:XX:XX (None)
Tue, 12 Jan 2021 13:59:43 INFO scan Discovered XX:XX:XX:XX:XX:XX (None)
Tue, 12 Jan 2021 13:59:43 INFO scan Discovered XX:XX:XX:XX:XX:XX (None)
Tue, 12 Jan 2021 13:59:43 INFO scan Discovered XX:XX:XX:XX:XX:XX (None)
Tue, 12 Jan 2021 13:59:43 INFO scan Discovered XX:XX:XX:XX:XX:XX (None)
Tue, 12 Jan 2021 13:59:43 INFO scan Found 5 BLE devices
Tue, 12 Jan 2021 13:59:43 INFO scan Starting BLE scan
Tue, 12 Jan 2021 13:59:53 INFO scan Discovered XX:XX:XX:XX:XX:XX (None)`
.... last lines of log ...:
Tue, 12 Jan 2021 15:30:29 INFO scan Discovered XX:XX:XX:XX:XX:XX (None) Tue, 12 Jan 2021 15:30:29 INFO scan Discovered name of XX:XX:XX:XX:XX:XX as Charge 2 Tue, 12 Jan 2021 15:30:29 INFO scan Discovered XX:XX:XX:XX:XX:XX (None) Tue, 12 Jan 2021 15:30:29 INFO scan Discovered XX:XX:XX:XX:XX:XX (None) Tue, 12 Jan 2021 15:30:29 INFO scan Found 6 BLE devices
and that's it. Even
python BS440.py >bs440.out 2>bs440.err
does not output anything. Syslogs and other logs either. Tried several things, rebooting, apt-get upgrade everything, nothing.
I'm running Linux raspberrypi 5.4.83-v7+ with Python 2.7.16
The text was updated successfully, but these errors were encountered: