LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2014, 12:57 AM   #1
grams
LQ Newbie
 
Registered: May 2014
Posts: 4

Rep: Reputation: Disabled
Serial port errors 'Permission denied' and 'Operation not permitted' Please help.


I am working on a project which requires opening a serial port and write/read data with an external device.

'Cutecom' returned error "could not open serial port"

'Terminal' returned error "permission denied" when I tried to execute "stty -F /dev/ttyS0 57600 parodd" command.

I am loged in the box with administrative previleges.

The command "chmod o+rw /dev/ttyS0", which I found in this forum also returns "Operation not permitted" error. Terminal output is given below:

Please Help to resolve this.

------------------------------------------------
"user@ubuntu:~$ dmesg | grep tty
[ 0.000000] console [tty0] enabled
[ 0.990934] 00:06: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 88.941050] cdc_acm 1-7:1.1: ttyACM0: USB ACM device
[ 88.944660] cdc_acm 1-7:1.3: ttyACM1: USB ACM device
user@ubuntu:~$ stty -F /dev/ttyS0 57600 parodd
stty: /dev/ttyS0: Permission denied
user@ubuntu:~$ chmod o+rw /dev/ttyS0
chmod: changing permissions of ‘/dev/ttyS0’: Operation not permitted
--------------------------------------------------

thanks.
GRams.

Last edited by grams; 05-02-2014 at 12:59 AM.
 
Old 05-02-2014, 01:18 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
What is the output of this command?
Code:
ls -l /dev/ttyS0
This is what my system gives:
Code:
/dev# ls -l ttyS0
crw-rw---- 1 root dialout 4, 64 Apr 30 08:21 ttyS0
jdk
 
Old 05-02-2014, 05:32 AM   #3
grams
LQ Newbie
 
Registered: May 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi JDK,

command 'ls -l /dev/ttyS0' give following output:
crw-rw---- 1 root dialout 4, 64 May 2 14:21 /dev/ttyS0.
/dev/ttyS0 is given a yellow background.
'/dev# ls -l ttyS0' - does not appear in the terminal.

thanks
GRams.
 
Old 05-02-2014, 10:20 AM   #4
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Quote:
Originally Posted by grams View Post
'/dev# ls -l ttyS0' - does not appear in the terminal.
I wouldn't expect it to. That was just to show you what command I gave, what folder I gave it from and that I was logged in as root when I gave it. /dev#
is just the prompt.
jdk
 
Old 05-02-2014, 10:58 AM   #5
grams
LQ Newbie
 
Registered: May 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
I am getting to know the command structure & appreciate your exlanation.

'ls -l /dev/ttyS0' throws following output for me. My ID has admin rights.
crw-rw---- 1 root dialout 4, 64 May 2 14:21 /dev/ttyS0.

is there a way to fix the issue and get the port open?.

thanks.
grams.
 
Old 05-02-2014, 11:26 AM   #6
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
I think you have to use "sudo" in Ubuntu. Have you tried the command:
Code:
sudo stty -F /dev/ttyS0 57600 parodd
Then you will be prompted for your own password and then that should solve the permissions issue.
jdk
 
Old 05-06-2014, 09:13 AM   #7
grams
LQ Newbie
 
Registered: May 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Problem Solved; Thanks

Quote:
Originally Posted by jdkaye View Post
I think you have to use "sudo" in Ubuntu. Have you tried the command:
Code:
sudo stty -F /dev/ttyS0 57600 parodd
Then you will be prompted for your own password and then that should solve the permissions issue.
jdk
Hi Jdkaye,
I found a solution (from another forum) for this problem by adding my id to the group the tty's belong to. I didn't try sudo. Anyways, thanks for your time and help
-grams.

Code:
user@ubuntu:~$ id -Gn
user adm cdrom sudo dip plugdev lpadmin sambashare
user@ubuntu:~$ sudo adduser user dialout
[sudo] password for user:
Adding user `user' to group `dialout' ...
Adding user user to group dialout
Done.
user@ubuntu:~$ id -Gn
user adm cdrom sudo dip plugdev lpadmin sambashare
//*adduser is not reflected
//*log out and log in for adduser to take effect
user@ubuntu:~$ id -Gn
user adm dialout cdrom sudo dip plugdev lpadmin sambashare

Now I am able to send commands and receive data.

Last edited by grams; 05-07-2014 at 05:32 AM. Reason: adding code which resolved the problem
 
Old 05-06-2014, 09:54 AM   #8
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
You're quite welcome. As a service to others please mark this thread as [SOLVED]. You use the Thread Tools menu just above your first post on this thread. Thanks.
jdk
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync Permission denied errors. KroniK Linux - Networking 3 08-13-2012 01:39 PM
CPIO and Find Operation not permitted errors metallica1973 Linux - Server 4 06-16-2011 04:58 PM
Audit permission denied errors jaco0667 Linux - Security 5 06-17-2008 05:27 AM
Getting permission denied errors with NFS triley Linux - General 1 08-24-2006 05:39 PM
./configure errors: permission denied! TippExed Linux - Software 4 09-10-2002 11:50 AM


All times are GMT -5. The time now is 02:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration