maritime-labs/calypso-anemometer

BleakDBusError: [org.bluez.Error.Failed] Software caused connection abort

amotl opened this issue · 3 comments

amotl commented

Hi there,

people using this software on real hardware reported about occasional connection errors.

So after a few new tests I notice that it often comes to:

BleakDBusError: [org.bluez.Error.Failed] Software caused connection abort

On this matter, I've already discovered hbldh/bleak#666 and hbldh/bleak#802. Probably there should be another connection retry when this happens?

With kind regards,
Andreas.

The error happens on first connection sometimes.
After the detection of a device and while attempting to connect.

amotl commented

I see. Thank you for clarifying.

amotl commented

Thank you for sharing the full traceback of another similar exception at GH-22, which can also be worked around by just trying again.

  File "/usr/lib/python3.9/site-packages/calypso_anemometer/engine.py", line 79, in handler
    await calypso.set_datarate(rate)
  File "/usr/lib/python3.9/site-packages/calypso_anemometer/core.py", line 217, in set_datarate
    await self.client.write_gatt_char(
  File "/usr/local/lib/python3.9/dist-packages/bleak/backends/bluezdbus/client.py", line 690, in write_gatt_char
    assert_reply(reply)
  File "/usr/local/lib/python3.9/dist-packages/bleak/backends/bluezdbus/utils.py", line 22, in assert_reply
    raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.Failed] Operation failed with ATT error: 0x0e (Connection Rejected Due To Security Reasons)