Skip to content
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

Windows 10: KeyError: 'A07498CA-AD5B-474E-940D-16F1FBE7E8CD' in server.py #61

Closed
WouterJD opened this issue Jan 10, 2022 · 5 comments · Fixed by #62
Closed

Windows 10: KeyError: 'A07498CA-AD5B-474E-940D-16F1FBE7E8CD' in server.py #61

WouterJD opened this issue Jan 10, 2022 · 5 comments · Fixed by #62

Comments

@WouterJD
Copy link
Contributor

WouterJD commented Jan 10, 2022

The problem
KeyError: 'A07498CA-AD5B-474E-940D-16F1FBE7E8CD'

Reproduction
On windows 10: ..\examples\server.py

Expected behavior
I would like to get acquainted with bless and hence try to run server.py, expecting it would run.

Screenshots

Z:\Github\kevincar\bless\wd-StartUp>..\examples\server.py
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 "Z:\Github\kevincar\bless\examples\server.py", line 93, in <module>
    loop.run_until_complete(run(loop))
  File "C:\Users\Wouter Dubbeldam\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 612, in run_until_complete
    return future.result()
  File "Z:\Github\kevincar\bless\examples\server.py", line 67, in run
    await server.add_new_characteristic(
  File "C:\Users\Wouter Dubbeldam\AppData\Local\Programs\Python\Python38\lib\site-packages\bless\backends\winrt\server.py", line 196, in add_new_characteristic
    service: BlessGATTServiceWinRT = self.services[service_uuid]
KeyError: 'A07498CA-AD5B-474E-940D-16F1FBE7E8CD'

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
No additional information, using server.py out of the box.

My name is Wouter Dubbeldam from the Netherlands and I am delighted that there is a library to create BLE-servers; it might be a great addition to FortiusAnt.
Pointing me in the right direction would be really appreciated!

@WouterJD
Copy link
Contributor Author

Hmmmm...

Changing

    my_service_uuid = "A07498CA-AD5B-474E-940D-16F1FBE7E8CD"
    my_char_uuid = "51FF12BB-3ED8-46E5-B4F9-D64E2FEC021B"

into

    my_service_uuid = "a07498ca-ad5b-474e-940d-16f1fbe7e8cd"
    my_char_uuid = "51ff12bb-3ed8-46e5-b4f9-d64e2fec021b"

solves the problem....

(Not that examples\server.py now works, but that may be another issue)

@WouterJD
Copy link
Contributor Author

Perhaps def add_new_characteristic
should add service_uuid = str(UUID(service_uuid))

like def update_value does

@kevincar
Copy link
Owner

Thanks @WouterJD!

Feel free to make a pull request for this if this solves the issue, otherwise I’ll see if I can get to this soon.

@WouterJD
Copy link
Contributor Author

Will do.
Thanks for reaction, struggling on windows 10...

@WouterJD WouterJD reopened this Jan 11, 2022
@WouterJD WouterJD changed the title KeyError: 'A07498CA-AD5B-474E-940D-16F1FBE7E8CD' in server.py Windows 10: KeyError: 'A07498CA-AD5B-474E-940D-16F1FBE7E8CD' in server.py Jan 11, 2022
@kevincar kevincar linked a pull request Jan 13, 2022 that will close this issue
@kevincar
Copy link
Owner

closing this since it has been merged to the develop branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants