Archive:MS-Tech MC-1200 Remote: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Guido
No edit summary
>Guido
No edit summary
Line 1: Line 1:
This page is all about getting the remote from the MS-Tech MC-1200 case to work completely with XBMC.
[[File:Mc-1200_gross.jpg]]
[[File:Mc-1200_gross.jpg]]


Line 6: Line 8:
We get the vendor id and the product id from ''/proc/bus/input/devices'':
We get the vendor id and the product id from ''/proc/bus/input/devices'':


  cat /proc/bus/input/devices
  cat /proc/bus/input/devices > devices.txt
nano devices.txt


the output is something like this:
the output is something like this:
Line 12: Line 15:
...
...


I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
I: Bus=0003 Vendor=04b4 Product=0101 Version=0100
N: Name="HID 05a4:9881"
N: Name="Cypress Cypress USB Keyboard / PS2 Mouse"
P: Phys=usb-0000:00:06.0-1/input0
P: Phys=usb-0000:00:06.0-3/input0
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-1/4-1:1.0/input/input4
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-3/4-3:1.0/input/input4
U: Uniq=
U: Uniq=
H: Handlers=kbd event4  
H: Handlers=kbd event4  
B: EV=120013
B: EV=120013
B: KEY=e080ffdf01cfffff fffffffffffffffe
B: KEY=800000 0 e0b0ffdf 1cfffff ffffffff fffffffe
B: MSC=10
B: MSC=10
B: LED=7
B: LED=1f


I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
I: Bus=0003 Vendor=04b4 Product=0101 Version=0100
N: Name="HID 05a4:9881"
N: Name="Cypress Cypress USB Keyboard / PS2 Mouse"
P: Phys=usb-0000:00:06.0-1/input1
P: Phys=usb-0000:00:06.0-3/input1
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-1/4-1:1.1/input/input5
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-3/4-3:1.1/input/input5
U: Uniq=
U: Uniq=
H: Handlers=kbd mouse1 event5  
H: Handlers=kbd mouse1 event5  
B: EV=17
B: EV=17
B: KEY=1f0000 2020000 3878d801d001 1e000000000000 0
B: KEY=70000 0 2010000 3978 d840d000 1e0000 0 0 0
B: REL=103
B: REL=103
B: MSC=10
B: MSC=10


...
...
</pre>
</pre>


What we need are the numbers behind ''Vendor='' and ''Product=''. In my case '''04b4''' and '''0101'''.
Now we write a new rules file for udev:


sudo nano /etc/udev/rules.d/10-irremote.rules


Zorg dat remote altijd bereikbaar is op zelfde adres:
and put the following content in:
<pre>
SUBSYSTEM=="input",ATTRS{idVendor}=="04b4",ATTRS{idProduct}=="0101",ATTR{class}=="kbd",SYMLINK="input/irremote0"
SUBSYSTEM=="input",ATTRS{idVendor}=="04b4",ATTRS{idProduct}=="0101",ATTR{class}=="mouse",SYMLINK="input/irremote1"
</pre>


nano /proces/bus/input/devices
Now restart udev and trigger a new discovery:


output is zoiets als:
sudo restart udev
I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
sudo udevadm trigger
N: Name="HID 05a4:9881"
P: Phys=usb-0000:00:06.0-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-1/4-1:1.0/input/input4
U: Uniq=
H: Handlers=kbd event4
B: EV=120013
B: KEY=e080ffdf01cfffff fffffffffffffffe
B: MSC=10
B: LED=7


I: Bus=0003 Vendor=05a4 Product=9881 Version=0110
Under /dev/input should now be two more symlinks: irremote0 and irremote1:
N: Name="HID 05a4:9881"
P: Phys=usb-0000:00:06.0-1/input1
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-1/4-1:1.1/input/input5
U: Uniq=
H: Handlers=kbd mouse1 event5
B: EV=17
B: KEY=1f0000 2020000 3878d801d001 1e000000000000 0
B: REL=103
B: MSC=10


ls /dev/input


Benodigd is de Phys van Cypress Cypress USB Keyboard / PS2 Mouse
== Inputlirc installation ==


creeer een regel voor udev:
First you have to install inputlirc:
sudo nano /etc/udev/rules.d/10-irremote.rules


SUBSYSTEM=="input",ATTRS{phys}=="usb-0000:00:06.0-3/input0",SYMLINK=="input/irremote0"
sudo apt-get update
SUBSYSTEM=="input",ATTRS{phys}=="usb-0000:00:06.0-3/input1",SYMLINK=="input/irremote1"
sudo apt-get install inputlirc


Herstart udev en trigger een ontdekking:
Then you need to configure it properly:
sudo restart udev
sudo udevadm trigger
ls /dev/input
hier zouden nu twee symlinks moeten staan: irremote0 en irremote1


Installeer inputlirc
sudo nano /etc/default/inputlirc
sudo apt-get update
sudo apt-get install inputlirc
sudo nano /etc/default/inputlirc


and put the following content in:
<pre>
EVENTS="/dev/input/irremote0 /dev/input/irremote1"
EVENTS="/dev/input/irremote0 /dev/input/irremote1"
OPTIONS="-g -m0 -c -d /var/run/lirc/lircd"
OPTIONS="-g -m0 -c -d /var/run/lirc/lircd"
</pre>
The entries unter EVENTS are the devices we created via udev.
The OPTION entries mean the following:
{|
|-
!-g
|Grabs the input from the devices, specified under EVENTS, so that no other application interferes with it.
|-
!-m 0
|By default, all keycodes below 88 are filtered out. This setting ensures, that all keycodes are captured
|-
!-c
|Because some of the keys on the remote are mapped to keys with modifiers, this option maps this codes to single events.
|}
Now restart inputlirc
sudo /etc/init.d/inputlirc restart
You can now test the device via 'irw':
irw
This is some sample output from irw:
<pre>
14 0 CTRL_SHIFT_KEY_T irremote0
a4 0 KEY_PLAYPAUSE irremote1
a4 0 KEY_PLAYPAUSE irremote1
a6 0 KEY_STOPCD irremote1
110 0 BTN_LEFT irremote1
</pre>


Herstart inputlirc
sudo /etc/init.d/inputlirc restart


test de remote via irw
irw


Creeer een bestand in ~/.xbmc/userdata/Lircmap.xml
Creeer een bestand in ~/.xbmc/userdata/Lircmap.xml

Revision as of 09:17, 8 September 2010

This page is all about getting the remote from the MS-Tech MC-1200 case to work completely with XBMC.

Mc-1200 gross.jpg

UDev rule

First you have to create an own udev rule to ensure, that your device nodes are always the same.

We get the vendor id and the product id from /proc/bus/input/devices:

cat /proc/bus/input/devices > devices.txt
nano devices.txt

the output is something like this:

...

I: Bus=0003 Vendor=04b4 Product=0101 Version=0100
N: Name="Cypress Cypress USB Keyboard / PS2 Mouse"
P: Phys=usb-0000:00:06.0-3/input0
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-3/4-3:1.0/input/input4
U: Uniq=
H: Handlers=kbd event4 
B: EV=120013
B: KEY=800000 0 e0b0ffdf 1cfffff ffffffff fffffffe
B: MSC=10
B: LED=1f

I: Bus=0003 Vendor=04b4 Product=0101 Version=0100
N: Name="Cypress Cypress USB Keyboard / PS2 Mouse"
P: Phys=usb-0000:00:06.0-3/input1
S: Sysfs=/devices/pci0000:00/0000:00:06.0/usb4/4-3/4-3:1.1/input/input5
U: Uniq=
H: Handlers=kbd mouse1 event5 
B: EV=17
B: KEY=70000 0 2010000 3978 d840d000 1e0000 0 0 0
B: REL=103
B: MSC=10  

...

What we need are the numbers behind Vendor= and Product=. In my case 04b4 and 0101.

Now we write a new rules file for udev:

sudo nano /etc/udev/rules.d/10-irremote.rules

and put the following content in:

SUBSYSTEM=="input",ATTRS{idVendor}=="04b4",ATTRS{idProduct}=="0101",ATTR{class}=="kbd",SYMLINK="input/irremote0"
SUBSYSTEM=="input",ATTRS{idVendor}=="04b4",ATTRS{idProduct}=="0101",ATTR{class}=="mouse",SYMLINK="input/irremote1"

Now restart udev and trigger a new discovery:

sudo restart udev
sudo udevadm trigger

Under /dev/input should now be two more symlinks: irremote0 and irremote1:

ls /dev/input

Inputlirc installation

First you have to install inputlirc:

sudo apt-get update
sudo apt-get install inputlirc

Then you need to configure it properly:

sudo nano /etc/default/inputlirc

and put the following content in:

EVENTS="/dev/input/irremote0 /dev/input/irremote1"
OPTIONS="-g -m0 -c -d /var/run/lirc/lircd"

The entries unter EVENTS are the devices we created via udev. The OPTION entries mean the following:

-g Grabs the input from the devices, specified under EVENTS, so that no other application interferes with it.
-m 0 By default, all keycodes below 88 are filtered out. This setting ensures, that all keycodes are captured
-c Because some of the keys on the remote are mapped to keys with modifiers, this option maps this codes to single events.


Now restart inputlirc

sudo /etc/init.d/inputlirc restart

You can now test the device via 'irw':

irw

This is some sample output from irw:

14 0 CTRL_SHIFT_KEY_T irremote0
a4 0 KEY_PLAYPAUSE irremote1
a4 0 KEY_PLAYPAUSE irremote1
a6 0 KEY_STOPCD irremote1
110 0 BTN_LEFT irremote1


Creeer een bestand in ~/.xbmc/userdata/Lircmap.xml

  <lircmap>
      <remote device="irremote0">
  	  <play>CTRL_SHIFT_KEY_P</play>
          <pause>CTRL_KEY_P</pause>     
          <stop>CTRL_SHIFT_KEY_S</stop> 
          <forward>CTRL_SHIFT_KEY_F</forward>
          <reverse>CTRL_SHIFT_KEY_B</reverse>
          <skipplus>CTRL_KEY_F</skipplus>
          <skipminus>CTRL_KEY_B</skipminus>
          <left>KEY_LEFT</left>
          <right>KEY_RIGHT</right>
          <up>KEY_UP</up>
          <down>KEY_DOWN</down>
          <select>KEY_ENTER</select>
          <pageplus>KEY_PAGEUP</pageplus>
          <pageminus>KEY_PAGEDOWN</pageminus>
          <one>KEY_1</one>
          <two>KEY_2</two>
          <three>KEY_3</three>
          <four>KEY_4</four>
          <five>KEY_5</five>
          <six>KEY_6</six>
          <seven>KEY_7</seven>
          <eight>KEY_8</eight>
          <nine>KEY_9</nine>
          <zero>KEY_0</zero>
          <hash>SHIFT_KEY_3</hash>
          <star>KEY_KPASTERISK</star>
          <clear>KEY_DELETE</clear>
          <record>CTRL_KEY_R</record>
          <menu>ALT_KEY_ENTER</menu>
          <info>CTRL_KEY_G</info>
          <title>KEY_COMPOSE</title>
          <back>KEY_BACKSPACE</back>
          <display>ALT_META_KEY_ENTER</display>
          <start></start>
          <mytv>CTRL_SHIFT_KEY_T</mytv>
          <mymusic>CTRL_KEY_M</mymusic>
          <mypictures>CTRL_KEY_I</mypictures>
          <myvideo>CTRL_KEY_E</myvideo>
      </remote>
      <remote device="irremote1">
          <power>KEY_POWER</power>
          <volumeplus>KEY_VOLUMEUP</volumeplus>
          <volumeminus>KEY_VOLUMEDOWN</volumeminus>
          <mute>KEY_MIN_INTERESTING</mute>
      </remote>
</lircmap>