View Full Version : Lirc, UR86E remote, my OpenSuse/Mythtv use.
jonbanjo
24-09-2009, 11:11 AM
Lirc and remote contols were mentioned in another thread. I can't really write a guide on this but I thought I could at least attempt to describe my installation and usage. The UR86E was(I can find some new still but it doesn't look as if they are still made) I think "produced" by Marmitec. It is an X10 radio transmitter as well as an IR transmitter for PC (needs USB reciever unit) and (not that I use these) for TV, etc. It appears to be very similar to an ATI device.
The first thing to do is to install lirc ifneeded. On OpenSuse, this can be done using Yast/Software management.
Next I will plug the device in and show some checks: Some output from dmesg:
lirc_dev: IR Remote Control driver registered, major 61
lirc_atiusb: USB remote driver for LIRC $Revision: 1.71 $
lirc_atiusb: Paul Miller <pmiller9@users.sourceforge.net>
lirc_dev: lirc_register_plugin: sample_rate: 0
lirc_atiusb[6]: X10 Wireless Technology Inc USB Receiver on usb2:6
usbcore: registered new interface driver lirc_atiusb
lsmod:
worthy:~ > lsmod |grep lirc
lirc_atiusb 16496 0
lirc_dev 13160 1 lirc_atiusb
usbcore 195712 8 lirc_atiusb,snd_usb_audio,snd_usb_lib,usbhid,usb_s torage,ohci_hcd,ehci_hcd
worthy:~ > ls -l /dev/lirc*
lrwxrwxrwx 1 root root 5 2009-09-24 10:30 /dev/lirc -> lirc0
crw-rw---- 1 root root 61, 0 2009-09-24 10:30 /dev/lirc0
All looks OK and the lirc device can be found using /dev/lirc (the default lirc programs use). I'll just check I have some raw data coming in when I press some random buttons:
worthy:~ > sudo mode2 --raw
code: 0x20eea1820d
code: 0x20eea1820d
code: 0x20ee61420d
code: 0x20ee61420d
^C
The remote seems to be working OK.
jonbanjo
24-09-2009, 11:13 AM
The next step is to translate the codes into meaningful “buttons” for lirc. This is done by configuring /etc/lircd.conf The easiest way to do this is to browse /usr/share/lirc/remotes and see if there is a ready made configuration and copy it across. An alternative is to use irrecord to create a new configuration file. Here is mine:
#
# brand: UR86E X10
# model no. of remote control:
# devices being controlled by this remote:
#
begin remote
name UR86E
bits 40
eps 30
aeps 100
one 0 0
zero 0 0
gap 203995
min_repeat 3
toggle_bit 0
begin codes
power 0x20EE11F00F
mouse_up 0x1447720000
mouse_up_right 0x144A750000
mouse_right 0x1446710000
mouse_down_right 0x144B760000
mouse_down 0x1448730000
mouse_down_left 0x144C770000
mouse_left 0x1445700000
mouse_up_left 0x1449740000
pc 0x20EEF1D40B
left_click 0x144D780000
right_click 0x14517C0000
num_1 0x20EEA1820D
num_2 0x20EE61420D
num_3 0x20EEE1C20D
num_4 0x20EE41220D
num_5 0x20EEC1A20D
num_6 0x20EE81620D
num_7 0x20EE01E20D
num_8 0x20EE31120D
num_9 0x20EEB1920D
num_0 0x20EE21020D
up 0x20EEF1D50A
right 0x20EEF1D10E
down 0x20EEF1D30C
left 0x20EEF1D20D
ok 0x20EE71520D
rew 0x20EE513807
play 0x20EED1B00F
ff 0x20EED1B807
rec 0x20EE11FF00
stop 0x20EE91700F
pause 0x20EE91720D
menu 0x20EED1B609
exit 0x20EEE1C906
skip_l 0x20EE513A05
skip_r 0x20EEF1D807
screen_full 0x20EED1B609
screen_blank 0x20EEE1C906
mute 0x20EEC1A00F
hand 0x14507B0000
vol_plus 0x20EE81600F
vol_minus 0x20EE01E00F
ch_plus 0x20EE61400F
ch_minus 0x20EEE1C00F
end codes
end remote Having my lircd config file in place, I will start lircd up and perform a test.
worthy:/home/jon # /etc/init.d/lirc start
Starting lircd FATAL: Module ir_kbd_gpio not found.
(/dev/lirc) I have a problem (it's something to do with a configuration for my tvcard remote). To resolve this, I edit /etc/sysconfig/lirc, So that I have:
LIRCD_DEVICE="/dev/lirc"
LIRC_MODULE="" having stopped lircd, I try again
worthy:/home/jon # /etc/init.d/lirc start
Starting lircd (/dev/lirc) done I'll now check that /etc/lircd.conf is correct:
worthy:~ > irw
00000020eea1820d 00 num_1 UR86E
00000020eea1820d 01 num_1 UR86E
00000020ee61420d 00 num_2 UR86E
00000020ee61420d 01 num_2 UR86E
^C It's showing the correct “buttons” for the keys pressed on the remote.
This configuration done, I would now use Yast/System/System Services(runlevel) to have lirc start automatically.
jonbanjo
24-09-2009, 11:16 AM
Now I want to make lirc work with a couple of programs.
The MythTV master backend server may be started by a user in the living room wanting to watch media on the tv, a wol from another PC on the network requiring the services or be woken up to perform a recording. The method that suits me best is to have this PC log in as user tv into a KDE desktop. The mythtv master backend is capable of deciding if no work is to be done and closing the system down when (for simplicity, I'll call it) “idle”. What I want from the remote here is to toggle the myth frontend between on and off via it's “power” button.
To do this, I place a desktop item in /home/tv/.kde/Autostart to start irexec when the KDE desktop is loaded. This program will read a .lircrc file in the home directory and act as instructed on remote buttons pressed. Here is my /home/tv/.lircrc.
begin
prog = irexec
button = power
config = /home/tv/.mythtv/mythtoggle.sh
end
mythtoggle.sh is a script of my own which checks if mythfrontend is running, starts it if it isn't, stops it if it is.
Now onto mythtv itself. Mythfrontend responds to another .lircrc file, this time not in the home directory but in the /home/tv/.mythtv directory. It is a simple mapping of “button names” in the /etc/lircd.conf file to mythtv “keystrokes”. Here is how mine is set up:
#volume
begin
prog = mythtv
button = vol_plus
repeat = 3
config = ]
end
begin
prog = mythtv
button = vol_minus
repeat = 3
config = [
end
begin
prog = mythtv
button = mute
repeat = 3
config = \
end
#
misc
begin
prog = mythtv
button = ch_plus
repeat = 3
config = W
end
begin
prog = mythtv
button = ch_minus
repeat = 3
config = I
end
#navigation buttons
begin
prog = mythtv
button = up
repeat = 3
config = Up
end
begin
prog = mythtv
button = down
repeat = 3
config = Down
end
begin
prog = mythtv
button = left
repeat = 3
config = Left
end
begin
prog = mythtv
button = right
repeat = 3
config = Right
end
# Return
begin
prog = mythtv
button = ok
config = Return
end
# Escape
begin
prog = mythtv
button = exit
config = Esc
end
# Escape
begin
prog = mythtv
button = menu
config = M
end
#number keys
begin
prog = mythtv
button = num_0
repeat = 3
config = 0
end
begin
prog = mythtv
button = num_1
repeat = 3
config = 1
end
begin
prog = mythtv
button = num_2
repeat = 3
config = 2
end
begin
prog = mythtv
button = num_3
repeat = 3
config = 3
end
begin
prog = mythtv
button = num_4
repeat = 3
config = 4
end
begin
prog = mythtv
button = num_5
repeat = 3
config = 5
end
begin
prog = mythtv
button = num_6
repeat = 3
config = 6
end
begin
prog = mythtv
button = num_7
repeat = 3
config = 7
end
begin
prog = mythtv
button = num_8
repeat = 3
config = 8
end
begin
prog = mythtv
button = num_9
repeat = 3
config = 9
end
#Play buttons
# Play
begin
prog = mythtv
button = play
config = Return
end
# Stop
begin
prog = mythtv
button = stop
repeat = 3
config = O
end
# Pause
begin
prog = mythtv
button = pause
repeat = 3
config = P
end
# Record
begin
prog = mythtv
button = rec
repeat = 3
config = R
end
# rew
begin
prog = mythtv
button = rew
repeat = 3
config = Home
end
# ff
begin
prog = mythtv
button = ff
repeat = 3
config = End
end
# skipl
begin
prog = mythtv
button = skip_l
repeat = 3
config = Page Up
end
# skip_r
begin
prog = mythtv
button = skip_r
repeat = 3
config = Page Down
end
As far as I can remember (and it's a couple of years since I set this up [have tried to repeat a few steps on this PC though). That's job done.
jonbanjo
12-10-2010, 02:41 PM
Just an addition to this remote and my usage. When I built the mini ITX box and put a later (OpenSuse 11.3 - 64 and 32... in efforts...). I could not get Lirc to work with this. Tried changing things in udev and sysconfig based on bits I had found on help as well as asking on forums with no solution. Eventually, I installed Ubuntu 10.04 on this one and it worked straight off.
codemonkey
12-10-2010, 02:55 PM
Good stuff. Looks like you had fun tinkering. Not tempted to try 10.10 yet then?
jonbanjo
12-10-2010, 03:26 PM
Good stuff. Looks like you had fun tinkering. Not tempted to try 10.10 yet then?
I guess that could raise a lot of questions...
Firstly, I don't think these days, I call it fun in the enjoyment sense. There is a "was" and a "now" there. A was (included as I know you are a programmer) in a different area (could have included in the old days of a Vic 20 and Basic writing spaghetti code until early hrs of the morning to see if I could write something (at least, and not that I ever will be a real programmer, I discovered turbo pascal, at least some concept of structured programming...) but now, I don't enjoy fights.
I just want things to work and get annoyed when say, I've spent a couple of hrs getting something working under say OpenSuse 10.3 and all my best efforts (and largely clueless but trying to search for advice) won't work under 11.3... I want an easy life and I guess have got lazier.
Re the Ubuntu, I guess there are 2 things there.
1. I am still a KDE user and most familiar with OpenSuse. Ubuntu seems to have got beeter and better since I first looked at it and perhaps maybe there one day - who knows - but Yast aside (and Ubuntu isn't there for me yet to make life easy in ways I know), I don't really think kubuntu cuts it yet.
With regard to my specific problems with lirc. I may be wrong on this but I've a niggling feeling the newer kernel with 10.10 may (or may not - I don't want to find out...) introduce other lirc problems.
...
On reflection though, perhpas on an idle day in a couple of weeks time, I might just have a peep at the latest Ubuntu offering, I ought to do more to keep in touch as it were...
jonbanjo
13-10-2010, 06:53 PM
Have just downloaded 10.10 and installed lirc. A suitable device (ATI/NVidia/X10RF (userspace)) is listed as part of the installation routine but the remote has not worked for me. Where with 10.04, plugging in the device will create /dev/lirc0, this does not happen with 10.10. Running lircd manually out of demon mode and starting irw produces this output.
root@ubuntu:/# lircd -n
lircd-0.8.7-pre3[6170]: lircd(default) ready, using /var/run/lirc/lircd
lircd-0.8.7-pre3[6170]: accepted new client on /var/run/lirc/lircd
lircd-0.8.7-pre3[6170]: could not get file information for /dev/lirc
lircd-0.8.7-pre3[6170]: default_init(): No such file or directory
lircd-0.8.7-pre3[6170]: Failed to initialize hardware
Maybe it can be got working (and I'm not up for playing at the moment) but at a minimu, it doesn't seem to be 'just works' as was the case with 10.04.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.