I have an application (using QSerialPort
) that reads and writes from a serial port. When I run this application as the root
user, then run it again as a non-root user, I am no longer able to write to the serial port, receiving the following error:
QIODevice::write (QSerialPort): device not open
The non-root user is in the dialout
group, and the permissions on the /dev/tty**
file in question appear to be unchanged:
crw-rw---T 1 root dialout ......
Weirdest of all, I do not get an error when I simply use my shell to write to the file as the non-root user:
$> echo "foo bar baz" >> /dev/ttyS0
$> echo $?
0
The only thing I've found that appears to fix the problem is rebooting the machine.
What could possibly be going on here?
I'm on Debian 7.