Then tried adding a USB Zigbee radio through the UI:
(I also tried with the /dev/ttyACM0 path)
Expected behavior
Home assistant successfully adds the radio
Logs
Logs
```
2024-04-01 14:26:34.589 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.598 DEBUG (bellows.thread_0) [zigpy.serial] Opening a serial connection to '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00' (57600 baudrate)
2024-04-01 14:26:34.603 DEBUG (MainThread) [zigpy.application] Failed to probe with config {'path': '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00', 'baudrate': 57600, 'flow_control': 'software'}
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/application.py", line 631, in probe
await app.connect()
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/zigbee/application.py", line 145, in connect
await ezsp.connect(use_thread=self.config[CONF_USE_THREAD])
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 145, in connect
self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 470, in connect
protocol, connection_done = await thread.run_coroutine_threadsafe(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 449, in _connect
transport, protocol = await zigpy.serial.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/serial.py", line 48, in create_serial_connection
transport, protocol = await pyserial_asyncio.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial_asyncio_fast/__init__.py", line 508, in create_serial_connection
serial_instance = await loop.run_in_executor(None, callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00: [Errno 13] Permission denied: '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00'
2024-04-01 14:31:11.683 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.684 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.684 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.684 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.685 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.693 DEBUG (bellows.thread_0) [zigpy.serial] Opening a serial connection to '/dev/ttyACM0' (57600 baudrate)
2024-04-01 14:31:11.696 DEBUG (MainThread) [zigpy.application] Failed to probe with config {'path': '/dev/ttyACM0', 'baudrate': 57600, 'flow_control': 'software'}
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/ttyACM0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/application.py", line 631, in probe
await app.connect()
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/zigbee/application.py", line 145, in connect
await ezsp.connect(use_thread=self.config[CONF_USE_THREAD])
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 145, in connect
self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 470, in connect
protocol, connection_done = await thread.run_coroutine_threadsafe(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 449, in _connect
transport, protocol = await zigpy.serial.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/serial.py", line 48, in create_serial_connection
transport, protocol = await pyserial_asyncio.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial_asyncio_fast/__init__.py", line 508, in create_serial_connection
serial_instance = await loop.run_in_executor(None, callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'
```
Describe the bug
Permissions errors trying to add Zigbee radio. Running
usermod -a -G dialout homeassistant
seemed to fix.Context
Steps to reproduce
I enabled debug logging for ZHA:
Then tried adding a USB Zigbee radio through the UI:
(I also tried with the
/dev/ttyACM0
path)Expected behavior
Home assistant successfully adds the radio
Logs
Logs
``` 2024-04-01 14:26:34.589 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.590 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:26:34.598 DEBUG (bellows.thread_0) [zigpy.serial] Opening a serial connection to '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00' (57600 baudrate)
2024-04-01 14:26:34.603 DEBUG (MainThread) [zigpy.application] Failed to probe with config {'path': '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00', 'baudrate': 57600, 'flow_control': 'software'}
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/application.py", line 631, in probe
await app.connect()
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/zigbee/application.py", line 145, in connect
await ezsp.connect(use_thread=self.config[CONF_USE_THREAD])
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 145, in connect
self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 470, in connect
protocol, connection_done = await thread.run_coroutine_threadsafe(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 449, in _connect
transport, protocol = await zigpy.serial.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/serial.py", line 48, in create_serial_connection
transport, protocol = await pyserial_asyncio.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial_asyncio_fast/__init__.py", line 508, in create_serial_connection
serial_instance = await loop.run_in_executor(None, callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00: [Errno 13] Permission denied: '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231120104922-if00'
2024-04-01 14:31:11.683 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.684 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.684 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.684 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.685 DEBUG (MainThread) [zigpy.ota] Registering new OTA provider:
2024-04-01 14:31:11.693 DEBUG (bellows.thread_0) [zigpy.serial] Opening a serial connection to '/dev/ttyACM0' (57600 baudrate)
2024-04-01 14:31:11.696 DEBUG (MainThread) [zigpy.application] Failed to probe with config {'path': '/dev/ttyACM0', 'baudrate': 57600, 'flow_control': 'software'}
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/ttyACM0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/application.py", line 631, in probe
await app.connect()
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/zigbee/application.py", line 145, in connect
await ezsp.connect(use_thread=self.config[CONF_USE_THREAD])
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 145, in connect
self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 470, in connect
protocol, connection_done = await thread.run_coroutine_threadsafe(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/bellows/uart.py", line 449, in _connect
transport, protocol = await zigpy.serial.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/zigpy/serial.py", line 48, in create_serial_connection
transport, protocol = await pyserial_asyncio.create_serial_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial_asyncio_fast/__init__.py", line 508, in create_serial_connection
serial_instance = await loop.run_in_executor(None, callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/var/www/homeassistant/lib/python3.11/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyACM0: [Errno 13] Permission denied: '/dev/ttyACM0'
```
This seems related to https://github.com/YunoHost-Apps/homeassistant_ynh/issues/40. Similar output as was done in that issue:
I also verified that
DevicePolicy=closed
is commented out:This time though, unlike in #40, adding
homeassistant
to thedialout
group and restarting home assistant seemed to fix things:then, add radio with the
/dev/ttyACM0
path.