Hardware manual
Check the file permissions on this port with "ls -l /dev/ttyS?"_ If you own the ttyS? then you need read and
write permissions: crw with the c (Character device) in col. 1. It you don't own it then it will work for you if it
shows rw- in cols. 8 & 9 which means that everyone has read and write permission on it. Use "chmod" to
change permissions. There are more complicated (and secure) ways to get access like belonging to a "group"
that has group permission. Some programs change the permissions when they run but restore them when the
program exists normally. But if someone pulls the plug on your PC it's an abnormal exit and correct
permissions may not be restored.
16.11 "Cannot open /dev/ttyS?"
Unless stty is set for clocal, the CD pin may need to be asserted in order to open a serial port. If the physical
port is not connected to anything, or if it's connected to something that is not powered on (such an external
modem) then there will be no voltage on CD from that device. Thus the "cannot open" message. Either set
clocal or connect the serial port connector to something and power it on.
Even if a device is powered on and connected to a port, it may sometimes prevent opening the port. An
example of this is where the device has negated CD and the CD pin on your PC is negated (negative voltage).
16.12 "Operation not supported by device" for ttyS?
This means that an operation requested by setserial, stty, etc. couldn't be done because the kernel doesn't
support doing it. Formerly this was often due to the "serial" module not being loaded. But with the advent of
PnP, it may likely mean that there is no modem (or other serial device) at the address where the driver (and
setserial) thinks it is. If there is no modem there, commands (for operations) sent to that address obviously
don't get done. See What is set in my serial port hardware?
If the "serial" module wasn't loaded but "lsmod" shows you it's now loaded it might be the case that it's loaded
now but wasn't loaded when you got the error message. In many cases the module will automatically loaded
when needed (if it can be found). To force loading of the "serial" module it may be listed in the file:
/etc/modules.conf or /etc/modules. The actual module should reside in: /lib/modules/.../misc/serial.o.
16.13 "Cannot create lockfile. Sorry"
Sometimes when it can't create a lockfile you get the erroneous message: "... Device or resource busy" instead
of the one above. When a port is "opened" by a program a lockfile is created in /var/lock/. Wrong permissions
for the lock directory will not allow a lockfile to be created there. Use "ls -ld /var/lock" to see if the
permissions are OK. Giving rwx permissions for the root owner and the group should work, provided that the
users that need to dialout belong to that group. Others should have r-x permission. Even with this scheme,
there may be a security risk. Use "chmod" to change permissions and "chgrp" to change groups. Of course, if
there is no "lock" directory no lockfile can be created there. For more info on lockfiles see What Are Lock
Files
16.14 "Device /dev/ttyS? is locked."
This means that someone else (or some other process) is supposedly using the serial port. There are various
ways to try to find out what process is "using" it. One way is to look at the contents of the lockfile
(/var/lock/LCK...). It should be the process id. If the process id is say 100 type "ps 100" to find out what it is.
Then if the process is no longer needed, it may be gracefully killed by "kill 100". If it refuses to be killed use
"kill -9 100" to force it to be killed, but then the lockfile will not be removed and you'll need to delete it
Serial HOWTO
16.10 "Cannot open /dev/ttyS?: Permission denied" 62