I am getting "Permission Denied" errors when trying to access /dev/serial0
on the Raspberry Pi CM4. I've tried the common suggestions of adding my user to the dialout
and tty
groups, but that has not worked. Interestingly, it seems that /dev/serial0
is not in the dialout group. When I run ls -l /dev/serial0
I get:
lrwxrwxrwx 1 root root 5 May 12 11:04 /dev/serial0 -> ttyS0
So you can see that it is part of the root
group. Similarly, stat /dev/serial0
yields:
File: /dev/serial0 -> ttyS0
Size: 5 Blocks: 0 IO Block: 4096 symbolic link
Device: 5h/5d Inode: 231 Links: 1
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2023-05-12 11:04:17.809999995 -0500
Modify: 2023-05-12 11:04:11.939999998 -0500
Change: 2023-05-12 11:04:11.939999998 -0500
Birth: -
Showing the Gid is root, not dialout.
Following the simlink to /dev/ttyS0
, I can see that this is part of the tty
group:
crw--w---- 1 root tty 4, 64 May 12 11:04 /dev/ttyS0
I tried accessing /dev/ttyS0 directly (instead of /dev/serial0) and I still get the Permission Denied error, even though my user is part of the tty group.
Any suggestions on how to give my user permission on this port?