Error “Device /dev/ttyUSB0 is locked” in linux

Error “Device /dev/ttyS0 is locked”


Sometimes terminal gives error "Device /dev/ttyS0 is locked" or
"Device /dev/ttyUSB0 is locked" that is happens, if the connection to Linux from external device which was made via Minicom is lost, and then the next time you start Minicom, you could see an error:

Device /dev/ttyS0 is locked
Error Device /dev/ttyUSB0 is locked
Device /dev/ttyS0 is locked
or
Device /dev/ttyUSB0 is locked

or The name /dev/tty*** may be different, depending on what COM-port you have.
To avoid such error, it is necessary to properly shut down Minicom using the command

"CTRL+A" keys and then the "Q" key on keyboard.

There are different  options available to overcome this error, some are:

1- Kill the process as a root user with the command:

   "$ killall -9 minicom"

   In Ubuntu, use the command:

   "$ sudo killall -9 minicom"

2- Or can simply delete the file «LCK..tty***» in the /var/lock/ directory.

Now try to open the minicom. Error will not be display.

😂️Enjoy😂️

Home    email us   

0 comments: