LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-29-2011, 03:35 AM   #1
Coop666
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Rep: Reputation: 1
Completely lost... Serial port problem


Hi there,

I'm pretty new to Linux, and I'm running into a problem with my serial ports. I'm using Centos 5.4 (2.6.18-164.el5).

I'm using an Intel d510mo mini-itx mainboard, this board was chosen for this application because of its' 2 onboard serial port headers. I need both of them to work, one for receiving a GPS signal, the other for a Matrix Orbital LK202-25 display.

The problem is that whatever I do, I can't seem to get /dev/ttyS0 and /dev/ttyS1 to work, while they do show up.

When I try to control the display, I can't get it to do anything (no difference between /dev/ttyS0 and /dev/ttyS1). When I connect the GPS, /dev/ttyS0 does nothing, but when I connect to /dev/ttyS1, it does show something coming in, just not the text string the GPS is sending. It appears the incoming data is deformed (at first I thought there might be a baudrate mismatch, but I checked that multiple times, also the deformed data is too consistent in it's deformation to have a cause like that)

I checked everything a million times, but I feel like I'm overlooking something.


dmesg shows the following:

[root@ra-pcw-wks0003 ~]# dmesg | grep tty
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:09: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:0a: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A

which looks ok I think. I checked with lspci to see if there were any IRQ conflicts, but there aren't.

To test I'm using minicom, I've gone over the minicom settings quite a few times too, but everything there looks good. To make sure the settings are good, I used a USB to RS232 converter (which is on my system as /dev/ttyUSB0) When changing nothing but the port from either /dev/ttyS0 or /dev/ttyS1 to /dev/ttyUSB0, everything works fine. But via the onboard serial headers it seems impossible to get working.

I went as far as swapping out the mainboard to make sure the problem isn't in the hardware, but no luck. As the second mainboard has the exact same issues as the first, I think it might be a driver or configuration issue, but my knowledge of linux is not yet at a level where I can troubleshoot problems like that...

Can anyone please help?

If you need more information, just let me know what you need. (remember I'm a n00b, so you might have to tell me how to get certain pieces of info).

Thanks!
 
Old 03-29-2011, 07:04 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I'm not a serial guru or anything .. but what protocol is the GPS using and what application are you using to receive the data from the serial port ?
 
Old 03-29-2011, 07:12 AM   #3
Coop666
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 1
For testing purposes I have the GPS sending out the coordinates as text (ascii), I'm monitoring the serialport using minicom.

When the GPS is connected to the mainboard headers I get either nothing (ttyS0) or deformed date (ttyS1). When I use the USB to RS232 converter (ttyUSB0), everything is fine (nothing but the tty to use was changed).
 
Old 03-29-2011, 07:30 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
First go back and make sure that everything is wired correctly. The white stripe should be closest to pin 1 of the header. I assume it is a standard flat wire cable.
 
Old 03-29-2011, 07:37 AM   #5
Coop666
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 1
Checked that already, verified the pinout in the mainboards manual, tried several header cables, and even took the multimeter to my header cables to make sure they are wired as they are supposed to.

I will doublecheck everything though...
 
Old 03-29-2011, 07:37 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You might need to modify the minicom init string, it could be confusing your device - I usually set mine to '~^M~'

Run 'minicom -s' then look under 'Modem and dialing'
 
Old 03-29-2011, 07:52 AM   #7
Coop666
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 1
I measured the header cables again, they're good.

I changed the init string in minicom to ~^M~, and tried again, but no luck
 
Old 03-29-2011, 11:17 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,289

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Ugh! Serial Ports.
/going back 6-10 years.
There is a compatibility problem with rs-232, in that high should be +10V, and low, if I'm not mistaken, some specs say -10V. The MAX-232 (a chip which blows every time the sun goes behind a cloud) is a great rs232 connector, giving +10 and maybe -5V in most applications I have put an oscilloscope on. Other hardware uses +10 and 0V although it tolerates negative voltage. Some pair of old chips are surprisingly common there still and do +10 & 0V. These level issues can cause connection problems.

RS232, unlike usb is extremely sensitive to earthing issues. If you connect two powered boxes, you may blow something - flashover, it's called ((IIRC?). Any difference in earths also does damage. RS232 links earth to earth to 0V. Anyhow, you zap the port.

Try something like
dd if=/dev/ttyS1 of=~/foo bs=1 count=20

and power on one box when you are trying to connect.This will sit waiting for 20 bytes. But if your port is blown, it won't get them. Try something else in your serial port and try to narrow the problem down. It could be a blown port on something
 
Old 04-05-2011, 06:43 AM   #9
takeshi.ikeya
LQ Newbie
 
Registered: May 2006
Location: japan
Posts: 1

Rep: Reputation: 0
In my case, I keep a DSUB connector, which is soldered to loopback.
That is 2-3(txd-rxd), 4-6(dtr-dsr), 7-8(rts-cts) wired.
And plug it in the serial recp, and test with minicom.
 
Old 04-05-2011, 08:15 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
So does the loopback plug work on the ttyS0 and ttyS1 ports?
 
Old 06-03-2011, 08:09 AM   #11
Coop666
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 1
It's been a while, but the problem is solved...

Well, not exactly solved, but at least I have a workaround and offloaded the original issue to my hardware supplier.
It turns out that Centos and the serialcontroller on the mainboard I was using don't play nice together. I swapped out the Intel D510mo mainboard for a Jetway NC92-330-LF I had laying around re-installed Centos but used the same cables, same settings: instant success

I sent back the batch of Intel boards to my supplier... I did ask him for Centos 5.4 compatible, Atom based, Mini ITX boards with 2 serial ports... so he didn't send me what I needed...
 
1 members found this post helpful.
Old 06-03-2011, 08:26 AM   #12
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Thank you for posting the answer. It could help other people.
 
Old 12-09-2011, 02:31 PM   #13
gcrewe
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
This confirms incomptability of Intel D510 motherboard serial ports with CentOS

I am running Centos 6 and I have the same problem. Tried everything above and more to make this serial ports work to no avail. So this confirms that this motherboard serial ports are not compatible with CentOS.
 
  


Reply



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
Is a USBtty (USB serial port) treated the same as tty (normal serial port) in C? spudgunner Programming 1 11-12-2010 01:19 PM
Problem with serial port, it lost some bytes !!!!!! andaya Linux - Newbie 3 10-23-2008 02:45 AM
Completely lost in a network port enroute to squid jonnoc Linux - Networking 1 11-19-2007 03:35 AM
Lost panel in Gnome -- now I'm completely lost! webwench Linux - Newbie 3 04-30-2005 01:38 AM
serial port problem... linux4john Linux - Software 1 10-30-2003 10:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:45 PM.

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
Open Source Consulting | Domain Registration