-
Notifications
You must be signed in to change notification settings - Fork 294
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
BleakScannerWinRT import fails in Jupyter Notebook - [WinError -2147417850] Cannot change thread mode after it is set #698
Comments
Hmm... now that we have our own |
I ran into this trying to debug from VS Code. It is a shame if such a basic and not at all uncommon operation produces an error. I am way too uninitiated in why it is needed to say what the default should be, but in general I think Bleak should aim for making things as non-problematic for the non-experts as possible. |
This removes the explicit apartment initialization that breaks apps that have already initialized a single threaded apartment. Fixes: #698
Added ----- * Added ``service_uuids`` kwarg to ``BleakScanner``. This can be used to work around issue of scanning not working on macOS 12. Fixes #230. Works around #635. * Added UUIDs for LEGO Powered Up Smart Hubs. Changed ------- * Changed WinRT backend to use GATT session status instead of actual device connection status. * Changed handling of scan response data on WinRT backend. Advertising data and scan response data is now combined in callbacks like other platforms. * Updated ``bleak-winrt`` dependency to v1.1.0. Fixes #698. Fixed ----- * Fixed ``InvalidStateError`` in CoreBluetooth backend when read and notification of the same characteristic are used. Fixes #675. * Fixed reading a characteristic on CoreBluetooth backend also triggers notification callback. * Fixed in Linux, scanner callback not setting metadata parameters. Merged #715.
Added ----- * Added ``service_uuids`` kwarg to ``BleakScanner``. This can be used to work around issue of scanning not working on macOS 12. Fixes #230. Works around #635. * Added UUIDs for LEGO Powered Up Smart Hubs. Changed ------- * Changed WinRT backend to use GATT session status instead of actual device connection status. * Changed handling of scan response data on WinRT backend. Advertising data and scan response data is now combined in callbacks like other platforms. * Updated ``bleak-winrt`` dependency to v1.1.0. Fixes #698. Fixed ----- * Fixed ``InvalidStateError`` in CoreBluetooth backend when read and notification of the same characteristic are used. Fixes #675. * Fixed reading a characteristic on CoreBluetooth backend also triggers notification callback. * Fixed in Linux, scanner callback not setting metadata parameters. Merged #715.
bluetoothctl -v
) in case of Linux: N/ADescription
Hi,
New to bleak. I encountered
[WinError -2147417850] Cannot change thread mode after it is set
when I attempted to import the scanner with the following:After some googling, it appears to be a known issue trying to initialize
winrt
with MTA in Jupyter Notebook. I was able to avoid the error by:Is this the right approach? I seemed to be able to scan and discover my BLE device; I am still getting familiar with this library to read the characteristics so I am not sure if I would run into any problems down the road.
The text was updated successfully, but these errors were encountered: