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 09-20-2007, 11:19 PM   #1
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Rep: Reputation: 15
more then 4 serial ports


the project I'm doing needs a lot of serial ports. I have 2 on the motherboard, but they were used up very fast. I got a 6 serial port pci card to use, totaling at 8 serial ports. all I knew about the card was that it supports linux. I go into the readme files on the drivers cd and it says "Since Linux only support 4 serial ports (ttyS0, ttyS1, ttyS2, ttyS3) under the default condition." okay.. how do I change that in linux? I need all 8 ports available, not just the first 4. I'm currently running fedora 7 on my development machine, but I might be using centos for the final server setup. any help would be great. I've been searching, but not finding what I'm looking for. I may be searching with the wrong keywords.
 
Old 09-20-2007, 11:41 PM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Step one: plug the card in and see what happens. I have seen multi serial cards work out of the box. The devices are created as /dev/tty/x

Last edited by Simon Bridge; 09-20-2007 at 11:44 PM.
 
Old 09-21-2007, 01:03 AM   #3
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
I disabled the on board serial ports to simplify things a bit more. I'm not sure if linux enables them again on it's own, but either way, I have ttyS0 ttyS1 ttyS2 ttyS3 . tty isn't a directory so I can't go in it. I'm not sure what it is on this system. if all of the serial ports were working, there should be 6 of them, plus the 2 on board that are disabled. is there a setting in the kernel for this or something? to allow more then 4 ports?
 
Old 09-21-2007, 02:46 AM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
........try:
man ttys

but did you not try with the onboard ports enabled??
 
Old 09-21-2007, 10:11 AM   #5
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
with the onboard ports enabled, it was still showing up as 4 ports. I'm not sure what port is what yet, but I'd like to get them all installed first.

I read the manual you said about "man tty" but it doesn't say much. it returns "/dev/pts/0"
 
Old 09-21-2007, 10:28 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
lspci to see if the system can see the board properly..
lshw would give more detailed hardware info..

if udev doesn't create the serial device nodes for you automatically, you should be able to manually create them.

http://www.linux.org/docs/ldp/howto/...tml#make_multi

http://www.linux.org/docs/ldp/howto/...-HOWTO-11.html
 
Old 09-21-2007, 10:49 AM   #7
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
here's what I got for those 2 commands

02:0c.0 Serial controller: NetMos Technology PCI 1 port parallel adapter (rev 01)

*-communication
description: Serial controller
product: PCI 9845 Multi-I/O Controller
vendor: NetMos Technology
physical id: c
bus info: pci@0000:02:0c.0
version: 01
width: 32 bits
clock: 33MHz
capabilities: 16550
configuration: driver=serial latency=64
 
Old 09-21-2007, 11:42 AM   #8
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
I have a simple program I wrote in c to send commands to a serial port. it was working well with the onboard ports, but now that I disabled those and only have the card installed, it's failing to open ports. I have tried the setserial command, but I'm still learning a lot with linux. not sure what I could be doing wrong, but something's not right.

[root@localhost serial]# ./serial
Serial_Init:: tcgetattr() failed
SendByte() failed
 
Old 09-21-2007, 11:51 PM   #9
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
with the onboard disabled and the card installed what o you get from teh following command ? (curious to see what the OS thinks of those ports at boot time)

Quote:
debianetch:/# cat /var/log/dmesg | grep ttyS
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
 
Old 09-22-2007, 01:02 AM   #10
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
looks like it sees only 4 ports. there has to be a setting someplace or a patch or kernel module to allow the other 4 ports to work.


[root@localhost ~]# cat /var/log/dmesg | grep ttyS
0000:02:0c.0: ttyS0 at I/O 0xdff0 (irq = 9) is a 16550A
0000:02:0c.0: ttyS1 at I/O 0xdfe0 (irq = 9) is a 16550A
0000:02:0c.0: ttyS2 at I/O 0xdfa8 (irq = 9) is a 16550A
0000:02:0c.0: ttyS3 at I/O 0xdfa0 (irq = 9) is a 16550A
 
Old 09-23-2007, 01:08 AM   #11
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
did you try creating the additional device nodes as mentioned in a previous reply in this thread ?
Follow the links I posted....

Last edited by farslayer; 09-23-2007 at 01:09 AM.
 
Old 09-23-2007, 02:16 AM   #12
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
this is the command I tried:
mknod /dev/ttyS4 -m 666 c 4 64

it looks like it created it under /dev and my c program can open the port and write to it without errors, but I'm still not getting any output out of the physical port. I don't understand what the major and minor numbers are for. 4 and 64? is that what they should be to point to the right hardware?
 
Old 09-23-2007, 03:12 AM   #13
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
man ttyS

Code:
 ttyS[0-3] are character devices for the serial terminal lines.

       They are typically created by:

              mknod -m 660 /dev/ttyS0 c 4 64 # base address 0x3f8
              mknod -m 660 /dev/ttyS1 c 4 65 # base address 0x2f8
              mknod -m 660 /dev/ttyS2 c 4 66 # base address 0x3e8
              mknod -m 660 /dev/ttyS3 c 4 67 # base address 0x2e8
              chown root:tty /dev/ttyS[0-3]
The "major" number is always 4 for ttyS devices.
For ttyS serial ports the minor number is: 64 + port number.


so you need to use 68, 69, 70 & 71 when adding the additional ports

MAKEDEV may be easier to use than mknod

man MAKEDEV

MAKEDEV ttyS4
MAKEDEV ttyS5
MAKEDEV ttyS6
MAKEDEV ttyS7

Last edited by farslayer; 09-23-2007 at 03:24 AM.
 
Old 09-23-2007, 03:38 AM   #14
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
ooh, thank you for explaining that. now it sounds like it will work. I'm just finishing up a fresh install of centos on my development system. I will try it and let you know how it goes.

btw, I used mknod because MAKEDEV wasn't installed. I will check yum for it and see if I can install it.
 
Old 09-23-2007, 04:13 AM   #15
mattsoftnet
Member
 
Registered: Jan 2006
Posts: 120

Original Poster
Rep: Reputation: 15
centos found the serial card and installed all 8 ports, including the 2 on the motherboard I'm guessing. I haven't tried the motherboard 2 lately, but the ports on the card aren't giving any errors when I open them or send data to them, but the device I'm using has a led on it that turns on or off when it gets a command, and it's not working yet. the device has to run at 9600 baud rate. I think that might be where the problem is. maybe this card gets it's settings differently or something. I still don't understand c completely yet, but I'll keep working at it. tomorrow I'll try connecting the ports on the card to my windows computer and see if I can get any signals with the hyperterminal.
 
  


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
serial ports pricej DamnSmallLinux 1 02-03-2006 03:21 AM
Can only use one of my serial ports steaktc Linux - Hardware 1 11-23-2005 06:07 AM
serial ports / camera help dive Slackware 5 07-11-2005 06:00 PM
need extra serial ports iansworld Linux - Hardware 0 02-17-2005 02:27 PM
Serial ports KenHorse Programming 2 12-27-2004 08:49 AM

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

All times are GMT -5. The time now is 04:15 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
Open Source Consulting | Domain Registration