FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 12-25-2009, 05:12 PM
David Relson
 
Default serial port identification question

My mobo has two serial ports.

As reported by hwinfo they are:

Serial Port 0: 0x3f8
Serial Port 1: 0x2f8

After booting the machine, dmesg indicates that tty0 is the console
with message:

console [tty0] enabled

/dev names a multitude of tty devices, i.e. /dev/tty0, /dev/tty1, ...

How do I determine which devices correspond to the serial ports?

Thanks.

David
 
Old 12-25-2009, 07:10 PM
Dale
 
Default serial port identification question

David Relson wrote:

My mobo has two serial ports.

As reported by hwinfo they are:

Serial Port 0: 0x3f8
Serial Port 1: 0x2f8

After booting the machine, dmesg indicates that tty0 is the console
with message:

console [tty0] enabled

/dev names a multitude of tty devices, i.e. /dev/tty0, /dev/tty1, ...

How do I determine which devices correspond to the serial ports?

Thanks.

David




Mine is /dev/ttyS0 and /dev/ttyS1 . I put both devices so you will
notice what is alpha and what is numeric. Also note the S is capitol as
well.


Dale

:-) :-)
 
Old 12-25-2009, 07:49 PM
David Relson
 
Default serial port identification question

On Fri, 25 Dec 2009 14:10:46 -0600
Dale wrote:

> David Relson wrote:
> > My mobo has two serial ports.
> >
> > As reported by hwinfo they are:
> >
> > Serial Port 0: 0x3f8
> > Serial Port 1: 0x2f8
> >
> > After booting the machine, dmesg indicates that tty0 is the console
> > with message:
> >
> > console [tty0] enabled
> >
> > /dev names a multitude of tty devices,
> > i.e. /dev/tty0, /dev/tty1, ...
> >
> > How do I determine which devices correspond to the serial ports?
> >
> > Thanks.
> >
> > David
> >
> >
>
> Mine is /dev/ttyS0 and /dev/ttyS1 . I put both devices so you will
> notice what is alpha and what is numeric. Also note the S is capitol
> as well.
>
> Dale
>
> :-) :-)

My /dev/tty* didn't include any /dev/ttyS* entries. Searching the web,
I learned that "MAKEDEV /dev/ttyS0" and "MAKEDEV /dev/ttyS1" will
create the missing entries and that "stty -F /dev/ttyS0 -a" will
provide configuration information for the port.

My little Serial.cpp class is now successfully writing to the port (as
proved by my son running Hyperterminal and receiving the sent
characters). However, receiving characters isn't yet working.
Neither his hyperterminal nor my sender (with a loopback plug) is
receiving.
 
Old 12-25-2009, 09:56 PM
Dale
 
Default serial port identification question

David Relson wrote:

On Fri, 25 Dec 2009 14:10:46 -0600
Dale wrote:



David Relson wrote:


My mobo has two serial ports.

As reported by hwinfo they are:

Serial Port 0: 0x3f8
Serial Port 1: 0x2f8

After booting the machine, dmesg indicates that tty0 is the console
with message:

console [tty0] enabled

/dev names a multitude of tty devices,
i.e. /dev/tty0, /dev/tty1, ...

How do I determine which devices correspond to the serial ports?

Thanks.

David



Mine is /dev/ttyS0 and /dev/ttyS1 . I put both devices so you will
notice what is alpha and what is numeric. Also note the S is capitol

as well.

Dale

:-) :-)



My /dev/tty* didn't include any /dev/ttyS* entries. Searching the web,
I learned that "MAKEDEV /dev/ttyS0" and "MAKEDEV /dev/ttyS1" will
create the missing entries and that "stty -F /dev/ttyS0 -a" will
provide configuration information for the port.

My little Serial.cpp class is now successfully writing to the port (as
proved by my son running Hyperterminal and receiving the sent
characters). However, receiving characters isn't yet working.
Neither his hyperterminal nor my sender (with a loopback plug) is
receiving.




Are you sure you enabled this in the kernel? It is under Device
Drivers > Character devices > Serial Drivers then enable these:


<*> 8250/16550 and compatible serial support
(4) Maximum number of 8250/16550 serial ports
(4) Number of 8250/16550 serial ports to register at runtime

At least that works for my dial-up modem and my UPS.

You may be able to put two instead of four but as I said, it works here
like this. I only have two ports tho.


Dale

:-) :-)
 
Old 12-26-2009, 02:13 AM
David Relson
 
Default serial port identification question

On Fri, 25 Dec 2009 16:56:00 -0600
Dale wrote:

...[snip]...

> Are you sure you enabled this in the kernel? It is under Device
> Drivers > Character devices > Serial Drivers then enable these:
>
> <*> 8250/16550 and compatible serial support
> (4) Maximum number of 8250/16550 serial ports
> (4) Number of 8250/16550 serial ports to register at runtime
>
> At least that works for my dial-up modem and my UPS.
>
> You may be able to put two instead of four but as I said, it works
> here like this. I only have two ports tho.
>
> Dale
>
> :-) :-)

Hello Dale,

My 32-bit gentoo system, which is the one in question, has the
following options set:

#
# Serial drivers
# CONFIG_SERIAL_8250=m
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_SERIAL_8250_PCI=m
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set

This should be sufficient to create /dev/ttyS0 thru /dev/ttyS3, though
they are not created.

(In truth NR_UARTS=2 is the proper value.)

Using MAKEDEV, I can manually create ttyS0 thru ttyS3.

Running "stty -f /dev/ttyS? -a" indicates that ttyS0 and ttyS1 are fine
while ttyS2 and ttyS3" gives:

stty: /dev/ttyS2: Input/output error
stty: /dev/ttyS3: Input/output error

Regards,

David
 
Old 12-26-2009, 04:44 PM
James
 
Default serial port identification question

David Relson <relson <at> osagesoftware.com> writes:


> How do I determine which devices correspond to the serial ports?

Well, there are lots of tricks. you can test manually by using
something like this:



echo "bla" > /dev/ttyS0

to a minicom session running on that port, for example.


Another tool to experiment with serial ports is
sys-apps/setserial.


Minicom is your friend for setting and then testing
various baud rates, port selections and parity too.


Something like this might help?

ls -l /dev/* | grep ttyS0



You gotta be more specific on your exact issue....


You can alway munge around in /dev, just for learning
about such minutia....

Oh, and you issue might be related to UDEV.....
Or the beautiful thing we call HAL....


hth,


James
 
Old 12-26-2009, 04:45 PM
James
 
Default serial port identification question

David Relson <relson <at> osagesoftware.com> writes:


> How do I determine which devices correspond to the serial ports?

Well, there are lots of tricks. you can test manually by using
something like this:



echo "bla" > /dev/ttyS0

to a minicom session running on that port, for example.


Another tool to experiment with serial ports is
sys-apps/setserial.


Minicom is your friend for setting and then testing
various baud rates, port selections and parity too.


Something like this might help?

ls -l /dev/* | grep ttyS0



You gotta be more specific on your exact issue....


You can alway munge around in /dev, just for learning
about such minutia....

Oh, and you issue might be related to UDEV.....
Or the beautiful thing we call HAL....


hth,


James
 
Old 12-27-2009, 11:34 AM
David Relson
 
Default serial port identification question

Hello James,

Thanks for writing. Lots of good information in your post!

I've working on porting some DOS code to Linux and (as you likely know)
the code needed for serial communications differs greatly between the 2
environments.

The initial problem was trying to identify COM1, COM2, etc from lots
of /dev/tty?? entries. There were no /dev/ttyS? entries. This was
solved thru googling and running MAKEDEV (for COM1, COM2, etc).

The second problem seems to be an odd pinout. The device has an RJ11
connector and came with an RJ11 to RS232 cable. The DB9 connector is
documented as TX on pin 2 and RX on pin 3 (which is normal).
Connecting a breakout box, indicated TX on pin 3. With a null-modem
and a loopback plug, send/receive started working using my program.

Send/receive was also verified using 2 terminal sessions and commands:

cat /dev/ttyS0
echo this is a test > /dev/ttyS0

The tip on setserial is appreciated. I learned of stty's -F ... -a
options, but didn't know of setserial.

Having solved/learned the above on the Gentoo box, the next trick is
getting my code to work on the embedded 486SX linux system (non-Gentoo).

So far I know that programmed setting of baud rate is working (as
confirmed with stty). However no data is being seen from the keypad
or the two connected preamps. They should all be continuously sending
data to com3, com2, and com4 (respectively).

The programming world is full of strange and wonderful problems to
solve, isn't it?

Regards,

David
 
Old 12-30-2009, 05:59 PM
James
 
Default serial port identification question

David Relson <relson <at> osagesoftware.com> writes:


> Having solved/learned the above on the Gentoo box, the next trick is
> getting my code to work on the embedded 486SX linux system (non-Gentoo).


There is a very exceptional collection of talent on the gentoo-embedded
list, that you cannot even image exists.... USE IT.....


> So far I know that programmed setting of baud rate is working (as
> confirmed with stty). However no data is being seen from the keypad
> or the two connected preamps. They should all be continuously sending
> data to com3, com2, and com4 (respectively).


I usally use a baseline system to ensure that the hardware/device is working
before trying on a new hardware platform. That way, you know your device
is working and your just trying to get a serial port on an embedded system
working.....


Also, you did not mention anything about PARITY and STOP BITS. Ensure that these
are set correctly, in addition to baud rate..

Serial ports usely need only 3 pins to work, tx, rx and ground. Google for
loopbacks and null modem configurations as there are lots of tricky versions...

Realize that serial ports can be build on a variety of hardware. 8250, 16550,
etc or 'bit-banged' on general I/O pins on a micro or a dedicated chip
in your hardwared. I do not have the "fogiest" idea what your hardware
actually is. Some PC board manufacturers have done amazingly funky things
over the years, like use a non standard baud rate to run a keyboard
(keypad) over a serial port. Over at emebedded-gentoo, exact state what
your hardware is what works and what you are trying to do. Make sure it's using
embedded gentoo, or that is the goal, or you'll just get 'punted' elsewhere.

CAVEAT EMPTOR.

Last, this is not the place for minutia on serial port devices.So move
over to the gentoo-embedded list for lost of folks, smarter than I?
(yes)......



James



If you are using a 'keypad' realize that they use s
 

Thread Tools




All times are GMT. The time now is 03:35 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org