Sometimes if the connection to a device via Minicom is lost, the next time you start Minicom you could see an error:
Device /dev/ttyS0 is locked.
The name /dev/ttyS0 may be different, depending on your COM port. To avoid this issue you should always shut down Minicom using CTRL+A keys and then the Q key.
To resolve the issue you can kill the process as a root user. Use the following command in your terminal:
killall -9 minicom
In Ubuntu is similar. Run the command in your terminal using sudo:
sudo killall -9 minicom
You can also try to delete the file:
LCK..ttyS0 in the /var/lock directory.
That was all for me! Hope this little tutorial was useful. If you like to learn more about networking check out this book CompTIA Network+ Certification All-in-One Exam Guide, Seventh Edition (Exam N10-007)