Closed goranpop closed 5 years ago
Can you reply back with the results of running the following command:
cat /proc/tty/driver/serial
Thanks!
$ cat /proc/tty/driver/serial (show only 4 ports)
serinfo:1.0 driver revision: 0: uart:16550A port:000003F8 irq:4 tx:0 rx:0 1: uart:16550A port:000002F8 irq:3 tx:0 rx:0 2: uart:unknown port:000003E8 irq:4 3: uart:unknown port:000002E8 irq:3
$ ls-l /dev/ttyS* lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS0 -> /dev/ttyAP0 lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS1 -> /dev/ttyAP1 lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS2 -> /dev/ttyAP2 lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS3 -> /dev/ttyAP3 lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS4 -> /dev/ttyAP4 lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS5 -> /dev/ttyAP5 lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS6 -> /dev/ttyAP6 lrwxrwxrwx 1 root root 11 2018-10-29 19:44 /dev/ttyS7 -> /dev/ttyAP7
$ dmesg [ 90.770303] =============================================================== [ 90.770306] Advantech PCI-954/952/16C950 Device Drivers. V3.40 [06/12/2014] [ 90.770309] Supports: RS232/422/485 auto detection and setting [ 90.770311] Devices: UNO: UNO2050 [COM3/COM4] [ 90.770313] UNO2059 [COM1~COM4] [ 90.770314] UNOB-2201CB [COM1~COM8] [ 90.770316] UNOB-2176 [COM1~COM4] [ 90.770318] UNO-1150 [COM2/COM3] [ 90.770320] UNO-2679 [COM3~COM6] [ 90.770322] UNO-4672 [COM3~COM10] [ 90.770324] ICOM: PCI-1601, PCI-1602 [ 90.770325] PCI-1603, PCI-1604 [ 90.770326] PCI-1610, PCI-1611 [ 90.770327] PCI-1612 [ 90.770328] PCI-1620, PCI-1622 [ 90.770330] MIC: MIC-3611, MIC-3612 [ 90.770332] MIC-3620, MIC-3621 [ 90.770334] PCM: PCM-3614P/I, PCM-3641P/I [ 90.770336] PCM-3618P/I, PCM-3681P/I [ 90.770338] General: A001, A002, A004 [ 90.770340] A101, A102, A104 [ 90.770341] F001, F002, F004 [ 90.770343] F101, F102, F104 [ 90.770345] A202, A304, A408 [ 90.770347] Advantech Industrial Automation Group. [ 90.770349] =============================================================== [ 90.809392] advserial 0000:04:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17 [ 90.809396] PCI-1620, function 0, port 0, RS232 [ 90.809466] ttyAP0 at I/O 0xec00 (irq = 17) is a 16C950/954 [ 90.809470] PCI-1620, function 0, port 1, RS232 [ 90.809530] ttyAP1 at I/O 0xec08 (irq = 17) is a 16C950/954 [ 90.809533] PCI-1620, function 0, port 2, RS232 [ 90.809593] ttyAP2 at I/O 0xec10 (irq = 17) is a 16C950/954 [ 90.809597] PCI-1620, function 0, port 3, RS232 [ 90.809656] ttyAP3 at I/O 0xec18 (irq = 17) is a 16C950/954 [ 90.809665] PCI-1620, function 1, port 0, RS232 [ 90.809733] ttyAP4 at I/O 0xe400 (irq = 17) is a 16C950/954 [ 90.809737] PCI-1620, function 1, port 1, RS232 [ 90.809805] ttyAP5 at I/O 0xe408 (irq = 17) is a 16C950/954 [ 90.809809] PCI-1620, function 1, port 2, RS232 [ 90.809876] ttyAP6 at I/O 0xe410 (irq = 17) is a 16C950/954 [ 90.809880] PCI-1620, function 1, port 3, RS232 [ 90.809947] ttyAP7 at I/O 0xe418 (irq = 17) is a 16C950/954
Thanks for the detailed output...that was extremely helpful! It looks like the Advantech card isn't registering itself as a serial port driver in the same way that Linux is expecting. I added a force search for Advantech-specific ports, so please try the following library version and see if it works for you:
https://www.dropbox.com/s/hr7rz9atz4gh593/jSerialComm-2.4.0.jar?dl=0
If so, please comment back.
It's working, thank you very much. It was essential for me to leave rxtx old lib.
No problem. This fix will be included in the upcoming 2.4.0 release.
On linux i have 8 ports RS232 card and see only 4 ttyS[0,1,2,3]. Is there any config param that i have to set or ?
I found the first problem. Driver in Advantec card was old. Now open and close port is working when i use SerialPort.getCommPort("/dev/ttyS7").
But SerialPort.getCommPorts() still list only 4 ports.