You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After restarting bluetoothd, the first scan doesn't discover any services. It appears that services aren't discovered until we try to connect, so the check in find_sensors for having at least one service advertised is wrong.
However, in this state the first attempt to connect almost always fails after some time.
If you first do a connect to the device from bluetoothctl and that succeeds, then connecting here succeeds quickly.
Trying again (but not too soon, if it timed out the first time, or it will fail with an error that it's still trying to connect) may succeed. It usually does for 7 of the sensors we have in the house. I'm not sure what's different about the others.
Ideas:
It would be better to start trying to connect to all sensors at the same time without blocking the rest while waiting for one to finish or time out, maybe retry once, and then finally use all the ones we managed to connect to. I tried to kind of make this happen with the API we have by connecting to each with a small timeout, waiting a bit, then trying again. I couldn't get this to work though.
blurz's BluetoothDevice also has a connect_profile which does something differently (and doesn't have a timeout), but I haven't yet figured out what it actually does or whether it is useful to us.
The text was updated successfully, but these errors were encountered:
Observations:
find_sensors
for having at least one service advertised is wrong.connect
to the device frombluetoothctl
and that succeeds, then connecting here succeeds quickly.Ideas:
It would be better to start trying to connect to all sensors at the same time without blocking the rest while waiting for one to finish or time out, maybe retry once, and then finally use all the ones we managed to connect to. I tried to kind of make this happen with the API we have by connecting to each with a small timeout, waiting a bit, then trying again. I couldn't get this to work though.
blurz's
BluetoothDevice
also has aconnect_profile
which does something differently (and doesn't have a timeout), but I haven't yet figured out what it actually does or whether it is useful to us.The text was updated successfully, but these errors were encountered: