public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] serial port identification question
@ 2009-12-25 18:12 David Relson
  2009-12-25 20:10 ` Dale
  2009-12-26 17:45 ` [gentoo-user] " James
  0 siblings, 2 replies; 9+ messages in thread
From: David Relson @ 2009-12-25 18:12 UTC (permalink / raw
  To: gentoo-user

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] serial port identification question
  2009-12-25 18:12 [gentoo-user] serial port identification question David Relson
@ 2009-12-25 20:10 ` Dale
  2009-12-25 20:49   ` David Relson
  2009-12-26 17:45 ` [gentoo-user] " James
  1 sibling, 1 reply; 9+ messages in thread
From: Dale @ 2009-12-25 20:10 UTC (permalink / raw
  To: gentoo-user

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

:-)  :-) 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] serial port identification question
  2009-12-25 20:10 ` Dale
@ 2009-12-25 20:49   ` David Relson
  2009-12-25 22:56     ` Dale
  0 siblings, 1 reply; 9+ messages in thread
From: David Relson @ 2009-12-25 20:49 UTC (permalink / raw
  To: gentoo-user

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.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] serial port identification question
  2009-12-25 20:49   ` David Relson
@ 2009-12-25 22:56     ` Dale
  2009-12-26  3:13       ` David Relson
  0 siblings, 1 reply; 9+ messages in thread
From: Dale @ 2009-12-25 22:56 UTC (permalink / raw
  To: gentoo-user

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

:-)  :-)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] serial port identification question
  2009-12-25 22:56     ` Dale
@ 2009-12-26  3:13       ` David Relson
  0 siblings, 0 replies; 9+ messages in thread
From: David Relson @ 2009-12-26  3:13 UTC (permalink / raw
  To: gentoo-user; +Cc: rdalek1967

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user]  Re: serial port identification question
  2009-12-26 17:45 ` [gentoo-user] " James
@ 2009-12-26 17:44   ` James
  2009-12-27 12:34   ` David Relson
  1 sibling, 0 replies; 9+ messages in thread
From: James @ 2009-12-26 17:44 UTC (permalink / raw
  To: gentoo-user

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








^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user]  Re: serial port identification question
  2009-12-25 18:12 [gentoo-user] serial port identification question David Relson
  2009-12-25 20:10 ` Dale
@ 2009-12-26 17:45 ` James
  2009-12-26 17:44   ` James
  2009-12-27 12:34   ` David Relson
  1 sibling, 2 replies; 9+ messages in thread
From: James @ 2009-12-26 17:45 UTC (permalink / raw
  To: gentoo-user

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








^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user]  Re: serial port identification question
  2009-12-26 17:45 ` [gentoo-user] " James
  2009-12-26 17:44   ` James
@ 2009-12-27 12:34   ` David Relson
  2009-12-30 18:59     ` James
  1 sibling, 1 reply; 9+ messages in thread
From: David Relson @ 2009-12-27 12:34 UTC (permalink / raw
  To: gentoo-user; +Cc: wireless

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user]  Re: serial port identification question
  2009-12-27 12:34   ` David Relson
@ 2009-12-30 18:59     ` James
  0 siblings, 0 replies; 9+ messages in thread
From: James @ 2009-12-30 18:59 UTC (permalink / raw
  To: gentoo-user

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-12-30 19:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-25 18:12 [gentoo-user] serial port identification question David Relson
2009-12-25 20:10 ` Dale
2009-12-25 20:49   ` David Relson
2009-12-25 22:56     ` Dale
2009-12-26  3:13       ` David Relson
2009-12-26 17:45 ` [gentoo-user] " James
2009-12-26 17:44   ` James
2009-12-27 12:34   ` David Relson
2009-12-30 18:59     ` James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox