Serial interface permanently denies requests
serial-port
Solution
I have never used Arduino, so I'll suppose your method is right. First thing I would try is `sudo`ing the first command:
sudo cu -l /dev/ttyACM0 -s 115200
But, since the second message is `Line in Use` it might also be that the `/dev/ttyACM0` is already actually taken/locked. In other words, is there any process using the port? I can't test it on a serial port, but I'd try piping the output of list open files command to grep command:
lsof | grep ACM
It should list the process identifer of the process which locked upon the port. Then you can use the kill command to stop that process:
kill <PID_FROM_OUTPUT_OF_UPPER_COMMAND>
To verify that you succesfully stopped the process you can pipe the output of list all active processes command to the grep command:
ps x | grep <PID_FROM_OUTPUT_OF_UPPER_COMMAND>
which should return no output if the process was successfully stopped. If not, it will ouput that line, so you can try with the -9 flag like this:
kill -9 <PID_FROM_OUTPUT_OF_UPPER_COMMAND>
and it will eventually stop.
Without testing, I'm not sure will the `lsof` command written in the current form list the taken `tty` devices. If that is the case then there must be some flag combination which will list them, since everything in Unix is a file.
So, the principle must be valid: find out which process is using the device and stop it (the `ps` and `kill` commands will work once you have the right process identifier).
If all of the above is not the case, then probably your method is wrong. In that case, I'd start by carefully rereading the Arduino documentation again :)
Problem
my actual problem is, that every time i want to access my serial interface (Arduino), the system returns Permission denied . ``` root@laptop:/home/user #> cu -l /dev/ttyACM0 -s 115200 /usr/bin/cu: open (/dev/ttyACM0): Permission denied /usr/bin/cu: /dev/ttyACM0: Line in Use root@laptop:/home/user #> ls -la /dev/ttyACM* crw-rw---- 1 root dialout 166, 0 Mär 14 10:37 /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Mär 14 10:37 /dev/ttyACM1 crw-rw---- 1 root dialout 166, 0 Mär 14 10:37 /dev/ttyACM2 crw-rw---- 1 root dialout 166, 0 Mär 14 10:37 /dev/ttyACM3 ``` what is another location to seek for the reason of this error? Thanks for any advice!