Permission Denied ttyS0

Home Assistant (5.11) Supervisor (2021.02.6) NUT (0.6.2) running on NUC
Eaton Powerwave 9130 ran excellent until last major upgrade, I receive this error in NUT addon when starting:

Network UPS Tools - BCMXCP UPS driver 0.31 (2.7.4)
RS-232 communication subdriver 0.20
Unable to open /dev/ttyS0: Operation not permitted
Current user id: root (0)
Serial port owner: root (0)
Mode of port: 0660
Things to try:

  • Use another port (with the right permissions)
  • Fix the port owner/group or permissions on this port
  • Run this driver as another user (upsdrvctl -u or ‘user=…’ in ups.conf).
    See upsdrvctl(8) and ups.conf(5).

ls -la /dev/ttyS0
crw-rw---- 1 root audio 4, 64 Feb 12 12:58 /dev/ttyS0

groups root
root bin daemon sys adm disk wheel floppy dialout tape video

I think the serial port needs to be in the dialout group for my NUT addon to access my UPS via serial cable.

How can I fix this permissions error?

Any help is appreciated.

what is the linux OS username your HA supervised is running under? I haven’t used that flavour since “hassio” and the username was homeassistant , but that might of all changed now.

anyway, get a login or ssh, as root

usermod -a -G audio,dialout <username>

e.g.

usermod -a -G audio,dialout homeassistant

but if root is the username, then it’s not permissions because root has full access to /dev/ttyS0 , more likely that is the wrong device name/doesn’t exist/kernel modules not loaded.

These commands are not available to me AFAIK.

I’m having similar issue after upgrading hassio host from 5.10 to 5.11, hassio addons can’t access serial ports. Example from SSH addon:

~ $ ls /dev/ttyS0  -la
crw-rw----    1 root     audio       4,  64 Feb 18 18:42 /dev/ttyS0
~ $ whoami
root
~ $ cat /dev/ttyS0
cat: can't open '/dev/ttyS0': Operation not permitted
~ $

This could be why.

The Upgrade to Supervisor 2021.03.3 fixed my issue.