Repository navigation
hang with --ble : waiting for <coroutine object BleakClient.write_gatt_char #909
Copy link
Copy link
Open
Description
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()
~~~~~~~~~~~~~~^^
KeyboardInterrupt2.7.8. 100% reproducible. strace or other debug info on request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
rummykubd commentedon May 8, 2026
Seems like similar behavior to what was fixed for macOS in #893?
@edsantiago would you mind sharing output of
strace? I can’t guarantee I’ll figure it out, but happy to look into this and see what I can do.edsantiago commentedon May 8, 2026
Hung for 15 minutes before I hit ^C.
meshtastic-ble-strace.1410090.txt
meshtastic-ble-strace.1410092.txt
meshtastic-ble-strace.1410093.txt
meshtastic-ble-strace.1410094.txt
meshtastic-ble-strace.1410109.txt
meshtastic-ble-strace.1410110.txt
meshtastic-ble-strace.1410143.txt
Thanks in advance!
max-arnold commentedon May 9, 2026
Hey! Can you test the
pthworkaround snippet mentioned in #921 ?