Användarverktyg

Webbverktyg


serieportar

Lägga till fler serieportar

Serieports kort, som inte dyker upp automagiskt i Ubuntu Server. Man kan se kortet med ”lspci”:

00:00.0 Host bridge: Intel Corporation 82815 815 Chipset Host Bridge and Memory Controller Hub (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 82815 Chipset Graphics Controller (CGC) (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801AA PCI Bridge (rev 02)
00:1f.0 ISA bridge: Intel Corporation 82801AA ISA Bridge (LPC) (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801AA IDE Controller (rev 02)
00:1f.2 USB Controller: Intel Corporation 82801AA USB Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801AA SMBus Controller (rev 02)
00:1f.5 Multimedia audio controller: Intel Corporation 82801AA AC'97 Audio Controller (rev 02)
01:00.0 Serial controller: Timedia Technology Co Ltd PCI2S550 (Dual 16550 UART) (rev 01)
01:01.0 Serial controller: NetMos Technology PCI 9865 Multi-I/O Controller
01:01.1 Serial controller: NetMos Technology PCI 9865 Multi-I/O Controller
01:01.2 Communication controller: NetMos Technology PCI 9865 Multi-I/O Controller
01:02.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
01:04.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78)

Men det dyker inte upp några device, /dev/ttySxxx. Den nedan är redan befintliga serieportar, två stycken på moderkort och två på annat externt PCI kort.

sm3sgp@fernebo:~$ dmesg | grep tty
[    0.000000] console [tty0] enabled
[    0.413560] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    0.413718] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[    0.415409] 00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[    0.415686] 00:0a: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
[    0.416708] 0000:01:00.0: ttyS4 at I/O 0x2480 (irq = 11) is a 16550A
[    0.470012] 0000:01:00.0: ttyS5 at I/O 0x2488 (irq = 11) is a 16550A

För att enabla fler portar i kärnan krävs att man ger en boot option, 8250.nr_uarts=16. Editera menus.lst för grub:

# kopt=root=UUID=xxxxxxxxxxxxxxx ro 8250.nr_uarts=16

Observera att # ska vara kvar. Man ska nu se flera ttySxxx under /dev

sm3sgp@fernebo:/etc/rcS.d$ ls -l /dev/ttyS*
crw-rw---- 1 root dialout 4, 64 2010-08-08 14:30 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2010-08-08 14:30 /dev/ttyS1
crw-rw---- 1 root dialout 4, 74 2010-08-08 14:30 /dev/ttyS10
crw-rw---- 1 root dialout 4, 75 2010-08-08 14:30 /dev/ttyS11
crw-rw---- 1 root dialout 4, 76 2010-08-08 14:30 /dev/ttyS12
crw-rw---- 1 root dialout 4, 77 2010-08-08 14:30 /dev/ttyS13
crw-rw---- 1 root dialout 4, 78 2010-08-08 14:30 /dev/ttyS14
crw-rw---- 1 root dialout 4, 79 2010-08-08 14:30 /dev/ttyS15
crw-rw---- 1 root dialout 4, 66 2010-08-08 14:30 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 2010-08-08 14:30 /dev/ttyS3
crw-rw---- 1 root dialout 4, 68 2010-08-08 14:30 /dev/ttyS4
crw-rw---- 1 root dialout 4, 69 2010-08-08 14:30 /dev/ttyS5
crw-rw---- 1 root dialout 4, 70 2010-08-08 15:02 /dev/ttyS6
crw-rw---- 1 root dialout 4, 71 2010-08-08 14:30 /dev/ttyS7
crw-rw---- 1 root dialout 4, 72 2010-08-08 14:30 /dev/ttyS8
crw-rw---- 1 root dialout 4, 73 2010-08-08 14:30 /dev/ttyS9

Använd setserial för att aktivera portarna:

 sudo setserial /dev/ttyS9 port 0x24c0 UART 16550A irq 10 Baud_base 115200

Dessa portar är använda.

01:01.2 Communication controller: NetMos Technology PCI 9865 Multi-I/O Controller
      Subsystem: Device a000:3002
      Flags: medium devsel, IRQ 10
      I/O ports at 24d8 [size=8]
      I/O ports at 24d0 [size=8]
      I/O ports at 24c8 [size=8]
      I/O ports at 24c0 [size=8]
      Memory at ec104000 (32-bit, non-prefetchable) [size=4K]
      Capabilities: <access denied>

Konfigurera start skriptet för setserial

Ändra till manuell konfigurering:

sudo dpkg-reconfigure setserial

Editera /var/lib/setserial/autoserial.conf med följande:

/dev/ttyS0 uart 16550A port 0x03f8 irq 4 baud_base 115200 spd_normal skip_test
/dev/ttyS1 uart 16550A port 0x02f8 irq 3 baud_base 115200 spd_normal skip_test
/dev/ttyS2 uart 16550A port 0x24c8 irq 5 baud_base 115200 spd_normal skip_test
/dev/ttyS3 uart 16550A port 0x24c0 irq 5 baud_base 115200 spd_normal skip_test
/dev/ttyS4 uart 16550A port 0x24b8 irq 5 baud_base 115200 spd_normal skip_test
/dev/ttyS5 uart 16550A port 0x24b0 irq 5 baud_base 115200 spd_normal skip_test
/dev/ttyS6 uart 16550A port 0x2480 irq 5 baud_base 921600 spd_normal skip_test
/dev/ttyS7 uart 16550A port 0x2488 irq 5 baud_base 921600 spd_normal skip_test

Kopiera /var/lib/setserial/autoserial.conf till serial.conf

sudo cp /var/lib/setserial/autoserial.conf /etc/serial.conf

http://swiss.ubuntuforums.org/showthread.php?p=1951593

https://help.ubuntu.com/community/InstallLirc/Gutsy

/var/www/html/dokuwiki/data/pages/serieportar.txt · Senast uppdaterad: 2017/03/28 19:33 (extern redigering)