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.
|
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
|
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?
|
........try:
man ttys but did you not try with the onboard ports enabled?? |
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" |
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 |
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 |
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 |
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:
|
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 |
did you try creating the additional device nodes as mentioned in a previous reply in this thread ?
Follow the links I posted.... |
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? |
man ttyS
Code:
ttyS[0-3] are character devices for the serial terminal lines. 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 |
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. |
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.
|
All times are GMT -5. The time now is 12:37 AM. |