Skip to content

hang with --ble : waiting for <coroutine object BleakClient.write_gatt_char #909

@edsantiago

Description

@edsantiago

Querying my nodes from my Gentoo laptop, meshtastic commands never terminate. They do produce the desired output (info, export-config) but I have to check for the file from another term window, then ^C the meshtastic process.

$ meshtastic --debug --ble edr2_1e23 --info >info
...does the pause thing...
....then lots and lots of output, as expected, which I'll skip...
...
ground_speed: 1
ground_track: 0
sats_in_view: 7
precision_bits: 32
, 'latitude': 35.xxxxx, 'longitude': -106.xxxxx}}
DEBUG file:client.py write_gatt_char line:816 Write Characteristic f75c76d2-129e-4dad-a1dd-7866124401e7 | /org/bluez/hci0/dev_C3_BF_1E_24_1E_23/service0025/char002b: b' \x01'
DEBUG file:ble_interface.py async_await line:324 async_await: complete
DEBUG file:manager.py _parse_msg line:970 received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C3_BF_1E_24_1E_23/service0025/char0029): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', b'')>}, []]
DEBUG file:client.py read_gatt_char line:727 Read Characteristic 2c55e69e-4993-11ed-b878-0242ac120002 | /org/bluez/hci0/dev_C3_BF_1E_24_1E_23/service0025/char0029: bytearray(b'')
DEBUG file:ble_interface.py async_await line:324 async_await: complete
DEBUG file:ble_interface.py async_await line:318 async_await: waiting for <coroutine object BleakClient.disconnect at 0x7f5b6bb17f40>
DEBUG file:client.py disconnect line:396 Disconnecting ({/org/bluez/hci0/dev_C3_BF_1E_24_1E_23})
DEBUG file:manager.py _parse_msg line:970 received D-Bus signal: org.freedesktop.DBus.ObjectManager.InterfacesRemoved (/): ['/org/bluez/hci0/dev_C3_BF_1E_24_1E_23', ['org.bluez.Battery1']]

...about a 2-second pause here.....


DEBUG file:client.py on_data line:876 AcquireNotify: Read error on fd 9: Unexpected EOF on notification file handle. Notifications have been stopped.
DEBUG file:client.py on_data line:876 AcquireNotify: Read error on fd 10: Unexpected EOF on notification file handle. Notifications have been stopped.
DEBUG file:manager.py _parse_msg line:970 received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C3_BF_1E_24_1E_23): ['org.bluez.Device1', {'ServicesResolved': <dbus_fast.signature.Variant ('b', False)>}, []]
DEBUG file:manager.py _parse_msg line:970 received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C3_BF_1E_24_1E_23): ['org.bluez.Device1', {'Connected': <dbus_fast.signature.Variant ('b', False)>}, []]
DEBUG file:client.py on_connected_changed line:163 Device disconnected (/org/bluez/hci0/dev_C3_BF_1E_24_1E_23)
DEBUG file:client.py _cleanup_all line:360 _cleanup_all(/org/bluez/hci0/dev_C3_BF_1E_24_1E_23)
DEBUG file:ble_interface.py _sendToRadioImpl line:222 TORADIO write: 2001
DEBUG file:ble_interface.py async_await line:318 async_await: waiting for <coroutine object BleakClient.write_gatt_char at 0x7f5b6bb233d0>

^CTraceback (most recent call last):
  File "/home/esm/.venv/meshtastic/bin/meshtastic", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/esm/.venv/meshtastic/lib/python3.13/site-packages/meshtastic/__main__.py", line 2260, in main
    common()
    ~~~~~~^^
  File "/home/esm/.venv/meshtastic/lib/python3.13/site-packages/meshtastic/__main__.py", line 1489, in common
    onConnected(client)
    ~~~~~~~~~~~^^^^^^^^
  File "/home/esm/.venv/meshtastic/lib/python3.13/site-packages/meshtastic/__main__.py", line 1126, in onConnected
    interface.close()  # after running command then exit
    ~~~~~~~~~~~~~~~^^
  File "/home/esm/.venv/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 252, in close
    self.client.disconnect()
    ~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/esm/.venv/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 286, in disconnect
    self.async_await(self.bleak_client.disconnect(**kwargs))
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/esm/.venv/meshtastic/lib/python3.13/site-packages/meshtastic/ble_interface.py", line 323, in async_await
    result = future.result(timeout)
  File "/usr/lib/python3.13/concurrent/futures/_base.py", line 451, in result
    self._condition.wait(timeout)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3.13/threading.py", line 359, in wait
    waiter.acquire()
    ~~~~~~~~~~~~~~^^
KeyboardInterrupt

2.7.8. 100% reproducible. strace or other debug info on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions