Linux LIRC USB-UIRT HOWTO

Issues relating to installation of your USB-UIRT device.

Moderator: jrhees

Linux LIRC USB-UIRT HOWTO

Postby benow » Mon Oct 17, 2005 7:43 pm

I've just received a usb-uirt in the mail, and have had some luck getting it going for reception under gentoo gnu/linux. Here's what I did:

- enable ftdi_sio support in kernel (only required on older or manually compiled kernels)
Code: Select all
# cd /usr/src/linux
# make menuconfig
select Device Drivers -> USB Support -> <*> USB Serial Converter Support
select Device Drivers -> USB Support -> <*> USB Serial Converter Support -> <*> USB FTDI Single Port Serial Driver (EXPERIMENTAL)

And reboot. If installing as modules, be sure to load modules (usbserial,ftdi_sio) at boot by editing /etc/modules.autoload.d/kernel-2.6 or similar.

- after reboot or loading modules, verify usb-uirt is being found by tailing the logs and plugging in the device
Code: Select all
# tail -f /var/log/everything/current
(for metalog, or tail -f /var/log/messages if syslog)
Plug in the USB-UIRT and you should see:
[kernel] usb 2-3: new full speed USB device using ohci_hcd and address 8
[kernel] ftdi_sio 2-3:1.0: USB-UIRT Infrared Tranceiver converter detected
[kernel] usb 2-3: USB-UIRT Infrared Tranceiver converter now attached to ttyUSB0

If you don't see similar, verify kernel configuration and module loading (if applicable)

- if under ubuntu ensure you have the build dependencies by
Code: Select all
sudo apt-get build-dep lirc


- download lirc 0.7.1 lirc-0.7.1.tar.bz2 from lirc.org

- download the patch (an update of neveld's patch to prevent the debug and repeat bugs)

- do the following
Code: Select all
# tar xvfj lirc-0.7.1.tar.bz2
# cd lirc-0.7.1
# bzcat ../lirc-0.7.1-usb_uirt.patch.bz2 | patch -p1
# libtoolize --force
# ./setup.sh
choose Driver Configuration->USB Devices->USB-UIRT2 (receive and transmit)
choose Save Configuration & Exit


- edit configure.sh as follows:
Code: Select all
#!/bin/bash

./configure \
--with-moduledir=/lib/modules/2.6.12-gentoo-r9/misc \
--with-x \
--with-syslog \
--with-driver=usb-uirt2_raw \
--with-major=61 \
--with-port=none \
--with-irq=none \
--prefix=/usr \
"$@"

Note the changed --with-tty line and --prefix line (to install to /usr, instead of /usr/local) and the --with-syslog for logging to syslog

- run
Code: Select all
# sh ./configure.sh && make && make install

make install needs to be run as root.

- if under gentoo: create/edit /etc/modules.d/lirc to contain
Code: Select all
alias char-major-61  lirc_usb-uirt2_raw

and run update-modules

- otherwise: edit /etc/modules.conf, add the above alias and run
Code: Select all
# depmod -a


- background watching the logs:
Code: Select all
metalog: # tail -f /var/log/everything/current&
syslog: # tail -f /var/log/messages&


- run lircd which should trigger log message:
Code: Select all
# lircd
[lircd-0.7.1] lircd(usb-uirt2_raw) ready


- run irrecord
Code: Select all
#  irrecord -l test.conf

and record remote keypresses. Remote has to be held within inches of front center of usb-uirt. -l puts it into learn mode, which dumps the frequency. Might be a good idea to record a power button if you want to try transmitting. Continue thru irrecord process.

- edit the test.conf and replace
Code: Select all
name /some/path/test.conf

with a better name (ie the name of the remote, etc):
Code: Select all
name NAD

This name (ie NAD above) is the remote name and will be used with irssend and other apps.

- in the conf file will be lines containing the frequency. Such as:
Code: Select all
:
          name sat_rew
# frequency 39466
             2422     632     646     636     648     632
              648     636     646     636    1255     622
:

Take a look a the numbers within the frequency lines. Copy the line to the top and round the number to something close to all numbers:
Code: Select all
:
begin remote

  name   nad
  flags CONST_LENGTH|RAW_CODES
  eps            30
  aeps          100
  frequency 39200
:


Without this step, you may not be able to transmit.

- move test.conf to default and restart lircd
Code: Select all
# mv test.conf /etc/lircd.conf
# killall lircd && lircd


- run irw and hit recorded buttons... button id should show as you press it.

- you can try transmit, if you wish. Record a button which controls the device you'd like the uirt to control. Power button is the easiest. Point the uirt at the device and send the button:

Code: Select all
irsend [REMOTE] SEND_ONCE [BUTTON]
ie: irsend nad SEND_ONCE sat_pwr


[REMOTE] should be the name of the remote as in the lircd.conf file and [BUTTON] the name of the button to send. If sending power, the device should come on or off. Putting the command in a loop might be useful when testing:

Code: Select all
while [ true ]; do irsend nad SEND_ONCE sat_pwr; sleep 3s; done;


Hit ^c to exit. Hopefully it should turn the device on or off every 3 seconds.

- (optional) You might want a channel changing script which could be used to change the channel before recording. Here's one:
Code: Select all
#!/bin/sh
REMOTE_NAME=$1
cmd=$2
echo $cmd | grep -q -e '^[0-9]'
ret=$?
if [ $ret -eq 0 ];then
   for digit in $(echo $cmd | sed -e 's/./& /g'); do
       irsend SEND_ONCE $REMOTE_NAME sat_$digit
#       sleep 1
       # If things work OK with sleep 1, try this for faster channel changes:
       sleep 0.5
   done
else
   irsend SEND_ONCE $REMOTE_NAME $cmd
fi

Save it somewhere (/usr/bin/chchan, perhaps) and chmod it: chmod a+x /usr/bin/chchan. Call it with the name of the remote and the channel:
Code: Select all
/usr/bin/chchan nad 551


- lirc should now be verified to be working, but it's only ever been started manually. To have lirc start on boot, you'll need to add a file to /etc/init.d. In the lirc source directory, do
Code: Select all
# copy contrib/lirc.<dist> /etc/init.d/lirc
where <dist> is your distribution.  ie:
# copy contrib/lirc.debian /etc/init.d/lirc

As lirc was installed to /usr, you'll have to edit the new /etc/init.d/lirc and change all references from /usr/local to /usr.

For gentoo, the debian startup script should work, or, if want to be fancy, you use the lirc startup scripts which are packaged with the ebuild:
Code: Select all
# copy /usr/portage/app-misc/lirc/files/lircd /usr/portage/app-misc/lirc/files/lircmd /etc/init.d/
# rc-update add lircd default
# rc-update add lircmd default


- (optional) lircmd is a program to use a remote to control the X mouse pointer. It can be somewhat funky with an appropriately configured X display on tv out... browsing for files through nautilus, etc. Check out doc/html/lircmd.html in lirc source distribution for installation instructions.

---

EDIT
- added transmission steps as derived from nathan.
- changed patch link to reflect lirc0.7.1, instead of 0.7.0pre7, should patch fine now.
- further modified patch to fix debug and repeat bugs (as noted in MM's post and others) and removed the link to the original.
- updated build process to include libtoolize workaround
- added ubuntu build dep instructions

Any suggestions for improving this howto are welcome!
Last edited by benow on Thu Jul 05, 2007 7:17 am, edited 15 times in total.
benow
 
Posts: 16
Joined: Mon Oct 17, 2005 6:51 pm

Postby jrhees » Mon Oct 17, 2005 11:29 pm

Can I ask a dumb question -- why is it located at tts/USB0 when on my system it is at tty/USB0?

Does this have to do with different Linux disti's?

Thanks,

Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Postby benow » Tue Oct 18, 2005 12:47 am

Yeah, must be something different with the udev config or similar.
Last edited by benow on Tue Oct 18, 2005 5:57 pm, edited 1 time in total.
benow
 
Posts: 16
Joined: Mon Oct 17, 2005 6:51 pm

Postby benow » Tue Oct 18, 2005 2:43 am

I've not managed to make transmitting go, which is the very reason I went with a USB-UIRT. I've done irrecord -l, set the carrier frequency, but it fails to control the programmed cd player. Any obvious suggestions?
benow
 
Posts: 16
Joined: Mon Oct 17, 2005 6:51 pm

Postby jrhees » Tue Oct 18, 2005 1:07 pm

benow,

Please contact me at support@usbuirt.com -- if possible let's make sure this works with Windows (i.e., find good codes) and then move on from there.

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Postby elrod » Wed Oct 19, 2005 12:08 pm

Benow, thanks for this great how to! i had been going nuts getting irrecord going and this did it for me. Please continue to let us know how getting transmit to work is going.

A couple of things to flush out in the howto (If I knew more I would do it...)

1) I had a link to create from /dev/lirc to /dev/tss/USB0. Did I do something wrong or is that a missing step?
2) My ignorance, but how do I get lircd into /etc/init.d?
elrod
 
Posts: 6
Joined: Wed Dec 24, 2003 4:07 pm

Postby benow » Wed Oct 19, 2005 8:08 pm

elrod, glad it was helpful.

I don't see how step 1 would be correct. /dev/lirc is created by lircd on startup and is used to represent lirc device hardware. /dev/tts/USB0 is also a device node, but represents the serial usb interface used by USB-UIRT. Lircd talks to the lirc device which talks to the USB0 device (in the case of the USB-UIRT device)... so they are two seperate pieces. /dev/lirc may have been recreated on lircd startup. Nice try, anyway ;)

As far as startup script goes, good point. I'll throw something into the howto. What you need to do is copy a contrib/lirc.<dist> from lirc source bundle to /etc/init.d, where <dist> is your linux distribution.

I've updated the howto with init script info, expanded irrecord step and added a section or lircmd.
benow
 
Posts: 16
Joined: Mon Oct 17, 2005 6:51 pm

FC4 Experiences?

Postby cartman » Wed Nov 16, 2005 3:24 pm

Thanks for all the information you've provided benow, its great seeing the process so thorough from start to finish - but I'm wondering if anyone has any tips on setting this up using FC4? I've followed the procedures above (to the best of my ability), including what seems like building the software - removing the tag=CC references as per another post but to no avail. I'm looking to have the USBUIRT transmitting and recieving to my Foxtel (sat pay-tv) box which works successfully on the same machine dual booting windows with girder.

I'd appreciate any hints people have already come up with.

:)
cartman
 
Posts: 4
Joined: Fri Nov 04, 2005 2:09 pm

Postby myconid » Fri Dec 02, 2005 3:59 am

I have the same issue under Gentoo/FC/CentOS, every version/patch of lirc I could find :(.

I wish they supported Linux with this device.. ive had it for 6 months and worked probably 40 hours trying to get it to work. I wish I had bought something supported instead.
myconid
 
Posts: 4
Joined: Mon Mar 14, 2005 2:17 am

It's always something simple!

Postby cartman » Fri Dec 02, 2005 12:36 pm

I've had to give myself a break for the last few weeks because I was driving myself insane. I'll be taking some holidays so will have some time to work on it in a couple of weeks, hopefully I've had some time by then to refresh and rethink my strategy - or perhaps someone else will have a hint to our problems ;)
cartman
 
Posts: 4
Joined: Fri Nov 04, 2005 2:09 pm

Thank you!

Postby Steve-G » Fri Dec 09, 2005 9:27 pm

I just wanted to send a HUGE, HUGE thanks to Neveld and an almost-as-huge thanks (hey Neveld wrote the patch afterall!) to Benow for writing this patch and for the howto... Thanks again guys!
-Steve
Steve-G
 

Postby Guest » Sun Dec 11, 2005 7:52 pm

None the less--we still have no functional send ability under linux.
Guest
 

Postby Steve G » Mon Dec 12, 2005 4:22 pm

Hey man, saying there is no send from the usb-uirt with Lirc...IS NOT TRUE...Mine works 100% and was transmitting 2 minutes after I broke down and applied the patch and recompiled and working perfectly with Myth 10 minutes later. It DOES work for transmit and send...try it out!
Steve
Steve G
 

Postby Guest » Mon Dec 12, 2005 4:27 pm

Sorry for the double post but perhaps you have some wacky IR needs like Dish or something? To make things clear:

usbuirt learn from the remotes of and transmits to my:

SA2000 SDTV cable box
SA3250 HDTV cable box
Integra 7.1 Receiver
JVC receiver (sorry dont remember the model..cheap HTIB thing)
BenQ PB6200 front projector
RCA 32" el-cheapo SDTV

I just don't have any other devices I care to make it work with!
-Trouble
Guest
 

Transmitting

Postby Nathan » Sat Dec 24, 2005 7:15 am

I've made a separate thread about how I successfully got transmitting to work:

http://www.usbuirt.com/phpBB2/viewtopic.php?p=4163#4163
Nathan
 
Posts: 1
Joined: Sat Dec 24, 2005 6:39 am

Next

Return to Installation

Who is online

Users browsing this forum: No registered users and 24 guests

cron