Add support for new remote controls
|Version||Status||Date Updated||Updated By|
In general, adding support for a new remote control is accomplished by pressing each button and capturing a key code sent by the remote. Once the key code captured for each key, they are organized into a map that is used to configure LinuxMCE.
There are a variety of different infrared (IR) receivers that work with LinuxMCE. Infrared receivers are small pieces of hardware that have an infrared-sensitive "eye" and plug into a computer. Some examples of LinuxMCE compatible IR receivers are USB UIRT, Tira, and IRTrans.
For some IR receivers, the best support is via LIRC, while for others, purpose-built LinuxMCE drivers are available.
Learning Is Specific to Combination of Receiver and Remote
The key code that is captured when a button is pressed depends on both the remote control model and the receiver model. That is, the key codes that you capture from a Windows MCE Remote with USB UIRT are different from those captured from the same remote with Tira or IRTrans.
Adding Support for a New Remote using a USB UIRT Receiver
The technique in this section was originally provided in this forum post.
To add support for a new remote using USB UIRT as a receiver, perform the steps below. Note that most of the configuration is performed through the Web Admin Page:
- 1. Verify USB UIRT is installed and configured: Once you plug in the USB UIRT it should be plug and play and add both the USB UIRT device as well as the Windows XP MCE Remote (USBUIRT). Go to Wizard->devices->media directors. Near the bottom of the page you should see the MCE remote listed, with the Infrared Receivers pulldown set to USB UIRT 0038.
- 2. Create a new template for your remote: Go to Advanced->Configuration->Device Templates.
Select the remote's manufacturer and USB-UIRT Remote Controls < Remote Controls < Peripherals from Device Category then click Add Device Template. This will open the Add device template window. Enter the name or model # of the remote followed by (USBUIRT) into the text box and click Add. Try to be descriptive and unambiguous if you don't have a model number. For example, a good name for the remote that comes bundled with the Hauppauge PVR-150 is PVR-150 remote (USBUIRT). The number of characters allowed is limited, so you'll have to use your judgment to come up with a good name.
- 3. Configure the remote correctly: Go to Advanced->Configuration->Device Templates, find the remote you just added (you may have to refresh your browser to see it), and click the Pick Template button. This brings up the Edit Device Template window. Change the Device Category to Peripherals - Remote Controls - USB-UIRT Remote Controls. Select the correct manufacturer for your remote.
- 4. Get the USB UIRT device ID: From the bottom of the left pane on the Admin Page, click Show devices tree. In the tree, click USB UIRT 0038. Find the device number in the title of the Device Info block. For example, Device Info #50 indicates that the USB UIRT is device #50.
- 5. Capture the key codes: In a terminal window, enter the command
tail -f /var/log/pluto/XX_USB_UIRT_0038.logwhere XX is the device number you found in the previous step. Press a button on the remote control twice. You should see something like this:
05 05/16/08 19:29:18.757 Cannot find anything for IR 1500003E3CFC <0x40800950> 05 05/16/08 19:29:19.021 Cannot find anything for IR 1700009E0FC0 <0x40800950>
- The numbers
1700009E0FC0are the key codes for that button. If the two numbers are the same, then there is only one key code for that button. In a text editor, format the button names and key codes in the same format as this.
- 6. Add the Configuration (string): In the Device Data box select Configuration. Paste the key codes you created in the last step into the Default Value field. Click the Use Master Device List Defaults box.
- 7. Add the Remote Layout (String): In the Device Data box, add the new parameter Remote Layout (String). In the Default Value field enter W.
- 8. Click Save then Close to close the Edit Device Template window.
- 9. Add the remote: Go to Wizard->devices->Media Directors and scroll to the media director that you want to control with the remote. Click Add Remote then select the remote template you just created from the Device Template drop-down. Click Pick Template and then back on the Media Director page, click Update. After this you should be prompted to reload the router, if not do a quick reload.
Once the router reloads, you should have a working remote.
It is helpful to share your key codes with others. See Share IR Codes for details.
LinuxMCE's infrared remote control module is based on LIRC. See http://lirc.org/ for details. LIRC includes an 'IR Record' utility to build a configuration file for a new remote control. Once you do that, then in LinuxMCE Admin choose 'Advanced', 'Device Templates'. Choose the manufacturer, for the Category choose Peripherals, Remote Controls, LIRC Remote controls. Type in the model of the remote and click 'add'. Then edit the device, add a device data "Configuration" and copy the LIRC configuration file into it.
The Programming Guide in Control LinuxMCE using an Infrared remote explains how it all works, and also how to use it.
Adding iMON PAD explains how to add it to the LinnuxMCE.
Sample USB UIRT key codes
power 170000870FC0 1500003F0FC0 stop 1300000F3FFC 170000F80FC0 record 150000383FFC 170000F80FC0 pause 150000303EFC 170000D00FC0 play 130000093FFC 150000390FC0 rewind 1300000F3EFC 150000370FC0 fastforward 1300000B3FFC 1500003B0FC0 skipback 1300000F37FC 1500003F0DC0 skipfwd 150000212DFC 170000A10BC0 back 170000802DFC 190002400BC0 up 1300000B2EFC 150000330BC0 left 1300000F2EFC 150000370BC0 ok 1300000D37FC 1500003D0DC0 right 150000382EFC 170000D80BC0 down 130000092EFC 150000310BC0 volup 150000302FFC 170000F00BC0 voldn 150000322FFC 170000F20BC0 chup 1500002036FC 170000C00DC0 chdown 1500002236FC 170000C20DC0 mute 170000A029FC 190002500AC0 menu 1500002F29FC 170000AF0AC0 1 1700008228FC 190002010AC0 2 1500002328FC 170000830AC0 3 1700008A28FC 190002050AC0 4 1500002F28FC 1700008F0AC0 5 1500002D28FC 1700008D0AC0 6 1500002B28FC 1700008B0AC0 7 170000A828FC 190002140AC0 8 1500003C29FC 170000BC0AC0 9 1500003E29FC 170000BE0AC0 0 1700008028FC 190002000AC0 red 1500003629FC 170000B60AC0 green 1300000933FC 150000390CC0 yellow 150000343CFC 170000940FC0 blue 1300000E31FC 1500002E0CC0 tv 150000252DFC 170000A50BC0 videos 150000342DFC 170000B40BC0 music 150000362DFC 170000B60BC0 pictures 1300000E2DFC 1500002E0BC0 guide 1500003E2DFC 170000BE0BC0 radio 1500002D29FC 170000AD0AC0 previouschannel 1300000F2FFC 1500003F0BC0 go 1500003E3CFC 1700009E0FC0