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

Do you have the "client.py" to send 0xF to "server.py" #66

Closed
WouterJD opened this issue Jan 18, 2022 · 1 comment
Closed

Do you have the "client.py" to send 0xF to "server.py" #66

WouterJD opened this issue Jan 18, 2022 · 1 comment

Comments

@WouterJD
Copy link
Contributor

WouterJD commented Jan 18, 2022

Describe the solution you'd like
Server.py awaits a client to write 0xF to the advertised characteristic.

Describe alternatives you've considered
It would be nice to have the client.py.

Additional context
server.py is running and discovered by bleak/discover.py; but when further exploring using service-explorer.py a timeout occurs.
Having both ends of the communication would be nice to understand whether the setup is OK or something else is wrong.

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
DEBUG:__main__:51ff12bb-3ed8-46e5-b4f9-d64e2fec021b:
DEBUG:__main__:Start
DEBUG:__main__:Advertising
INFO:__main__:Write '0xF' to the advertised characteristic: 51FF12BB-3ED8-46E5-B4F9-D64E2FEC021B

service_explorer.py
ADDRESS=4C:E9:D8:75:87:28 (which is dynamically found using the discovery-algorithm of discover.py)

Timeout occurs at:
async with BleakClient(address) as client:

Traceback (most recent call last):
  File "Z:\Github\hbldh\bleak\examples\service_explorer.py", line 94, in <module>
    asyncio.run(main(ADDRESS))
  File "C:\Users\Wouter Dubbeldam\AppData\Local\Programs\Python\Python38\lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  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\hbldh\bleak\examples\service_explorer.py", line 48, in main
    async with BleakClient(address) as client:
  File "C:\Users\Wouter Dubbeldam\AppData\Local\Programs\Python\Python38\lib\site-packages\bleak\backends\client.py", line 61, in __aenter__
    await self.connect()
  File "C:\Users\Wouter Dubbeldam\AppData\Local\Programs\Python\Python38\lib\site-packages\bleak\backends\winrt\client.py", line 267, in connect
    await asyncio.wait_for(event.wait(), timeout=timeout)
  File "C:\Users\Wouter Dubbeldam\AppData\Local\Programs\Python\Python38\lib\asyncio\tasks.py", line 490, in wait_for
    raise exceptions.TimeoutError()
asyncio.exceptions.TimeoutError
@WouterJD
Copy link
Contributor Author

If #72 is solved, this issue is obsolete.

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

No branches or pull requests

1 participant