特殊:Badtitle/NS100:Lirc USB-UIRT:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
(未显示同一用户的1个中间版本)
第2行: 第2行:
{{Languages|UbuntuHelp:Lirc_USB-UIRT}}
{{Languages|UbuntuHelp:Lirc_USB-UIRT}}
== Lirc and the USB-UIRT ==
== Lirc and the USB-UIRT ==
The USB-UIRT is a usb serial InfraRed device. Support for it is built-in to the kernel via the ftdi_sio driver and usb-serial. In order to make use of it, however, you need to install lirc. To do so, you will need to have '''universe''',  and '''multiverse''' enabled.  See Ubuntu documentation for more information on [https://help.ubuntu.com/community/Repositories/CommandLine#head-e1a24b1b2037f68b5a95f54388582b58ea4c9bd0 enabling these repositories].
The USB-UIRT is a usb serial InfraRed device. Support for it is built-in to the kernel via the ftdi_sio driver and usb-serial. In order to make use of it, however, you need to install lirc. To do so, you will need to have '''universe''',  and '''multiverse''' enabled.  See Ubuntu documentation for more information on [[UbuntuHelp:Repositories/CommandLine#head-e1a24b1b2037f68b5a95f54388582b58ea4c9bd0|enabling|these repositories]].
==== Install Lirc ====
==== Install Lirc ====
<pre><nowiki>
<pre><nowiki>
第13行: 第13行:
</nowiki></pre>
</nowiki></pre>
You should see some output that looks like the following.:
You should see some output that looks like the following.:
<pre><nowiki>[    8.376358] usb 1-2: new full speed USB device using uhci_hcd and address 3
<pre><nowiki>
[    8.376358] usb 1-2: new full speed USB device using uhci_hcd and address 3
[    8.558634] usb 1-2: configuration #1 chosen from 1 choice
[    8.558634] usb 1-2: configuration #1 chosen from 1 choice
[  14.943365] usbcore: registered new interface driver usbserial
[  14.943365] usbcore: registered new interface driver usbserial
第30行: 第31行:
== Configure Lirc hardware.conf ==
== Configure Lirc hardware.conf ==
We need to edit the /etc/lirc/hardware.conf file, specifically, the LIRCD_ARGS, LOAD_MODULES and DRIVER variables. Set the LIRCD_ARGS to tell lircd where to find the serial device to use (you should know from the dmesg command in the previous step), set LOAD_MODULES to false and set the DRIVER to uirt2_raw. Like so:
We need to edit the /etc/lirc/hardware.conf file, specifically, the LIRCD_ARGS, LOAD_MODULES and DRIVER variables. Set the LIRCD_ARGS to tell lircd where to find the serial device to use (you should know from the dmesg command in the previous step), set LOAD_MODULES to false and set the DRIVER to uirt2_raw. Like so:
<pre><nowiki># /etc/lirc/hardware.conf
<pre><nowiki>
# /etc/lirc/hardware.conf
#
#
# Arguments which will be used when launching lircd
# Arguments which will be used when launching lircd
第54行: 第56行:
== Start lircd ==
== Start lircd ==
Now all you need to do is start lircd and configure remotes in the <code><nowiki>/etc/lirc/lircd.conf</nowiki></code> and <code><nowiki>/etc/lirc/lircrc</nowiki></code> files.  
Now all you need to do is start lircd and configure remotes in the <code><nowiki>/etc/lirc/lircd.conf</nowiki></code> and <code><nowiki>/etc/lirc/lircrc</nowiki></code> files.  
<pre><nowiki>$ sudo /etc/init.d/lirc start
<pre><nowiki>
$ sudo /etc/init.d/lirc start
</nowiki></pre>
</nowiki></pre>
Don't forget to make sure lirc starts at boot, too.
Don't forget to make sure lirc starts at boot, too.
第84行: 第87行:
</nowiki></pre>
</nowiki></pre>
----
----
[[category:CategoryDocumentation]]


[[category:UbuntuHelp]]
[[category:UbuntuHelp]]

2009年5月12日 (二) 17:43的最新版本

{{#ifexist: :Lirc USB-UIRT/zh | | {{#ifexist: Lirc USB-UIRT/zh | | {{#ifeq: {{#titleparts:Lirc USB-UIRT|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Lirc USB-UIRT|1|-1|}} | zh | | }}

Lirc and the USB-UIRT

The USB-UIRT is a usb serial InfraRed device. Support for it is built-in to the kernel via the ftdi_sio driver and usb-serial. In order to make use of it, however, you need to install lirc. To do so, you will need to have universe, and multiverse enabled. See Ubuntu documentation for more information on enabling|these repositories.

Install Lirc

$ sudo apt-get install lirc

Verify the USB-UIRT is detected

Plug the usb-uirt device into an available usb port. Check dmesg to make sure it was detected and that the tty was created.:

$ dmesg | grep -i usb

You should see some output that looks like the following.:

[    8.376358] usb 1-2: new full speed USB device using uhci_hcd and address 3
[    8.558634] usb 1-2: configuration #1 chosen from 1 choice
[   14.943365] usbcore: registered new interface driver usbserial
[   14.943374] drivers/usb/serial/usb-serial.c: USB Serial support registered fo
r generic
[   15.043231] usbcore: registered new interface driver usbserial_generic
[   15.043234] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[   15.045761] drivers/usb/serial/usb-serial.c: USB Serial support registered fo
r FTDI USB Serial Device
[   15.045790] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
[   15.045793] drivers/usb/serial/ftdi_sio.c: Detected FT232BM
[   15.045911] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
[   15.045916] usbcore: registered new interface driver ftdi_sio
[   15.045918] drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver

Note the tty that was created. You will use this in the next section. In the above example, it is ttyUSB0, which appears at /dev/ttyUSB0.

Configure Lirc hardware.conf

We need to edit the /etc/lirc/hardware.conf file, specifically, the LIRCD_ARGS, LOAD_MODULES and DRIVER variables. Set the LIRCD_ARGS to tell lircd where to find the serial device to use (you should know from the dmesg command in the previous step), set LOAD_MODULES to false and set the DRIVER to uirt2_raw. Like so:

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="-d /dev/ttyUSB0"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Try to load appropriate kernel modules
LOAD_MODULES=false

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="uirt2_raw"
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
DEVICE=""
MODULES=""

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""

Start lircd

Now all you need to do is start lircd and configure remotes in the /etc/lirc/lircd.conf and /etc/lirc/lircrc files.

$ sudo /etc/init.d/lirc start

Don't forget to make sure lirc starts at boot, too. This configuration allows you to both receive and transmit codes. Refer to the other LIRC documentation for instructions on how to test receiving with irw and transmitting with irsend.

Newer USB-UIRT Models

It has not been confirmed but some newer USB-UIRT Models may need the usb_uirt_raw driver instead of the uirt2_raw driver

# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="-d /dev/ttyUSB0"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD=false

#Try to load appropriate kernel modules
LOAD_MODULES=false

# Run "lircd --driver=help" for a list of supported drivers.
DRIVER="usb_uirt_raw"
# If DEVICE is set to /dev/lirc and devfs is in use /dev/lirc/0 will be
# automatically used instead
DEVICE=""
MODULES=""

# Default configuration files for your hardware if any
LIRCD_CONF=""
LIRCMD_CONF=""