derkalle4 / python3-idotmatrix-client

reverse engineered python3 client to control all your 16x16 or 32x32 pixel displays (experimental)
GNU General Public License v3.0
199 stars 40 forks source link

Timeout when running command #36

Closed Duberry closed 5 months ago

Duberry commented 5 months ago

I'm getting a timeout when connecting to a device. The device is found by the --scan with the correct device id.

Ubuntu 22.04.4 LTS

Traceback (most recent call last):
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 214, in connect
    reply = await self._bus.call(
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 385, in call
    await future
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dan/python3-idotmatrix-client/./app.py", line 48, in <module>
    main()
  File "/home/dan/python3-idotmatrix-client/./app.py", line 40, in main
    asyncio.run(cmd.run(args))
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/dan/python3-idotmatrix-client/core/cmd.py", line 250, in run
    await self.conn.connectBySearch()
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/idotmatrix/connectionManager.py", line 57, in connectBySearch
    await self.connect()
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/idotmatrix/connectionManager.py", line 66, in connect
    await self.client.connect()
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/bleak/__init__.py", line 615, in connect
    return await self._backend.connect(**kwargs)
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 151, in connect
    async with async_timeout(timeout):
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/home/dan/python3-idotmatrix-client/venv/lib/python3.10/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Any ideas?

Duberry commented 5 months ago

I'll add a somewhat embarrassed solution to this, the display was simply out of range. This was surprising, because by 'out of range' it was only about 2m away from the Bluetooth transmitter, but presumably the one attached to my intel PCI card doesn't have a great antenna!

Anyway, if you find this issue, try moving the display closer to the PC, even if it seems pretty close already!

derkalle4 commented 5 months ago

Haha, okay. Thanks for clarification. Seems the bluetooth receiver itself is really bad. Either from the device or your PC. I should add a better error handling in that case. Thats not very friendly for users.