bless icon indicating copy to clipboard operation
bless copied to clipboard

add_advertisment_status_changed error on Windows for example server

Open Rhynorater opened this issue 2 years ago • 5 comments

The problem When I run the server from the example, I get the below error:

PS C:\Users\Justin\Windows Scripts> python .\ble.py
C:\Users\Justin\Windows Scripts\ble.py:91: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
DEBUG:asyncio:Using proactor: IocpProactor
DEBUG:bless.backends.winrt.server:Creating a new service with uuid: A07498CA-AD5B-474E-940D-16F1FBE7E8CD
DEBUG:bless.backends.winrt.server:Adding service to server with uuid A07498CA-AD5B-474E-940D-16F1FBE7E8CD
Traceback (most recent call last):
  File "C:\Users\Justin\Windows Scripts\ble.py", line 92, in <module>
    loop.run_until_complete(run(loop))
  File "C:\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "C:\Users\Justin\Windows Scripts\ble.py", line 53, in run
    await server.add_new_service(my_service_uuid)
  File "C:\Python\Python310\lib\site-packages\bless-0.2.4-py3.10.egg\bless\backends\winrt\server.py", line 167, in add_new_service
  File "C:\Python\Python310\lib\site-packages\bless-0.2.4-py3.10.egg\bless\backends\winrt\service.py", line 53, in init
AttributeError: 'NoneType' object has no attribute 'add_advertisement_status_changed'

Reproduction Windows 11 Python 3.10.5 Run:

python -m pip install bless
python server.py

Expected behavior It would run successfully.

Rhynorater avatar Nov 28 '22 21:11 Rhynorater

I have the same problem, did anyone solve it? I would appreciate it :)

Laura-VFA avatar Sep 01 '23 09:09 Laura-VFA

@Laura-VFA Is this with the latest version too (v0.2.5)?

kevincar avatar Sep 02 '23 04:09 kevincar

Yes, I have the bless==0.2.5 version

Laura-VFA avatar Sep 04 '23 06:09 Laura-VFA

Same problem with bless==0.2.6 version 😞

Jnp95 avatar Aug 27 '24 10:08 Jnp95

My Solution :

Think to activate the Bluetooth on Windows :

Capture d'écran 2024-08-27 131223

And I suppose you need to be admin on your machine.

Jnp95 avatar Aug 27 '24 11:08 Jnp95