个人工具

“UbuntuHelp:IrdaHowto”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的5个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:IrdaHowto}}
 
{{Languages|UbuntuHelp:IrdaHowto}}
 
#title Using IrDA infrared devices
 
#title Using IrDA infrared devices
 
 
This document outlines how to get IrDA infrared connections working with Ubuntu 5.04 and the FIR driver. This procedure also works for Ubuntu Breezy development release colony 3. It is unknown if these instructions apply to later versions of Ubuntu.
 
This document outlines how to get IrDA infrared connections working with Ubuntu 5.04 and the FIR driver. This procedure also works for Ubuntu Breezy development release colony 3. It is unknown if these instructions apply to later versions of Ubuntu.
 +
Working in FIR mode with (k)ubuntu 8.10 - Toshiba laptop, smsc-ircc device with "no" BIOS setting for IrDA. Setup is similar. See smsc-ircc2.
 +
<ol><li>Install the ''irda-utils'' and ''setserial'' packages from the Universe repository
 +
</li><li>Ensure that infrared/IrDA is enabled in your BIOS; if not, enable it and reboot. Your computer's BIOS manual should have instructions on enabling infrared.
 +
</li><li>Open a Terminal and type: <code><nowiki>sudo gedit /etc/default/irda-utils</nowiki></code>
 +
</li><li>Change the line reading <code><nowiki>DEVICE="/dev/ttyS1"</nowiki></code> to <code><nowiki>DEVICE="irda0"</nowiki></code>
 +
</li><li>Change the line reading <code><nowiki>SETSERIAL=""</nowiki></code> to <code><nowiki>SETSERIAL="/dev/ttyS1"</nowiki></code>
 +
</li><li>Save the file and then open the <code><nowiki>/etc/modprobe.d/irda-utils</nowiki></code> file.
 +
</li><li>Add the following two lines to the end of the file:</li></ol>
  
* Install the ''irda-utils'' and ''setserial'' packages from the Universe repository
 
* Ensure that infrared/IrDA is enabled in your BIOS; if not, enable it and reboot. Your computer's BIOS manual should have instructions on enabling infrared.
 
* Open a Terminal and type: <code><nowiki>sudo gedit /etc/default/irda-utils</nowiki></code>
 
* Change the line reading <code><nowiki>DEVICE="/dev/ttyS1"</nowiki></code> to <code><nowiki>DEVICE="irda0"</nowiki></code>
 
* Change the line reading <code><nowiki>SETSERIAL=""</nowiki></code> to <code><nowiki>SETSERIAL="/dev/ttyS1"</nowiki></code>
 
* Save the file and then open the <code><nowiki>/etc/modprobe.d/irda-utils</nowiki></code> file.
 
* Add the following two lines to the end of the file:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
alias irda0 nsc-ircc
 
alias irda0 nsc-ircc
 
options nsc-ircc dongle_id=0x09
 
options nsc-ircc dongle_id=0x09
 
</nowiki></pre>
 
</nowiki></pre>
*#8 Save the file and then open the <code><nowiki>/etc/modules</nowiki></code> file.
+
1.#8 Save the file and then open the <code><nowiki>/etc/modules</nowiki></code> file.
* Add the following line to the end of the file: <code><nowiki>ircomm-tty</nowiki></code>
+
<ol><li>Add the following line to the end of the file: <code><nowiki>ircomm-tty</nowiki></code>
* Save the file and exit the text editor.
+
</li><li>Save the file and exit the text editor.
* To restart <code><nowiki>irda</nowiki></code>, open a Terminal and type:
+
</li><li>To restart <code><nowiki>irda</nowiki></code>, open a Terminal and type:</li></ol>
 +
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo /etc/init.d/irda-utils stop
 
sudo /etc/init.d/irda-utils stop
 
sudo /etc/init.d/irda-utils start
 
sudo /etc/init.d/irda-utils start
 
</nowiki></pre>
 
</nowiki></pre>
*#12 To load the FIR IRDA driver, type: <code><nowiki>sudo modprobe irda0</nowiki></code>
+
1.#12 To load the FIR IRDA driver, type: <code><nowiki>sudo modprobe irda0</nowiki></code>
* To load the the ircomm-tty module, type: <code><nowiki>sudo modprobe ircomm-tty</nowiki></code>
+
<ol><li>To load the the ircomm-tty module, type: <code><nowiki>sudo modprobe ircomm-tty</nowiki></code></li></ol>
  
=== Testing operation ===
+
----
 +
=== smsc-ircc2 ===
 +
1. smsc-ircc2 is configured as a module in the (k)ubuntu 2.6.27-9-generic kernel.
 +
2. Install irda-utils and setserial packages.
 +
3. Open a terminal and type (using nano editor).
  
Open a Terminal and type <code><nowiki>dmesg</nowiki></code>. The output from dmesg should be similar to the following:
+
<pre><nowiki>
 +
sudo nano  /etc/modprobe.d/irda-utils
 +
</nowiki></pre>
 +
edit - add line:
 +
<pre><nowiki>
 +
alias irda0 smsc-ircc2
 +
</nowiki></pre>
 +
Ctrl-X then Y then Return to save. Then:
 +
<pre><nowiki>
 +
sudo nano /etc/default/irda-utils
 +
</nowiki></pre>
 +
edit - as follows:
 +
<pre><nowiki>
 +
DEVICE="irda0"
 +
SETSERIAL="/dev/ttyS0"
 +
SMCINIT="no"
 +
</nowiki></pre>
 +
Save as before. Then:
 +
<pre><nowiki>
 +
sudo nano /etc/init.d/irda-setup
 +
</nowiki></pre>
 +
edit - under: FIR="smsc-ircc2"; - edit:
 +
<pre><nowiki>
 +
OPTIONS="--ignore-install ircc_dma=3 ircc_irq=3 ircc_fir=0x130 ircc_sir=0x3f8"
 +
</nowiki></pre>
 +
Save as before.
 +
4. Start IrDA as in the first section. However, following subsequent bootups, IrDA may be started and stopped in a terminal, as follows.
  
 +
Start IrDA:
 +
<pre><nowiki>
 +
sudo irattach irda0 -s
 +
</nowiki></pre>
 +
Stop IrDA:
 +
<pre><nowiki>
 +
sudo killall irattach
 +
</nowiki></pre>
 +
Modules ircomm, ircomm-tty, etc may be loaded as required. Testing operation is the same as below. Outputs will vary of course.
 +
NOTE: Invoking smcinit or setting to "yes" in /etc/defaults/irda-utils prevents operation of the smsc-ircc device. It is only useful to probe the device using the -v (verbose) option.
 +
----
 +
=== Testing operation ===
 +
Open a Terminal and type <code><nowiki>dmesg</nowiki></code>. The output from dmesg should be similar to the following:
 
<pre><nowiki>
 
<pre><nowiki>
 
nsc-ircc, Found chip at base=0x02e
 
nsc-ircc, Found chip at base=0x02e
第38行: 第82行:
 
irlap_change_speed(), setting speed to 9600
 
irlap_change_speed(), setting speed to 9600
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If you put a mobile phone or something with an IR interface in front of the IR receiver on your laptop, the IR daemon should pick it up. You can confirm this by typing the following in a Terminal:
 
If you put a mobile phone or something with an IR interface in front of the IR receiver on your laptop, the IR daemon should pick it up. You can confirm this by typing the following in a Terminal:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
cat /proc/net/irda/discovery
 
cat /proc/net/irda/discovery
 
</nowiki></pre>
 
</nowiki></pre>
 
 
The following is example output from the previous command:
 
The following is example output from the previous command:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
IrLMP: Discovery log:
 
IrLMP: Discovery log:
 
nickname: LGE U8xxx, hint: 0x9124, saddr: 0x00bfb934, daddr: 0x000034f6
 
nickname: LGE U8xxx, hint: 0x9124, saddr: 0x00bfb934, daddr: 0x000034f6
 
</nowiki></pre>
 
</nowiki></pre>
 
 
You can confirm that the link is up by using <code><nowiki>irdaping</nowiki></code>:
 
You can confirm that the link is up by using <code><nowiki>irdaping</nowiki></code>:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
$ sudo irdaping 0x000034f6
 
$ sudo irdaping 0x000034f6
第61行: 第99行:
 
32 bytes from 0x000034f6: irda_seq=1 time=110.15 ms.
 
32 bytes from 0x000034f6: irda_seq=1 time=110.15 ms.
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Another useful command to see if things are up and running is <code><nowiki>irdadump</nowiki></code>.
 
Another useful command to see if things are up and running is <code><nowiki>irdadump</nowiki></code>.
 
 
=== User applications ===
 
=== User applications ===
 
 
[http://usefulinc.com/software/phonemgr/ Gnome Phone Manager] works using IRDA to send/receive SMS messages via phones. It has been tested using a Nokia 6610 and LG U8138 phone using the procedure described in this document. Install the <code><nowiki>gnome-phone-manager</nowiki></code> package from the Universe repository in order to use Gnome Phone Manager.
 
[http://usefulinc.com/software/phonemgr/ Gnome Phone Manager] works using IRDA to send/receive SMS messages via phones. It has been tested using a Nokia 6610 and LG U8138 phone using the procedure described in this document. Install the <code><nowiki>gnome-phone-manager</nowiki></code> package from the Universe repository in order to use Gnome Phone Manager.
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年12月16日 (二) 19:05的最新版本

  1. title Using IrDA infrared devices

This document outlines how to get IrDA infrared connections working with Ubuntu 5.04 and the FIR driver. This procedure also works for Ubuntu Breezy development release colony 3. It is unknown if these instructions apply to later versions of Ubuntu. Working in FIR mode with (k)ubuntu 8.10 - Toshiba laptop, smsc-ircc device with "no" BIOS setting for IrDA. Setup is similar. See smsc-ircc2.

  1. Install the irda-utils and setserial packages from the Universe repository
  2. Ensure that infrared/IrDA is enabled in your BIOS; if not, enable it and reboot. Your computer's BIOS manual should have instructions on enabling infrared.
  3. Open a Terminal and type: sudo gedit /etc/default/irda-utils
  4. Change the line reading DEVICE="/dev/ttyS1" to DEVICE="irda0"
  5. Change the line reading SETSERIAL="" to SETSERIAL="/dev/ttyS1"
  6. Save the file and then open the /etc/modprobe.d/irda-utils file.
  7. Add the following two lines to the end of the file:
alias irda0 nsc-ircc
options nsc-ircc dongle_id=0x09

1.#8 Save the file and then open the /etc/modules file.

  1. Add the following line to the end of the file: ircomm-tty
  2. Save the file and exit the text editor.
  3. To restart irda, open a Terminal and type:
sudo /etc/init.d/irda-utils stop
sudo /etc/init.d/irda-utils start

1.#12 To load the FIR IRDA driver, type: sudo modprobe irda0

  1. To load the the ircomm-tty module, type: sudo modprobe ircomm-tty

smsc-ircc2

1. smsc-ircc2 is configured as a module in the (k)ubuntu 2.6.27-9-generic kernel. 2. Install irda-utils and setserial packages. 3. Open a terminal and type (using nano editor).

sudo nano  /etc/modprobe.d/irda-utils

edit - add line:

alias irda0 smsc-ircc2

Ctrl-X then Y then Return to save. Then:

sudo nano /etc/default/irda-utils

edit - as follows:

DEVICE="irda0"
SETSERIAL="/dev/ttyS0"
SMCINIT="no"

Save as before. Then:

sudo nano /etc/init.d/irda-setup

edit - under: FIR="smsc-ircc2"; - edit:

OPTIONS="--ignore-install ircc_dma=3 ircc_irq=3 ircc_fir=0x130 ircc_sir=0x3f8"

Save as before. 4. Start IrDA as in the first section. However, following subsequent bootups, IrDA may be started and stopped in a terminal, as follows.

Start IrDA:

sudo irattach irda0 -s

Stop IrDA:

sudo killall irattach

Modules ircomm, ircomm-tty, etc may be loaded as required. Testing operation is the same as below. Outputs will vary of course. NOTE: Invoking smcinit or setting to "yes" in /etc/defaults/irda-utils prevents operation of the smsc-ircc device. It is only useful to probe the device using the -v (verbose) option.


Testing operation

Open a Terminal and type dmesg. The output from dmesg should be similar to the following:

nsc-ircc, Found chip at base=0x02e
nsc-ircc, driver loaded (Dag Brattli)
IrDA: Registered device irda0
nsc-ircc, Using dongle: IBM31T1100 or Temic TFDS6000/TFDS6500
irlap_change_speed(), setting speed to 9600

If you put a mobile phone or something with an IR interface in front of the IR receiver on your laptop, the IR daemon should pick it up. You can confirm this by typing the following in a Terminal:

cat /proc/net/irda/discovery

The following is example output from the previous command:

IrLMP: Discovery log:
nickname: LGE U8xxx, hint: 0x9124, saddr: 0x00bfb934, daddr: 0x000034f6

You can confirm that the link is up by using irdaping:

$ sudo irdaping 0x000034f6

IrDA ping (0x000034f6 on irda0): 32 bytes
32 bytes from 0x000034f6: irda_seq=0 time=110.12 ms.
32 bytes from 0x000034f6: irda_seq=1 time=110.15 ms.

Another useful command to see if things are up and running is irdadump.

User applications

Gnome Phone Manager works using IRDA to send/receive SMS messages via phones. It has been tested using a Nokia 6610 and LG U8138 phone using the procedure described in this document. Install the gnome-phone-manager package from the Universe repository in order to use Gnome Phone Manager.