Sériové rozhraní

Implementace RS-232 pod OS Linux
Implementace USB pod OS Linux
Implementace FireWire pod OS Linux
Implementace IrDa pod OS Linux
Implementace extern SATA pod OS Linux
subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link

IrDa

Konfigurace rozhraní IrDA je značně závislá na použitém hardwaru. IrDA port může být interní (integrovaný na motherboardu) nebo externí (připojuje se na USB nebo sériový port). Následující popis konfigurace platí pro interní IrDA port. Při konfiguraci externího portu odpadá konfigurace BIOSu a v kernelu navíc musíte mít podporu pro použité externí zařízení.

U interního IrDA portu nezapomente na konfiguraci BIOSu. Například u mého notebooku konfigurace vypadá následovně:

Onboard Serial PortB2F8/COM2
Serial Port2 ModeIrDA
IR Duplex ModeFull Duplex

Pro komunikaci přes IrDA je třeba mít nainstalován program irattach, který je součástí balíku irda-utils, a kernel s podporou IrDA. Pokud váš kernel neobsahuje podporu IrDA, přeložte si jej s následujícími volbami:

#
# IrDA (infrared) support
#
CONFIG_IRDA=m
CONFIG_IRCOMM=m
CONFIG_IRDA_ULTRA=y
CONFIG_IRDA_CACHE_LAST_LSAP=y
CONFIG_IRDA_FAST_RR=y
CONFIG_IRDA_DEBUG=y
#
# Infrared-port device drivers
#
CONFIG_IRTTY_SIR=m

Pokud používáte distribuci Red Hat, tak do konfiguračního souboru /etc/sysconfig/irda doplňte název sériového portu, na kterém je IrDA a spusťte /etc/rc.d/init.d/irda start. V opačném případě spusťte /usr/sbin/irattach /dev/ttySx -s.

Nyní je IrDA připraveno. A pro jeho použití využijte zařízení /dev/ircomm0. I v tomto případě platí doporučení o pořadí inicializace spojení.Nejdříve inicializujte externí zařízení a pak teprve PC.

Linux and IrDA (Anglická dokumentace)

Support knowledgebase (irda)

Request

You'd like to connect a deivce using an infra-red port.

Background

Almost all Laptops and some peripheral equipment include an infra-red port for wireless communication. The IrDA Protocol from the Infrared Data Association has become the standard for communication using these devices.

Information on the implementation of the IrDA protocol in Linux can be found under http://www.cs.uit.no/linux-irda/. Detailed information can also be found under http://www.snafu.de/~wehe/IR-HOWTO.htm, the IrDA HOWTO.

Almost all infra-red ports that are built into a PC can be addressed in the same way as a serial port. This means that the Linux serial-port driver detects the port and configures it as it does any other serial port on a computer. The infra-red port can be used thanks to an extra kernel-module which accesses the serial-port driver. The communication between most devices that use the IrDA protocol is supported under Linux. Better put...the following protocols are supported:

IrCOMM - Emulates a serial port. The driver in the Linux kernel creates a simulated serial port, /dev/ircomm0 which enables communication with a device using using almost any program, for example minicom or even pppd. For instance, the Siemens S25 Mobile telephone and the program wvdial can be used to connect to the Internet.

IrLPT or Printer - Emulates a parallel port. The driver in the kernel simulates a parallel port /dev/irlpt0 that is addressable in almost the same manner as a normal, "wired" pinter-port /dev/lp0. A printer connected with an infra-red port is addressed in the same manner as a normal printer except that the name of the port is different.

IrLAN - Using this protocol 2 or more computers can be networked. Unfortunately the kernel driver is still experimental. A network port is simulated, irlan0, which is configurable using ifconfig/route in the same manner as the eth0 port.

IrOBEX - This protocol is supported by Palmtops and other so-called hand-held computers. Support of this protocol is provided under Linux by different programs.

Prerequisites

Infra-red support is included since SuSE 6.3. The preconfigured package irda includes programs which can integrate most infra-red ports using an UART compatable SIR infra-red port. All necessary modules needed by the kernel cna be found in the kernmod package.

Configuring the Port

Check to see which I/O address and IRQ interrupt your infra-red port is using. /dev/ttyS1 and Interrupt 3 are default settings (which means the I/O address 0x2f8.If these prerequisites are filled you can begin. IrDA is started with the command rcirda start. After starting you can check if everything is running correctly with irdadump. If everything goes as planned you should receive the following monitor-output every 3 seconds:

erda:~ # irdadump

13:42:57.118679 xid:cmd d04496e2 > ffffffff S=6 s=0 (14)

13:42:57.208957 xid:cmd d04496e2 > ffffffff S=6 s=1 (14)

13:42:57.298645 xid:cmd d04496e2 > ffffffff S=6 s=2 (14)

13:42:57.388923 xid:cmd d04496e2 > ffffffff S=6 s=3 (14)

13:42:57.478670 xid:cmd d04496e2 > ffffffff S=6 s=4 (14)

13:42:57.568914 xid:cmd d04496e2 > ffffffff S=6 s=5 (14)

13:42:57.658705 xid:cmd d04496e2 > ffffffff S=6 s=* erde hint=0500 [ PnP Computer ] (23)

These are the so-called Discovery packages. (exchange station identification frame - therefore `xid'). When another device with an infra-red port is brought in view the "xid" packages should be returned, which looks like:

09:12:56.756986 xid:cmd 84663133 > ffffffff S=6 s=0 (14)

09:12:56.846938 xid:cmd 84663133 > ffffffff S=6 s=1 (14)

09:12:56.936963 xid:cmd 84663133 > ffffffff S=6 s=2 (14)

09:12:57.026938 xid:cmd 84663133 > ffffffff S=6 s=3 (14)

09:12:57.116931 xid:cmd 84663133 > ffffffff S=6 s=4 (14)

09:12:57.206934 xid:cmd 84663133 > ffffffff S=6 s=5 (14)

09:12:57.286939 xid:rsp 84663133 < 556ecd9e S=6 s=5 BJC-80 hint=8804 [ Printer IrCOMM ] (23)

09:12:57.296982 xid:cmd 84663133 > ffffffff S=6 s=* erde hint=0500 [ PnP Computer ] (23)

If this second device doesn't receive a signal compare the hardware settings (I/O Address, Interrupts) of the laptop to those found in the file /etc/rc.config. the variables to look for are IRDA_PORT, the serial port in use, and IRDA_IRQ which listgs the interrupt.

The output of irdadump also shows which protocols the peripheral device supports. In the example above the device "BJC-80" supports both Printer and IrCOMM. In this case the device could be addressed as a printer over the serial port /dev/irlpt0.

If you'd like to start the IrDA support at boot set the variable "START_IRDA" in the file /etc/rc.config to yes. Configuring a printer with IrDA support If the test above was succesfull you can configure your printer using YaST:

Start YaST. Choose menu item System Administration --> / Integrate Hardware into System --> / Configure Printer.

Configure the printer as normal. Choose Attached to Port: Parallel Port and Device Name: /dev/irlpt0

After configuration restart the printer-service with the command rclpd restart, after which you should be able to print normally.Configuring a Modem Connection (Example with a Cellular Telephone) Enter the following commands to use the modem in a cellular telephone:

rm /dev/modem

ln -s /dev/ircomm0 /dev/modem

After this you should be able to connect using minicom or wvdial. Configure the modem as given in the handbook for normal serial-port modems. Please check the compatability-list found under http://www.cs.uit.no/linux-irda/hardware.html to see if your modem can be used under Linux.Exchanging Data between Linux Computers. Exchanging data between Linux Computers is normally accomplished with the IrLAN protocol. Although sometimes this process has problems auto-detecting the communication partners.The most reliable method is to use the PPP protocol over a simulated serial port. Place two computers in view of one another and start the PPP daemon on one computer, for example with the following command:

erde:~# pppd /dev/ircomm0 10.0.0.1:10.0.0.2

On the other computer start pppd as follows:

sonne:~# pppd /dev/ircomm0

With this a PPP connection is made between two computers over an infra-red port simulating a serial port. The computer "sonne" is given the IP Address 10.0.0.2 from the computer "erde" (which has the IP Address 10.0.0.1, given by the PPP interface). In short, you can reach the computer "erde" from the computer "sonne" (with the IP Address 10.0.0.1) using normal network-communication programs like ssh, telnet, ftp, nfs...etc.

Pripojeni mobilniho telefonu Nokia 6510 k PC pres infraport.

Nize popsany navodu funguje s nize uvedenym hardwarem a softwarem a slouzi spise k tomu, abych to priste zase nemusel slozite hledat. Neni to dokonale HOWTO, ale funguje to a snad to bude i nekomu k uzitku.
Zprovozneni pripojeni k netu budu resit v budoucnu, zatim jsem rad, ze jsem pochopil tohle :o).

Hardware:
Motherboard Tekram P5MVP, VIA Apollo MVP3 chipset, infracerveny modul TFDU 4100 + par soucastek (navody pro stavbu a pripojeni k desce na netu)
Nokia 6510, prekvapive...

Software:
Linux kernel 2.6.0, Slackware 9.1.0
irda-utils-0.9.15
gnokii-0.5.7
gammu-0.91.0
Infrared-HOWTO z balicku linux-howtos-20030907-noarch-1
nejake archivy mailovych konferenci, jejichz jmena nejsou dulezita, protoze nijak zasadne nepomohly...

Nejdrive bude nutne zkompilovat jadro s podporou IrDA, pokud takove nevlastnite. Zde uvadim cast meho config-u:

#
# IrDA (infrared) support
#
CONFIG_IRDA=m

#
# IrDA protocols
#
CONFIG_IRLAN=m
CONFIG_IRNET=m
CONFIG_IRCOMM=m
CONFIG_IRDA_ULTRA=y

#
# IrDA options
#
CONFIG_IRDA_CACHE_LAST_LSAP=y
CONFIG_IRDA_FAST_RR=y
CONFIG_IRDA_DEBUG=y

#
# Infrared-port device drivers
#

#
# SIR device drivers
#
CONFIG_IRTTY_SIR=m

#
# Dongle support
#
CONFIG_DONGLE=y
CONFIG_ESI_DONGLE=m
CONFIG_ACTISYS_DONGLE=m
CONFIG_TEKRAM_DONGLE=m

#
# Old SIR device drivers
#
CONFIG_IRPORT_SIR=m

#
# Old Serial dongle support
#
# CONFIG_DONGLE_OLD is not set

#
# FIR device drivers
#
CONFIG_USB_IRDA=m
# CONFIG_NSC_FIR is not set
# CONFIG_WINBOND_FIR is not set
# CONFIG_TOSHIBA_FIR is not set
# CONFIG_SMC_IRCC_FIR is not set
# CONFIG_ALI_FIR is not set
# CONFIG_VLSI_FIR is not set
CONFIG_VIA_FIR=m

Netvrdim, ze je nutne mit tam tohle vsechno, priznavam se, ze kdyz jsem to kompiloval, netusil jsem jeste, co vsechno z toho budu potrebovat a co ne... Nezapomente na podporu seriovych portu. Kompilaci jadra a instalaci modulu popisovat nebudu. To je jina kapitola, predpokladam, ze ctenar zvlada.

Po nainstalovani noveho jadra a behem rebootu mrknete do BIOSu, ja mam v sekci Integrated peripherials nasledujici nastaveni:
Onboard Serial Port 1 - Auto
Onboard Serial Port 2 - Auto
InfraRed/COM2 Selected - IrDA SIR

Ulozime, nabootujeme nove jadro a mame dve moznosti: bud mame podporu napevno v jadre nebo budeme muset natahnout potrebne moduly:
modprobe irport
modprobe irtty-sir - jak tak koukam, tak tohle nejspis ani neni potreba...

Instalace irda-utils se, tusim, sklada pouze z prikazu make all a make install. Instalace gammu ci gnokii by take nemela prinest zavaznejsi problemy, postupy jsou obvykle, kazdy z nas prece zacina ./configure --help :o). Dale je nutne cerstve zkompilovany software nakonfigurovat. Neobtezoval jsem se resit zprovozneni gnokii ci gammu pro jine uzivatele nez roota, tudiz uvedu strucne konfigurace souboru /root/.gnokiirc a /root/.gammurc

.gnokiirc
[global]
port = /dev/ttyS1
model = 6510
initlength = default
connection = irda
bindir = /usr/local/sbin/
use_locking = no
serial_baudrate = 9600
smsc_timeout = 10
[connect_script]
TELEPHONE = 12345678
[disconnect_script]

.gammurc
[gammu]

port = irda:
model = 6510
connection = irda
#synchronizetime = yes
#logfile = gammulog
#logformat = textall
#use_locking = yes
#gammuloc = locfile
#startinfo = yes
#gammucoding = utf8

Nyni uz staci pouze irattach /dev/ttyS1 -s, aktivovat Infracerveny prijem v telefonu a vse by melo fungovat. Natahovani modulu a test spojeni jsem si trochu automatizoval ve skriptu iractivate:

#!/bin/sh
echo "Zavadim modul irport..."
modprobe irport
echo "Zavadim modul irtty-sir..."
modprobe irtty-sir
echo "Pripojuji k /dev/ttyS1..."
irattach /dev/ttyS1 -s
echo""
echo "Identifikuji typ telefonu..."
gnokii --identify
echo""
echo "Identifikuji operatora..."
gnokii --getnetworkinfo

About Us | Site Map | Privacy Policy | Contact Us | ©2003 Company Name