Jacques Blog

Blog about stuff I do?

Getting the USB-UIRT to Work With the Raspberry Pi

One thing I’m working on is controlling my living room with my Raspberry Pi. Eventually I want to get lighting and wall sockets working but for now I’m concentrating on my multimedia. My projector and audio system work with IR remotes so I decided to use the USB-UIRT in order to control them. Unfortunately, there isn’t much up to date information on how to get it working on linux. However, most of it still works.

I’m using the Arch Linux ARM distribution for my Raspberry Pi so what I did might not work with other distributions. From what I can tell, it shouldn’t be all that different to get it working on Wheezy.

To get the USB-UIRT working you need LIRC (Linux Infrared Remote Control) using the uirt2_raw drivers.

First thing you need to do is make sure you have initscripts installed.

1
$ pacman -S initscripts

Then you can install LIRC.

1
$ pacman -S lirc

After this I plugged in the USB-UIRT and checked to see if it was detected.

1
$ dmesg | grep -i usb

Look for something like “FTDI USB Serial Device converter now attached to ttyUSB0”.

Now I know my USB-UIRT is attached to ttyUSB0. And we know we have to use uirt2_raw as the driver. Time to configure LIRC. On some sites I read that you had to configure /etc/lirc/hardware.conf but I couldn’t find the file and creating it did nothing for me. Eventually I found that the file we want to edit is /etc/conf.d/lircd.conf. It also had different variable names. Similar but different. I tried searching for up to date documentation on the file but didn’t really find much. I didn’t really search to hard though, but it wasn’t hard to guess what to put where. Here is my configuration file.

1
2
3
4
5
6
7
8
#
# Parameters for lirc daemon
#

LIRC_DEVICE="/dev/ttyUSB0"
LIRC_DRIVER="uirt2_raw"
LIRC_EXTRAOPTS=""
LIRC_CONFIGFILE=""

Now before you can send and receive ir commands from a remote, you need tell lirc about that remote. This is done in the /etc/lirc/lircd.conf file. You can find a bunch of remotes already defined at http://lirc.sourceforge.net/remotes/.

I was lucky to find one of my remotes and load it up.

1
2
$ wget http://lirc.sourceforge.net/remotes/logitech/Z-5500D
$ cp z-5500D /etc/lirc/lircd.conf

You can have more then one remote loaded (just append to current lircd.conf file).

Start up lirc.

1
$ /etc/rc.d/lircd start

Run irw.

1
$ irw

Now push buttons on the remote to test it.

1
2
3
4
0000000000000001 00 vol+ logitech_z5500
0000000000000001 01 vol+ logitech_z5500
0000000000000001 02 vol+ logitech_z5500
0000000000000001 03 vol+ logitech_z5500

If you can’t find your remote there is a wizard to help create a configuration file. You can read how to use it at https://wiki.archlinux.org/index.php/LIRC#Making_a_configuration_file

Remember to set the device and driver for irrecord.

1
$ irrecord -d /dev/ttyUSB0 -H uirt2_raw /tmp/my_remote

Well that’s what got it working for me. I Hope I didn’t forget anything (did this last week) and that it helps. Here are the links I used:

https://help.ubuntu.com/community/Lirc_USB-UIRT

https://wiki.archlinux.org/index.php/LIRC

Eventually I’ll settup a comment section. Feel free to email me some feed back. Although my email isn’t listed, I’m sure you can figure it out ;)

Comments