I'm trying to access the UART connected to the standard GPIO pins 14/15. As root, I can access them just fine. As a regular user, I always see a super abstract message:
$ minicom -b 115200 -D /dev/ttyS0
minicom: cannot open /dev/ttyS0: Device or resource busy
However, this works just fine when run with sudo
.
I checked the permissions to /dev/ttyS0
next, and everything appears to be in order:
$ ls -hall /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 Jan 4 21:12 /dev/ttyS0
$ id
uid=1001(jude) gid=1001(jude) groups=1001(jude),5(tty),20(dialout),27(sudo),112(bluetooth),114(docker)
I'm a part of dialout
, and just for fun, a part of tty
too.
Next up, I ran strace on cat /dev/ttyS0:
...
openat(AT_FDCWD, "/dev/ttyS0", O_RDONLY) = -1 EBUSY (Device or resource busy)
...
So that's pretty much it - I'm stuck.
Does anybody know what's going on here?
I'm trying to access the UART connected to the standard GPIO pins 14/15. As root, I can access them just fine. As a regular user, I always see a super abstract message:
$ minicom -b 115200 -D /dev/ttyS0
minicom: cannot open /dev/ttyS0: Device or resource busy
However, this works just fine when run with sudo
.
I checked the permissions to /dev/ttyS0
next, and everything appears to be in order:
$ ls -hall /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 Jan 4 21:12 /dev/ttyS0
$ id
uid=1001(jude) gid=1001(jude) groups=1001(jude),5(tty),20(dialout),27(sudo),112(bluetooth),114(docker)
I'm a part of dialout
, and just for fun, a part of tty
too.
Next up, I ran strace on cat /dev/ttyS0:
...
openat(AT_FDCWD, "/dev/ttyS0", O_RDONLY) = -1 EBUSY (Device or resource busy)
...
So that's pretty much it - I'm stuck.
Does anybody know what's going on here?
The problem was a stray process that was reading off of /dev/ttyS0. Weirdly, root could always take control over it, but as a normal user, it would show it as busy.
I detected this by using sudo fuser -k /dev/ttyS0
.
console=
parameter. That serial terminal is probably assigned as the system console. The error message indicates that you're not allowed to hijack the serial terminal that is already in use (as the system console). – sawdust Commented Jan 4 at 22:21sudo lsof /dev/ttyS0
? – Philippe Commented Jan 4 at 23:08console=
. The problem was a stray process that was reading off of /dev/ttyS0. Weirdly, root could always take control over it, but as a normal user, it would show it as busy. – judepereira Commented Jan 5 at 8:28