LinuxQuestions.org
Visit Jeremy's Blog.
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 07-20-2011, 02:47 AM   #1
shailendragour50
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Rep: Reputation: Disabled
finding problem in opening file /dev/ttyS0


i am working in serial communication program while opening file /dev/ttyS0 i am finding problem plz help me
 
Old 07-20-2011, 04:10 AM   #2
AndyLandy
LQ Newbie
 
Registered: Jun 2011
Location: Southampton, UK
Distribution: RedHat Enterprise
Posts: 8

Rep: Reputation: Disabled
Can you be a little bit more-specific? If you do 'ls /dev/ttyS0', do you even have the relevant device entry?

Are you using a serial port on your PC, or are you using an add-on (PCI card or USB dongle)? Sometimes they are assigned different device names.
 
1 members found this post helpful.
Old 07-20-2011, 08:21 AM   #3
shailendragour50
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AndyLandy View Post
Can you be a little bit more-specific? If you do 'ls /dev/ttyS0', do you even have the relevant device entry?

Are you using a serial port on your PC, or are you using an add-on (PCI card or USB dongle)? Sometimes they are assigned different device names.
Thanks for replay
Yes i am using serial port on my pc ,when i am opening the file " fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NDELAY);" And debugging it showing following message "opening_error: Permission denied" plz help
 
Old 07-21-2011, 05:07 AM   #4
AndyLandy
LQ Newbie
 
Registered: Jun 2011
Location: Southampton, UK
Distribution: RedHat Enterprise
Posts: 8

Rep: Reputation: Disabled
Obvious question, but do you have permission to access the serial port? You probably need to be root to write to low-level hardware devices.
 
1 members found this post helpful.
Old 07-21-2011, 07:03 AM   #5
shailendragour50
LQ Newbie
 
Registered: Jul 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Its working now .....
Thanks
 
  


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
[problem] frequency log causes /dev/ttyS0 console freeze until any key input masue Linux - Embedded & Single-board computer 6 06-22-2010 07:55 PM
File read/write on /dev/ttyS0 is not working on silent boot ganesha.ld Other *NIX 2 12-23-2008 08:19 AM
File read/write on /dev/ttyS0 is not working on kernel silent boot ganesha.ld Linux - Embedded & Single-board computer 0 12-23-2008 08:06 AM
accidentily erased /dev/ttyS0 file frieza Linux - Hardware 1 01-02-2004 12:45 PM


All times are GMT -5. The time now is 07:37 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