Weird device disconnection behavior #1444
Unanswered
vboginskey
asked this question in
Q&A
Replies: 1 comment
-
It is hard to say without seeing the full program and the full logs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a program that connects to several lithium batteries, polls them for data, and sends the data to InfluxDB. After running for a day or so, it just stops printing output or sending data. In the logs, I see that one device disconnects first, so my next step is to handle this with a disconnection callback.
My question is: shouldn't the program throw an exception or stop running? It just sits there waiting forever:
Here is the relevant code:
The really strange thing (to me, at least) is that
battery.report_successes()
also stops printing output. If all the tasks were cancelled, then surely the program would exit, so that tells me one of the tasks is waiting indefinitely for something and hanging the event loop.This is what I see in the logs:
I searched discussions and issues and reviewed #1216, https://github.com/hbldh/bleak/blob/develop/examples/disconnect_callback.py, and #933 among others, but wasn't able to answer this question.
Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions