LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 05-13-2009, 05:46 AM   #1
sanket_rambhia
LQ Newbie
 
Registered: May 2009
Posts: 1
Thanked: 0
Exclamation Can't use serial port on Kubuntu 9.04 x86-64 bit.


[Log in to get rid of this advertisement]
Serial port on my KUBUNTU 9.04 x86-64 bit doesn't seem to be working. This is the first time I am trying to use serial port on Linux so I might be doing something stupid.

I have attached a loop-back on my serial port to check if data is actually transmitted and received. From looking at /proc/tty/driver/serial it looks like data is being transmitted but nothing is being recieved, however voltmeter doesn't show any fluctuation when data is being transmitted so I doubt if any data is 'actually' being transmitted.

Here are the results of dmesg, setserial, stty, etc

dmesg | grep tty:
[ 0.010000] console [tty0] enabled
[ 1.551851] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 1.552105] 00:0c: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

ls -l /dev/ttyS*:
crw-rw-rw- 1 sanket dialout 4, 64 2009-05-13 13:17 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2009-05-13 11:38 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 2009-05-13 11:38 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 2009-05-13 11:38 /dev/ttyS3

stty -F /dev/ttyS0 -a:
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

setserial /dev/ttyS0:
/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4
Baud_base: 9600, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal auto_irq

lspnp -v:
00:0c PNP0501 16550A-compatible serial port
state = active
io 0x3f8-0x3ff
irq 4
dma disabled

lspci:
.
.
00:01.0 ISA bridge: nVidia Corporation MCP78S [GeForce 8200] LPC Bridge (rev a2)
.
.

vim /proc/tty/driver/serial:
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:67963 rx:0
1: uart:unknown port:000002F8 irq:3
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3

As you can see this shows transmitted data but recieved data is 0, which cant be the case as all the data transmitted should be recieved due to loopback.

I have checked BIOS and it shows serial port on IRQ 4 and address 0x3F8.
I am transmitting data using echo test_message > /dev/ttyS0, cp filename /dev/ttyS0 and by using minicom, cutecom.

I am trying to recieve data using tail -f /dev/ttyS0, cat /dev/ttyS0 and using cutecom application.
I have wasted two days with this without any progress.
Please help.

thanks.
sanket_rambhia is offline  
Tag This Post ,
Reply With Quote
Old 05-14-2009, 04:53 PM   #2
theNbomr
Senior Member
 
Registered: Aug 2005
Distribution: Open Suse, Fedora, Redhat
Posts: 2,272
Thanked: 74
Get C-Kermit. Set up as follows, using values that match your application (speed,parity,stop-bits irrelevant for loopback tests):
Code:
set port /dev/ttyS0
set carrier-watch off
set handshake none
set parity none|odd|even
set stop-bits 1|2
set speed 300|600|1200|2400|4800|9600|19200|38400|57600|115200
connect
Put your loopback jumper on the port connector, usually between pins 2 & 3, and start typing. What you type should be echoed back to the terminal. If it doesn't work, suspect a cable or connector problem. Setting carrier-watch to off will eliminate the possibility that something is disabled until a favorable modem control line is asserted. Instead, you could loop the DTR pin back into either/both CTS & CD pins.
Using a DVM to monitor the Tx data will be futile, since the bit stream is very brief and transient. Using an oscilloscope should make it easy to see the data. What you can check is that the idle state of the Tx line is at an expected -3VDC to -12VDC while not transmitting. Failing to see this would again point to a cabling error.
Kermit is the best tool for serial communications on PCs IMHO, as it gives you very fine-grained control over all aspects of the configuration, as well as very and flexible terminal emulation. Another tool that I have played with a bit lately is serlook, which is a serial port diagnostics, monitoring and logging utility.
Hope this helps.

--- rod.
theNbomr is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
build x86-64 application on 32-bit machine using x86-64 toolchain linuxgentoo Linux - General 16 06-03-2009 04:15 AM
no KDE in Kubuntu 6.10 64-bit(ATI X800 GTO 256 bit DDr3) exul182 Linux - Hardware 2 01-04-2007 03:47 PM
Setup serial port at 1200b, 7bits, even parity and 1 top bit seraph-seph Programming 5 10-21-2006 01:57 PM
Need Life Raft! Kubuntu or Ubuntu / X86 or X86-64 carl0ski Ubuntu 3 07-09-2006 12:13 AM
Mandriva 32-bit X86, 64-bit x86-64 & i586. La Dima Mandriva 9 10-07-2005 07:12 AM


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

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration