LinuxMCE Forums

General => Users => Topic started by: jimmah6786 on August 06, 2007, 07:08:53 pm

Title: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 06, 2007, 07:08:53 pm
So, I am trying to get my remote control to work. The remote does not have a module for LIRC, so I would like to know how to setup my USB-UIRT device and have it learn the keys I press on the remote.

Is there are easy tutorial somewhere on how to do this, seems all I find is how to setup USB-UIRT, but I cant get the remote to work.

Kinda Confused, any help would be greatly appricated.

My System runs Ubuntu 7.04
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 06, 2007, 09:36:53 pm
supposedly you can use irrecord to do that, but my LMCE system doesn't have it installed. When I installed it on an ubuntu studio system, the led on the usb-uirt would light up, but no dots would ever appear in irrecord. I'm wondering if there's a problem with my install because I see pluto-lirc packages, but it doesn't look like any were ever installed. Is there anyway to do a post-install check to make sure everything went ok? I've grepped the pluto install logs and didn't see anything major, mostly mysql errors. -Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 07, 2007, 02:24:47 am
This doesnt make any goddam sense. I read documentation to setup my USB-UIRT, make LIRC see it. The remote i have does not have a preconfigured lircd.conf file. So it says to run irw or irrecord to learn the remote. When I do that the kernel tells me to make sure lirc is running, but when I run lirc from /etc/init.d/ it says cannot because lircd.conf is not setup. WT#???

HELP PLEASE@!!!
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 07, 2007, 05:05:08 am
try running just irrecord:

  irrecord -f --device=/dev/lirc test.conf

on my system it creates /dev/lirc, /dev/lircm, and /dev/lircd and I have to use --device=/dev/lircm but still can't get any input. Did you have to install lirc on your own, or was irrecord and irw already installed? -Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 07, 2007, 03:36:09 pm
lirc was already installed. I removed the package and reinstalled it with -apt-get --purge.
Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 07, 2007, 11:34:23 pm
irrecord -f --device=/dev/lirc test.conf

irrecord -  application for recording IR-codes for usage with lirc

Copyright (C) 1998,1999 Christoph Bartelmus(lirc@bartelmus.de)

irrecord: could not init hardware (lircd running ? --> close it, check permissions)

--thats what i get, and I made sure I started lirc (sudo /etc/init.d/lirc start)
Title: Re: USB-UIRT to Learn a new remote
Post by: Zaerc on August 08, 2007, 12:38:58 am
Just a guess, but maybe you need to stop lirc first instead?
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 08, 2007, 08:11:54 pm
try:

  ls -lah /dev/lirc*

and see what that lists. Like I said, on my system I had 3 lirc* devices listed and could only get one to work with irrecord. Although if I reboot, then I end up with just the /dev/lirc and then get the same thing you are.

  irrecord: could not init hardware (lircd running ? --> close it, check permissions)

Oh, and I'm sure lirc isn't running. -Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 08, 2007, 11:02:40 pm
mythtvuser@mythtvserver:/etc/lirc$ ls -lah /dev/lirc*
crw-rw---- 1 root root 61, 0 2007-08-08 16:50 /dev/lirc
prw-rw-rw- 1 root root     0 2007-08-08 16:50 /dev/lircd
prw-rw-rw- 1 root root     0 2007-08-08 16:50 /dev/lircm
mythtvuser@mythtvserver:/etc/lirc$

thats what i get, so I am assuming this means lirc is install correctly. Also here is my hardware.conf file:

# /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=""


-----------------Hope You guys/gals can Help-------------------
Title: Re: USB-UIRT to Learn a new remote
Post by: k84 on August 09, 2007, 02:05:20 am
Hi
[   14.702913] usb 4-1: FTDI USB Serial Device converter now attached to ttyUSB0

On my linuxmce install the USB-UIRT is connected to ttyUSB0 so try running this:
irrecrord -d/dev/ttyUSB0 new.conf

Havent read the complete topic, but are you sure lirc is compiled with the UIRT_RAW driver (if i remember correctly)

Try this i'll be monitoring this post to help a fellow usbuirt user :-)
Title: Re: USB-UIRT to Learn a new remote
Post by: k84 on August 09, 2007, 02:18:53 am
Just checked out and can atleast confirm that lircd and irsend works very well not prohibiting linuxmce's own USBUIRT binary sending codes :-)

Meaning that for some codes which i can't get PRONTO code for lirc sends the commands (e.g to my hdmi switch)
And i can control this hdmi switch via other machines via a remote lirc socket :-)

And linuxmce still is able to control vol up/down on my reciever :-)

Edit: If you try to transmit via lircd and the builtin pluto binary simultanously lircd would die, but a quick restart would fix that and everything seems to work again.
lircd does not (atleast not yet) die if it never transmits at the same time.


Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 09, 2007, 04:16:02 am
says the same thing as in the prevoius post about not having premissions and making sure lircd is off.

In regards to making sure the USB-UIRT is compiled correctly. I have it installed on Ubuntu 7.04 kernel is 2.6.20-16-generic
, I was told that this kernel comes USB-UIRT ready?

If not, help in the right direction would be greatly appricated. Maybe even steps to take, eh eh? :)

Thanks all
Title: Re: USB-UIRT to Learn a new remote
Post by: k84 on August 09, 2007, 04:24:24 am
So you have checked if the device is noticed upon insertion or boot?
a simple: dmesg

Would show a line like the one i posted above: FTDI ...........

[  880.651369] ftdi_sio 5-1:1.0: FTDI USB Serial Device converter detected
[  880.651380] drivers/usb/serial/ftdi_sio.c: Detected FT232BM
[  880.651640] usb 5-1: FTDI USB Serial Device converter now attached to ttyUSB0

linuxmce runs 2.6.20.6 and the only thing you would need in kernel is support for usbserial converters and the FTDI "variant".

so step number one would be to paste us: dmesg | grep FTDI
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 09, 2007, 06:11:25 am
k84: I get almost the exact same you do, the only difference being what I'm guessing is the usb device number (ftdi_sio 2-1:1.0: for me). Here's what I've gotten to happen so far:

I had to manually install lirc:

  apt-get install lirc

which creates three devices: /dev/lirc, /dev/lircd, /dev/lircm I can get irrecord to work with:

  irrecord -d /dev/lircm test.conf

but when it tries to record, it says: "No gap found" and aborts after 10 seconds. No other device will work, they all give the "lircd running?" message. So I reboot.
After rebooting there are no lirc devices.

  ls -lah /dev/lirc*

returns nothing. And I can't start lircd because I don't have a conf file. -Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: Zaerc on August 09, 2007, 06:31:05 am
Have you guys looked at this page in the wiki? http://wiki.linuxmce.com/index.php/Add_support_for_new_remote_controls

It's not much, but maybe it helps.
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 09, 2007, 07:09:16 am
Yeah, started there actually. What I got from it is you use irrecord to create a conf file and import it into LinuxMCE. But I can't get irrecord to work at all. I know the usb-uirt and remote work together because I've used them on a windows pc to learn and control the tv. -Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 09, 2007, 07:03:11 pm
Same here.
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 10, 2007, 02:08:07 am
Ok, I just did a fresh install with the 0704 dvd and when I plug in the usb-uirt, it is definitely recognized:

[ 2551.210966] usb 1-2: new full speed USB device using ohci_hcd and address 6
[ 2551.440597] usb 1-2: configuration #1 chosen from 1 choice
[ 2551.520221] usbcore: registered new interface driver usbserial
[ 2551.520721] drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[ 2551.521188] usbcore: registered new interface driver usbserial_generic
[ 2551.521191] drivers/usb/serial/usb-serial.c: USB Serial Driver core
[ 2551.524991] drivers/usb/serial/usb-serial.c: USB Serial support registered for FTDI USB Serial Device
[ 2551.525541] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
[ 2551.525684] drivers/usb/serial/ftdi_sio.c: Detected FT232BM
[ 2551.526559] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
[ 2551.526756] usbcore: registered new interface driver ftdi_sio
[ 2551.526760] drivers/usb/serial/ftdi_sio.c: v1.4.3:USB FTDI Serial Converters Driver

and if I tail the USB_UIRT log and press buttons on the remote, I get:

1       08/09/07 18:48:03       33 (spawning-device)    Starting... 1
1       08/09/07 18:48:03       33 (spawning-device)    Found /usr/pluto/bin/USB_UIRT_0038
05      08/09/07 18:48:04.154           Creating child 34 <0xb78e46d0>
05      08/09/07 18:48:04.154           Note: Device manager has attached a device of type 1784 that this has no custom event handler for.  It will not fire events. <0xb78e46d0>
05      08/09/07 18:48:04.154           Note: Device manager has attached a device of type 1784 that this has no custom handler for.  This is normal for IR. <0xb78e46d0>
05      08/09/07 18:51:17.624           Cannot find anything for IR 190002A0A8E2 <0xb7804b90>
05      08/09/07 18:51:18.160           Cannot find anything for IR 190002A0A8E2 <0xb7804b90>
05      08/09/07 18:51:18.212           Cannot find anything for IR 190002A0A8E2 <0xb7804b90>

so I know the remote and usb-uirt can work together under linux in principle at least. I don't have lirc or irrecord installed by default however. If I do a "locate lirc" I see:

dcerouter_1:/etc/X11# locate lirc
/usr/share/locale-langpack/en_GB/LC_MESSAGES/kdelirc.mo
/usr/share/locale-langpack/en_GB/LC_MESSAGES/kcmlirc.mo
/usr/share/locale-langpack/en_AU/LC_MESSAGES/kdelirc.mo
/usr/share/app-install/desktop/kcmlirc.desktop
/usr/share/doc/liblircclient0
/usr/share/doc/liblircclient0/changelog.gz
/usr/share/doc/liblircclient0/copyright
/usr/share/doc/liblircclient0/changelog.Debian.gz
/usr/share/doc/ivtv-utils/README.lirc.gz
/usr/share/doc/mythtv-backend/contrib/channel_changers/change-channel-lirc.pl
/usr/share/doc/mythtv-backend/contrib/channel_changers/change-channel-lirc.sh
/usr/share/doc/mythtv-backend/contrib/mandrake91.etc.sysconfig.lircd
/usr/lib/directfb-0.9.25/inputdrivers/libdirectfb_lirc.so
/usr/lib/liblirc_client.la
/usr/lib/liblirc_client.so.0.2.0
/usr/lib/vlc/control/liblirc_plugin.so
/usr/lib/liblirc_client.so.0
/usr/pluto/deb-cache/lirc-pluto_0.1_all.deb
/usr/pluto/deb-cache/pluto-lirc-wrapper_2.0.0.44.0708032200_i386.deb
/usr/pluto/deb-cache/lirc-modules-2.6.20-15-generic_0.8.1+cvs20070310-0ubuntu2+2.6.20-15.27_i386.deb
/usr/pluto/deb-cache/liblircclient0_0.8.1+cvs20070310-0ubuntu2_i386.deb
/usr/pluto/deb-cache/liblircclient-dev_0.8.1+cvs20070310-0ubuntu2_i386.deb
/usr/pluto/deb-cache/lirc-modules-2.6.20-16-generic_0.8.1+cvs20070310-0ubuntu2+2.6.20-16.29_i386.deb
/usr/pluto/deb-cache/lirc_0.8.1+cvs20070310-0ubuntu2_i386.deb
/usr/pluto/deb-cache/lirc-modules-2.6.20-15-generic_0.8.1+cvs20070310-0ubuntu2+2.6.20-16.29_i386.deb
/var/lib/dpkg/info/liblircclient0.md5sums
/var/lib/dpkg/info/liblircclient0.list
/var/lib/dpkg/info/liblircclient0.postrm
/var/lib/dpkg/info/liblircclient0.shlibs
/var/lib/dpkg/info/liblircclient0.postinst

The wiki says to use irrecord to generate a lirc conf file and then import it into Linux MCE. Is it alright to apt-get lirc or should it be lirc-pluto? Or is there something else wrong that it's not already installed? -Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 13, 2007, 04:07:28 pm
Alright I said forget this USB-UIRT learn remote thang and I went out and bought the MS Windows MCE remote.
Tried the tutorial on setting it up, but no dice. Arg...

If anyone can give me a step by step guid to installing the WIndows MCE remote, that would be great. My media center does everything except have a remote control :( :(, which = crap.
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 14, 2007, 05:11:10 pm
ok, I just installed a fresh copy of ubuntu on the same laptop I was having trouble with earlier and I've gotten irrecord to work, so hopefully someone else can help me figure out where to go from there. This is what I've gotten so far:

installed lirc with "apt-get install lirc"

when that's done it says:

  /etc/init.d/lirc start
  ##################################################
  ## LIRC IS NOT CONFIGURED                       ##
  ##                                              ##
  ## read /usr/share/doc/lirc/html/configure.html ##
  ##################################################
  Starting lirc daemon:.

But it silently fails. I know it's not running using "ps aux |grep lirc".
It seems like no matter what I put in /etc/lirc/hardware.conf, I can't get it to start through /etc/init.d/lirc
BUT: I can get results if I run

  lircd --nodaemon

and then in another terminal:

    irrecord -d /dev/ttyUSB0 -H usb_uirt_raw test.conf

that starts up irrecord which now recognizes my remote and creates a config. I haven't finished a full one yet, but even once I do, I'm not sure how to get the actual lirc daemon to start. -Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: elspic on August 14, 2007, 07:24:21 pm
ok, got the usb-uirt and lirc to work together and I think I followed the wiki http://wiki.linuxmce.com/index.php/Add_support_for_new_remote_controls correctly, but I'm kind of confused where it says:

  "Then edit the device, add a device data "Configuration" and copy the LIRC configuration file into it"

I chose "Configuration" and hit add, gave it a comment, then just put the location of the file (/home/linuxmce/lircd.conf) where it says "Default Value" as that's the only thing I could figure out to do.
So this might be a stupid question but, now what? How do I make sure it's set up properly? Do I have to add a media scenario to turn the tv on when a dvd is put in or what can I do to test that it is working correctly?
Also, right now I've got a gyration mouse hooked up and my tv remote, would it be a good idea to just get one of the Gyration MCE or Fiire remotes to replace the two of them? Either of those are both learning remotes and gyro mice aren't they? I guess this is what I have in mind as the ideal setup for controlling ir gear:

  1 usb-uirt pointed positioned such that it can hit the tv but also accessible to a remote in the majority of the room. Or possibly a second ir emitter plugged in facing the tv so the usb-uirt faces the room. Then one of the GyrationMCE remotes would be able to learn the tv ir codes and control both the tv functions and mouse duties correct? I haven't been able to get my hdhomerun to work with Time Warner here in Austin and being able to access movies on demand and ppv is a showstopper with myth tv so I think I'm going to have to rely pretty heavily on ir. This means for dvds or downloaded movies it would be running off of one connection and using the mouse control, and for live tv, it would use another connection and switch to using normal ir, but does it do that automatically?

And here's how I finally got the usb-uirt to work with lirc:
 /etc/lirc/hardware.conf:

Code: [Select]
# /etc/lirc/hardware.conf
#
# Arguments which will be used when launching lircd
LIRCD_ARGS="--output=/dev/lircd"

#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="/dev/ttyUSB0"
MODULES=""

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


after that I can get irrecord, irw and, irsend to work, but not mode2. That should give you the conf file you need. I'm not sure if LMCE actually uses the lirc stuff, but this file should be in /etc/lirc/lircd.conf

-Ruben
Title: Re: USB-UIRT to Learn a new remote
Post by: jimmah6786 on August 14, 2007, 09:52:00 pm
Alrighty making some progress, but still stuck.

I successfully installed lirc again(reinstall)
I successfully found the USB-UIRT device using dmesg| grep -i usb. I get:

FTDI USB Serial Device converter now attached to ttyUSB0 (dont' know why it doesnt say USB-UIRT connected or something)

changed my hardware config as show in the above post

changed my lircd.conf to the "mceusb.conf" off lirc.sourceforge.net

started the daemon "/etc/init.d/lirc start"
-no errors (yaayaya)

run "irw"
-it hangs(but thats good im told)

press buttons on my Windows MCE remote....and nothing happens :(


p.s. I swear one time I did a dmesg|grep -i usb, i saw a USB-UIRT??