Quote:
programme hangs with output "pemission denied".
What's the problem? Is it because I used wrong device name?
|
No. Obviously, "permission denied" means that the user that runs the program doesn't have permission to open /dev/ttyS0 ...
Running the program as root will most probably not give this error. It's better though to run it as a normal user. To give a normal user permission to open the serial port check what is the
group of /dev/ttyS0. On my (Debian) system this is the group "dialout", as you can find out with:
Code:
bash$ ls -l /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 Mar 14 2002 /dev/ttyS0
Then give your user ("hko" in my case) permission to open the device file by making it a member of the group "dialout" (in case of debian) with (as root):
Code:
bash# adduser hko dialout
(Once again: use the username and groupname of your system)
Then re-login as the user and he/she/it will be able to run your program.
Quote:
|
How can I know which tty device my serial port is using? My Linux box has a ps2 mouse and a keyboard. and there is one COM port, which I am trying to use.
|
The first serial port on your computer will be /dev/ttyS0, the second /dev/ttyS1...etc. As you only have one, the device file for the serial port will be /dev/ttyS0.