Skip to content
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

monitor stopped performing scans, bluetoothctl error #312

Open
airdrummingfool opened this issue Apr 14, 2020 · 8 comments
Open

monitor stopped performing scans, bluetoothctl error #312

airdrummingfool opened this issue Apr 14, 2020 · 8 comments

Comments

@airdrummingfool
Copy link
Contributor

I'm creating this issue mostly to document a problem I found, in case it happens to someone else.

I noticed after a long period (weeks) of uptime, at some point after a restart of HA and monitor (using an MQTT message to monitor/scan/restart), monitor stopped actually scanning and finding my devices.

monitor continued to respond to MQTT messages such as restart and status, but any time a scan was requested, nothing would be posted back to MQTT - no confidence report messages or anything indicating that the scan happened.

The only log entry that I could find that seemed relevant was a message from bluetoothctl regarding a source not found. The presence of this message during monitor's startup seemed to correlate with monitor not working.

bluetoothctl[2406]: Source ID 20 was not found when attempting to remove it

Restarting monitor (using monitor/scan/restart) did not fix things, nor did anything else I tried short of a full reboot of my Raspberry Pi.

It would be cool if there was a way to trigger a full reboot of the host device that monitor was running on via MQTT, for times where something like this happens. However, this might not be a realistic request: host devices/monitor setups vary considerably, and a simple sudo reboot might not always work.

@jlo88
Copy link

jlo88 commented Apr 23, 2020

I have the same thing, the log shows the following:
Apr 23 07:00:07 monitor bluetoothctl[8448]: Source ID 20 was not found when attempting to remove it

Running sudo bash monitor.sh shows:
(bluetoothctl:15427): GLib-CRITICAL **: Source ID 20 was not found when attempting to remove it

Tried to use this: https://github.com/gadric/monitor/tree/dev-python-bluez because of #295
This worked yesterday but gives me the same result today. Maybe @gadric can assist?

@gadric
Copy link

gadric commented Apr 23, 2020

Did you connected your phones via monitor.sh -c <> for rssi?

@airdrummingfool
Copy link
Contributor Author

No, I have not connected any device with monitor.

@gadric
Copy link

gadric commented Apr 23, 2020

Please try to connect first. I did not modify the script to always measure rssi.

@airdrummingfool
Copy link
Contributor Author

@gadric my apologies, perhaps your question was not for me - I am not using your fork, just the vanilla monitor script. I am not looking for RSSI measurements.

@airdrummingfool
Copy link
Contributor Author

Update on this issue: my monitor instance became unavailable today. I did a simple sudo service monitor restart on the Pi, and received a similar bluetoothctl[]: Source ID x was not found when attempting to remove it error as the monitor process restarted. However, monitor successfully pinged my phone and reported me as 'home', and then successfully reported me as 'away' and back to 'home' in further testing. It would seem that receiving a "source ID" error does not guarantee that there will be a problem with monitor.

@michaelblight
Copy link

FWIW I have multiple instances of monitor running, two on 0.2.197 and one on 0.2.200. Only the latest version gets the bluetoothctl error, but it seems to work regardless.

@andrewjfreyer
Copy link
Owner

@michaelblight helpful feedback. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants