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

Bluetooth discovery sometimes errors out #31

Open
retrodaredevil opened this issue Jan 5, 2023 · 0 comments
Open

Bluetooth discovery sometimes errors out #31

retrodaredevil opened this issue Jan 5, 2023 · 0 comments

Comments

@retrodaredevil
Copy link

I'm running this on Linux. I can the below error only sometimes while running my program. It seems to immediately occur only once either the PoweredUpHub or PoweredUpRemote is visible to my computer's bluetooth, but other times it just fails immeidately. Most of the time, it works fine, but other times it doesn't.

$ uname -a
Linux lavender-hp 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
inside curio run loopstarted thread for curio

Awaiting on bleak discover
INFO:BLE Event Q.0:using bleak
INFO:BLE Event Q.0:Starting scan for UART 00001623-1212-efde-1623-785feabcd123
INFO:BLE Event Q.0:Looking for first matching hub
Unhandled Error
Traceback (most recent call last):
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/txdbus/protocol.py", line 140, in dataReceived
    self.rawDBusMessageReceived(raw_msg)
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/txdbus/protocol.py", line 266, in rawDBusMessageReceived
    self.signalReceived(m)
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/txdbus/client.py", line 642, in signalReceived
    self.router.routeMessage(msig)
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/txdbus/router.py", line 128, in routeMessage
    r.match(m)
--- <exception caught here> ---
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/txdbus/router.py", line 67, in match
    self.callback(m)
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/bleak/backends/bluezdbus/discovery.py", line 65, in parse_msg
    device_interface = message.body[1].get("org.bluez.Device1", {})
builtins.AttributeError: 'list' object has no attribute 'get'

Traceback (most recent call last):
  File "/home/lavender/programming/Python/lego-train-manager/trainmanager/__init__.py", line 17, in <module>
    start(system)
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/bricknil/bricknil.py", line 214, in start
    ble.run()
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/bricknil/bleak_interface.py", line 52, in run
    self.loop.run_until_complete(self.asyncio_loop())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/bricknil/bleak_interface.py", line 65, in asyncio_loop
    devices = await bleak.discover(timeout=1, loop=self.loop)
  File "/home/lavender/programming/Python/lego-train-manager/.venv/lib/python3.8/site-packages/bleak/backends/bluezdbus/discovery.py", line 161, in discover
    properties = await bus.callRemote(
txdbus.error.RemoteError: org.freedesktop.DBus.Error.UnknownObject: Method "GetAll" with signature "s" on interface "org.freedesktop.DBus.Properties" doesn't exist

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