cheap usb remote from dealextreme

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
gavo Offline
Senior Member
Posts: 140
Joined: Apr 2009
Reputation: 0
Post: #11
anyone geting this working on xbmc for xbox
find quote
Zeppstar Offline
Senior Member
Posts: 112
Joined: Dec 2008
Reputation: 0
Post: #12
Many people talk about the Microsfot MCE remote which have recently been discontinued. Its a 'work out of the box remote' for xbmc(with lirc). Another reasonably cheap remote which pretty much is a 'working' clone of this remote is the Hauppauge Media Centre Remote Control Kit. I can confirm this remote works exactly like the MS version and its about $10-$15 cheaper. Those HID remotes are not worth the trouble IMHO.

HW : Multiple Asrock 330HT + NAS
SYS: xbmc-live 10.0
find quote
pko66 Offline
Senior Member
Posts: 189
Joined: Dec 2006
Reputation: 0
Post: #13
Loto_Bak Wrote:I just recently got this remote+ir reciever.

I would not recommend it.
The reciever is detected as a HID keyboard and mouse. LIRC cannot decode any IR from this device.
It also does NOT support key repeat except for on the volume control. This is annoying when scrolling lists (you cannot hold the button)

http://ubuntuforums.org/showthread.php?t=805876

The one I received from dealextreme works differently. All keys (or most) autorepeat, and the codes are different. I've done what it says at that ubuntuforums.org link (not exactly like that but I get similar results, I could explain if someone needs it)

Mostly works although the problem is that some keys do not map as a "single key" but as a combination, for example pressing "close" gives TWO keys, KEY_LEFTALT and KEY_F4 (something like pressing Alt-F4 in a real keyboard, only that lirc receives both two distinct keys). Or "rewind", produces 4 keys: LEFTSHIFT, LEFTCONTROL, LEFT and B. If lirc receives a "KEY_LEFT" signal, there is no way to determine if the user has pressed "left" or "rewind" (if pressed "rewind" it will ALSO receive "KEY_LEFTCTRL", "KEY_LEFTSHIFT" and "KEY_B", but I believe XBMC/lirc architecture does not allow to differenciate)


All that makes impossible to uniquely identify 6 keys, and 2 other keys (power and numlock) plus the simulated "mouse" never reach LIRC. The result is still pretty good, since there are still 29 different functions, and since there is a really cheap device (less than 7€ including P&P to anywhere in Europe) and the receiver is not very intrusive, I think is not a bad option. Also, you can use other programmable remotes simply by cloning the signals from this one.

The usable keys as seen running irw in a console are:
first two rows:
[power unusable in lirc]
KEY_MAIL
KEY_HOMEPAGE
KEY_F4 [D]

KEY_F1
KEY_F2
KEY_F3
KEY_D KEY_4 KEY_F4 [D]

The two "mouse buttons":
BTN_LEFT
BTN_RIGHT

next two rows:
KEY_PREVIOUSSONG
KEY_PLAYPAUSE
KEY_NEXTSONG

KEY_B KEY_LEFT [D]
KEY_STOPCD
KEY_F KEY_RIGHT [D]

the two "up/down" and "full screen":
KEY_VOLUMEUP
KEY_VOLUMEDOWN

KEY_3

KEY_PAGEUP
KEY_PAGEDOWN

the next 4 rows (the fifth one later):
KEY_MUTE
KEY_E
KEY_BACKSPACE

KEY_TAB
KEY_UP
KEY_LEFTMETA [D]

KEY_LEFT [D]
KEY_ENTER
KEY_RIGHT [D]

KEY_O
KEY_DOWN
KEY_ESC

The last row. If you press "num lock", the signal never reaches lirc, but changes the function of other keys... so do not press it :-D
[num lock unusable in lirc]
KEY_TAB [D]
KEY_D [D]

[D] means the function appears also when pressing another button but it is usable (simply that button is a duplicate of another one)
[R] means the function appear also when pressing another button but cannot be easily used as a duplicate.

This is my current Lircmap.xml (to be copied to ~/.xbmc/userdata o to be appended to /usr/share/xbmc/system/Lircmap.xml), there are still 5 keys I haven't decided how to program (see picture):

<lircmap>
<remote device="devinput">
<Left>KEY_LEFT</Left>
<Right>KEY_RIGHT</Right>
<Up>KEY_UP</Up>
<Down>KEY_DOWN</Down>
<Select>KEY_ENTER</Select>
<VolumeUp>KEY_VOLUMEUP</VolumeUp>
<VolumeDown>KEY_VOLUMEDOWN</VolumeDown>
<Mute>KEY_MUTE</Mute>
<BackSpace>KEY_BACKSPACE</BackSpace>
<Pause>KEY_PLAYPAUSE</Pause>
<stop>KEY_STOPCD</stop>
<SkipPrevious>KEY_PREVIOUSSONG</SkipPrevious>
<SkipNext>KEY_NEXTSONG</SkipNext>
<Info>KEY_MAIL</Info>
<display>KEY_3</display>
<mymusic>KEY_F1</mymusic>
<myvideo>KEY_F2</myvideo>
<mypictures>KEY_F3</mypictures>
<power>KEY_F4</power>
<power>KEY_D</power>
<pageplus>KEY_PAGEUP</pageplus>
<pageminus>KEY_PAGEDOWN</pageminus>
<back>BTN_RIGHT</back>
<menu>BTN_LEFT</menu>
<title>KEY_HOMEPAGE</title>
</remote>
</lircmap>

The duplicates are 2 keys for "menu", 3 for "power" and 2 for "left/right". The two "unused" ones will be duplicates of two of the currently undefined (or be left with no function)

[Image: dibujoont.jpg]
find quote
Anastrophe Offline
Member+
Posts: 236
Joined: Mar 2004
Reputation: 0
Location: Dubai, UAE
Post: #14
It would be great if you could explain what you did differently to the unbuntuforums link.

Thanks
find quote
Anastrophe Offline
Member+
Posts: 236
Joined: Mar 2004
Reputation: 0
Location: Dubai, UAE
Post: #15
....out if interest, if it works as a keyboard and mouse (as mine does), why not just remap the keys to work with xbmc and not use lirc? That way the repeat etc works.
find quote
pko66 Offline
Senior Member
Posts: 189
Joined: Dec 2006
Reputation: 0
Post: #16
Anastrophe Wrote:....out if interest, if it works as a keyboard and mouse (as mine does), why not just remap the keys to work with xbmc and not use lirc? That way the repeat etc works.

Because if you press some keys (yellow key, for example), ubuntu starts a text-mode console and you cannot go back to XBMC. There are other reasons, but that is pretty important to me!
find quote
pko66 Offline
Senior Member
Posts: 189
Joined: Dec 2006
Reputation: 0
Post: #17
Anastrophe Wrote:It would be great if you could explain what you did differently to the unbuntuforums link.

It is a little long, but here it is. Most of this I've found by trial and error, and I do not really know what I am doing or why it works, but it does. I should do more research, but haven't... Also I am more used to fedora linux (from the time it was called "red hat linux" and then "fedora core"), so some things perhaps should be done differently here. But it works for me.

First, become root entering "su -" and then the root password.

1) do "ls -l /dev/input/*" with the IR sensor not attached. Attach the sensor and repeat "ls -l /dev/input/*". That way you can see what devices the sensor creates.
For me, it was "event5" and "mouse1" (I had some other devices attached)

2) then do "udevadm info -a -p $(udevadm info -q path -n /dev/input/eventX)" ("X" being the "event number" you discovered on step 1, mine was "5")
There will be a long listing; look for the FIRST "ATTRS(modalias)" line, for me it was:
Code:
ATTRS{modalias}=="input:b0003v06B4p1C70e0110-e0,1,2,3,4,14,k71,72,73,74,75,77,79,7A,7B,7C,7D,7E,7F,80,81,82,83,84,85,86,87,88​,89,8A,8B,8C,8E,8F,90,96,98,9B,9C,9E,9F,A1,A3,A4,A5,A6,A7,A8,A9,AB,AC,AD,AE,B1,B​2,B5,B7,B8,B9,BA,BB,BC,BD,BE,BF,C0,C1,C2,CE,CF,D0,D1,D2,D5,D9,DB,E2,EA,EB,F0,100​,101,102,103,104,105,106,107,108,109,10A,10B,10C,10D,10E,10F,110,111,112,113,114​,115,116,117,118,119,11A,11B,11C,11D,11E,11F,120,121,122,123,124,125,126,127,128​,129,12A,12B,12C,12D,12E,12F,130,131,132,133,162,166,16A,16E,178,179,17A,17B,17C​,17D,17F,180,181,182,185,18C,18D,192,193,195,1A0,1A1,1A2,1A3,1A4,1A5,1A6,1A7,1A8​,1A9,1AA,1AB,1AC,1AD,1AE,1B0,1B1,1B7,r0,1,6,8,9,a10,11,20,m4,lsfw"

from that, line, we can identify our device as "input:b0003v06B4p1C70e0110-e0*"
(yours will be probably similar but different)

3) create a udev rule to catch our device on each boot:

Code:
echo ATTRS{modalias}=="input:b0003v06B4p1C70e0110-e0*",SYMLINK+="input/dxremote" > /etc/udev/rules.d/60-persistent-input.rules

Of course, instead of "b0003v06B4p1C70e0110-e0*", enter the correct data for your device that you found on step 2

Now, by unplugging/plugging the USB IR sensor (or, if that does not work, rebooting) you should have a redirection for the device; "ls -l /dev/input/*" should give something like:

Code:
crw-r-----  1 root root 13, 64 2009-08-24 18:56 /dev/input/event0
crw-r-----  1 root root 13, 65 2009-08-24 18:56 /dev/input/event1
crw-rw----+ 1 root root 13, 66 2009-08-24 18:56 /dev/input/event2
crw-r-----  1 root root 13, 67 2009-08-24 18:56 /dev/input/event3
crw-r-----  1 root root 13, 68 2009-08-24 18:56 /dev/input/event4
crw-rw----+ 1 root root 13, 69 2009-08-24 19:07 /dev/input/event5
crw-rw----+ 1 root root 13, 70 2009-08-24 18:56 /dev/input/event6
crw-r-----  1 root root 13, 71 2009-08-24 18:56 /dev/input/event7
lrwxrwxrwx  1 root root      6 2009-08-24 19:07 /dev/input/dxremote -> event5
crw-r-----  1 root root 13, 63 2009-08-24 18:56 /dev/input/mice
crw-r-----  1 root root 13, 32 2009-08-24 18:56 /dev/input/mouse0
crw-r-----  1 root root 13, 33 2009-08-24 19:07 /dev/input/mouse1
crw-r-----  1 root root 13, 34 2009-08-24 18:56 /dev/input/mouse2

(instead of "dxremote" you may use any name you want)

After that this line:
Code:
/usr/local/sbin/lircd --driver=dev/input --device=/dev/input/dxremote --output=/dev/lircd --pidfile /var/run/lircd.pid
captures the input from the remote, you just need to execute that on each boot. I do that by creating a script on init.d:

Code:
echo /usr/local/sbin/lircd --driver=dev/input --device=/dev/input/mando --output=/dev/lircd --pidfile /var/run/lircd.pid > /etc/init.d/dxremote

making it executable:
Code:
chmod a+x /etc/init.d/dxremote

and creating a link in rc2.d, rc3.d and rc5.d to be sure it runs on each boot
Code:
ln /etc/init.d/dxremote /etc/rc2.d/S71dxremote
ln /etc/init.d/dxremote /etc/rc3.d/S71dxremote
ln /etc/init.d/dxremote /etc/rc5.d/S71dxremote

With that, and the adecuate Lircmap.xml and Keymap.xml in the ~/.xbmc/userdata directory (or /usr/share/xbmc/userdata if you want it to work for every user) you can control xbmc with the remote as I explained before.
find quote
Anastrophe Offline
Member+
Posts: 236
Joined: Mar 2004
Reputation: 0
Location: Dubai, UAE
Post: #18
You are a star! Can't wait to try this when I get home.

Thanks!
find quote
Anastrophe Offline
Member+
Posts: 236
Joined: Mar 2004
Reputation: 0
Location: Dubai, UAE
Post: #19
I've run into a couple of problems...

my RC is identical to yours, same USB vendor/version etc. it shows as Event 9 on this laptop I'm testing with.

Up to step 3 I was using sudo (as this is ubuntu Jaunty) , but then I had to a sudo su to get premissions to run echo ATTRS{modalias}=="input:b0003v06B4p1C70e0110-e0*",.....

Then ls -l /dev/input/* still showed Event9 and not a redirection , so I rebooted.

Now I have event 9 even when the IR dongle is disconnected and still no redirection.

I just tried a cat /proc/bus/input/devices and got:

Quote:I: Bus=0003 Vendor=06b4 Product=1c70 Version=0110
N: Name="HID 06b4:1c70"
P: Phys=usb-0000:00:1d.0-2/input0
S: Sysfs=/devices/pci0000:00/0000:00:1d.0/usb2/2-2/2-2:1.0/input/input11
U: Uniq=
H: Handlers=kbd mouse1 event6
B: EV=10001f
B: KEY=837fff 2c3027 bf004444 0 fffff ffffffff 10c04 a27c007 ffa67bfa d941dfff febeffdf ffefffff ffffffff fffffffe
B: REL=343
B: ABS=1 30000
B: MSC=10

however event 6 is showing up without the IR dongle. strange

I'm going to retry all this using event 6 now.



edit, no joy. I guess my problem is the redirection not working. What event it uses is irrelevant as we're using "input:b0003v06B4p1C70e0110-e0*" to do the redirect.

ls -l /dev/input/* results in

Quote:crw-r----- 1 root root 13, 64 2009-08-25 18:18 /dev/input/event0
crw-r----- 1 root root 13, 65 2009-08-25 18:18 /dev/input/event1
crw-r----- 1 root root 13, 66 2009-08-25 18:18 /dev/input/event2
crw-r----- 1 root root 13, 67 2009-08-25 18:18 /dev/input/event3
crw-rw----+ 1 root root 13, 68 2009-08-25 18:18 /dev/input/event4
crw-r----- 1 root root 13, 69 2009-08-25 18:18 /dev/input/event5
crw-rw----+ 1 root root 13, 70 2009-08-25 18:46 /dev/input/event6
crw-r----- 1 root root 13, 71 2009-08-25 18:18 /dev/input/event7
crw-r----- 1 root root 13, 72 2009-08-25 18:18 /dev/input/event8
crw-r----- 1 root root 13, 73 2009-08-25 18:18 /dev/input/event9
crw-r----- 1 root root 13, 63 2009-08-25 18:18 /dev/input/mice
crw-r----- 1 root root 13, 32 2009-08-25 18:18 /dev/input/mouse0
crw-r----- 1 root root 13, 33 2009-08-25 18:46 /dev/input/mouse1
crw-r----- 1 root root 13, 34 2009-08-25 18:18 /dev/input/mouse2

Am I missing something obvious?
(This post was last modified: 2009-08-25 17:39 by Anastrophe.)
find quote
Anastrophe Offline
Member+
Posts: 236
Joined: Mar 2004
Reputation: 0
Location: Dubai, UAE
Post: #20
BTW, gnome is still accepting keypressed from the remote as if it was a keyboard.
find quote