Skip to content

bleak.exc.BleakDBusError: [org.bluez.Error.NotPermitted] Notify acquired #100

@tomaszduda23

Description

@tomaszduda23

I use your module for OTA in esphome esphome/esphome#12344. Version 6.0.0 works fine but with 6.1.0 I get this exception.

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "git/github/esphome/esphome/__main__.py", line 1661, in <module>
    sys.exit(main())
             ^^^^^^
  File "git/github/esphome/esphome/__main__.py", line 1652, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "git/github/esphome/esphome/__main__.py", line 1644, in run_esphome
    return POST_CONFIG_ACTIONS[args.command](args, config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "git/github/esphome/esphome/__main__.py", line 864, in command_upload
    exit_code, _ = upload_program(config, args, devices)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "git/github/esphome/esphome/__main__.py", line 717, in upload_program
    if getattr(module, "upload_program")(config, args, host):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "git/github/esphome/esphome/components/nrf52/__init__.py", line 419, in upload_program
    asyncio.run(smpmgr_upload(mcumgr_device, firmware))
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "git/github/esphome/esphome/components/nrf52/ota.py", line 42, in smpmgr_upload
    await _smpmgr_upload(device, firmware)
  File "git/github/esphome/esphome/components/nrf52/ota.py", line 80, in _smpmgr_upload
    await smp_client.connect()
  File "git/github/esphome/venv/lib/python3.12/site-packages/smpclient/__init__.py", line 105, in connect
    await self._transport.connect(self._address, connect_timeout_s)
  File "git/github/esphome/venv/lib/python3.12/site-packages/smpclient/transport/ble.py", line 136, in connect
    await self._client.start_notify(SMP_CHARACTERISTIC_UUID, self._notify_callback)
  File "git/github/esphome/venv/lib/python3.12/site-packages/bleak/__init__.py", line 846, in start_notify
    await self._backend.start_notify(
  File "git/github/esphome/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/client.py", line 940, in start_notify
    assert_reply(reply)
  File "git/github/esphome/venv/lib/python3.12/site-packages/bleak/backends/bluezdbus/utils.py", line 27, in assert_reply
    raise BleakDBusError(reply.error_name, reply.body)
bleak.exc.BleakDBusError: [org.bluez.Error.NotPermitted] Notify acquired

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions