Closed Jackiii1989 closed 2 weeks ago
asyncio.run(main1()) asyncio.run(main2())
There should only be one asyncio.run()
per application. Otherwise things can break easily. Doesn't cause the problem you are seeing though.
Watcher status: <BluetoothLEAdvertisementWatcherStatus.ABORTED: 4>.
This indicates that there is something wrong with your Bluetooth adapter. E.g. it is disabled or something like that.
We should probably catch this and raise and exception instead of failing silently with no advertisements received.
So, yes, likely something related to Windows update or just have Bluetooth switch turned off. But there is some improvement we could make to Bleak to better help diagnose such issues.
Hey,
Thanks for the ideas on how to write it better. The problem seemed to be on the Windows side. Now it works again.
We should probably catch this and raise and exception instead of failing silently with no advertisements received.
For my side that would be helpful, or an error message then I can narrow down my problem next.
Cheers,
For my side that would be helpful, or an error message then I can narrow down my problem next.
Let's leave this one open to remind us to do that.
The problem seemed to be on the Windows side.
If the problem is reproducible, knowing how to reproduce it for testing would be helpful.
If the problem is reproducible, knowing how to reproduce it for testing would be helpful.
I do not know how to reproduce the problem. After the second Windows Update, the bug was gone.
Description
I used the bleak library yesterday and everything worked fine. I tried it again today and bleak does not find any BLE devices in the area, even though there are tons of BLE devices. I did a Windows update. Maybe that explains the problem. Am I doing something wrong? Thanks for the help.
bleak version: bleak 0.21.1 numpy 1.26.4 pip 23.2.1 winrt-runtime 2.0.0b1 winrt-Windows.Devices.Bluetooth 2.0.0b1 winrt-Windows.Devices.Bluetooth.Advertisement 2.0.0b1 winrt-Windows.Devices.Bluetooth.GenericAttributeProfile 2.0.0b1 winrt-Windows.Devices.Enumeration 2.0.0b1 winrt-Windows.Foundation 2.0.0b1 winrt-Windows.Foundation.Collections 2.0.0b1 winrt-Windows.Storage.Streams 2.0.0b1
Python version: Python 3.12.1
Operating System: OS Name: Microsoft Windows 11 Pro OS Version: 10.0.22631 N/A Build 22631
What I Did
Logs
This is what I see on Nordic's nRF Connect app: