![]() |
|
[LINUX] HOW-TO get Logitech Harmony Universal Remote + Custom Buttons working in XBMC - Printable Version +- XBMC Community Forum (http://forum.xbmc.org) +-- Forum: Announcements, Info, and General Discussion (/forumdisplay.php?fid=85) +--- Forum: Tips, tricks, and step by step guides (/forumdisplay.php?fid=110) +--- Thread: [LINUX] HOW-TO get Logitech Harmony Universal Remote + Custom Buttons working in XBMC (/showthread.php?tid=67350) |
[LINUX] HOW-TO get Logitech Harmony Universal Remote + Custom Buttons working in XBMC - hogfan - 2010-01-14 21:09 Goal I have written this guide due to the recent difficulties I had getting my Harmony 880 remote's custom buttons working on a minimial installation of Ubuntu Jaunty Jackelope w/ XBMC 9.11 Camelot. There is a lot of good, but confusing information on the boards on this topic, so this guide is intended to be a clear, non-confusing step-by-step through the process. You should follow these steps in order to get your Harmony Remote's custom buttons working to perform XBMC functions. We will be doing this for the Harmony 880, but these instructions should apply to almost all Harmony models. So lets dive in! Prerequisites - minimal install of Jaunty or Karmic (or XBMC Live installed to HDD) - XBMC 9.11 Camelot (or newer SVN build) - Lirc should already be installed (however, I will show you how) - an IR receiver (not IRda) connected to to your HTPC - a Harmony Universal Remote Overview In this guide we will be using the Original XBOX DVD Dongle (from the DVD Playback Kit) as our IR receiver. However, most of the following instructions will apply as long as you already have your Harmony working with basic buttons in XBMC with whatever IR receiver you have. For instructions on attaching the XBox DVD dongle to to your HTPC with a USB cable, see HERE, or if you can't solder or just want to do it the easy way, buy one of THESE. Make sure Lirc is Installed & Setup your lircd.conf File. We are assuming that Lirc is already installed on your HTPC, and that you already have your basic buttons working on your Harmony remote. However, if not do the following: On your HTPC press CTRL+ALT+F2 to bring up the terminal. (alternately you can SSH into your HTPC and perform the steps from a remote terminal session) Type: Code: sudo apt-get install lircYou will be prompted to install Lirc. Press Y and hit enter. Ok, so now that Lirc is installed, we need to setup our lircd.conf file so that Lirc knows about our remote. At the terminal Type: Code: sudo nano /etc/lirc/lircd.confYou can now use the arrow keys to move down and enter the necessary button and remote codes for your device (or past them in). The lircd.conf file if you are using the Xbox DVD Playback Kit should look something like this: Code: begin remoteOnce all codes have entered, press CTRL+O and then ENTER to save the file. Then press CTRL+X to return to the terminal. Now that our lircd.conf has been setup, lets test and see if we have basic commands working on our Harmony remote in XBMC. Go ahead and type: Code: sudo rebootYour HTPC will reboot and boot back into XBMC. (continued) - hogfan - 2010-01-14 21:12 Part 2 Getting Basic Harmony Remote Functions working in XBMC XBMC 9.11 Camelot has support for several remotes out-of-the-box, including the original Xbox DVD Playback Kit & the Microsoft Media Center Remote, so our Harmony remote should just work in XBMC after we have set it up as the Xbox DVD Plackback Kit in the Harmony software. Set Up your remote in the Harmony Application or Web App Add XBMC Media Center as a new Device in the Harmony app, by choosing Game Console w/ DVD --> Microsoft -- XBOX. You then may be prompted to Plug your Harmony remote into your computer to have it learn commands from the original remote. (you may or may not have to perform this step). Once this has been completed, create a new Activity for XBMC. I called mine "Launch XBMC", and setup the activity as appropriate for your equipment. Now test your Harmony remote in XBMC. You should be able to use all of the basic buttons on the remote. Choosing Custom Buttons/XBMC actions Ok so now we are successfully using our Harmony remote in XBMC! Woohoo! But wouldn't it be nice to have some buttons for XBMC actions? Well lets get on with it! We first need to decide what XBMC functions we want our custom buttons to perform. I wanted custom buttons to do the following: Update Video Library Update Music Library Show Weather Filemanager Reset XBMC (restarts XBMC application only) Reboot XBMC (reboots the entire HTPC) Clean Video Library Clean Music Library Take Screenshot A full list of available functions can be found in the XBMC WIKI HERE. Also, the Harmony 880 remote does not have a TITLE button which is used on the Xbox DVD Playback Kit remote. We need to setup a custom button as well to "Show Context Menu" in XBMC. We will do this when setting up the other custom buttons on our remote. Add Custom Buttons for XBMC to the Harmony Remote Ok, now that we know what actions we want our custom buttons to perform, lets create these new buttons on our Harmony 880. Open the Harmony Application and go to the Launch XBMC Activity we created. Click "Customize Buttons". Next, click on the Additional Buttons tab. Now the trick here is to map our custom buttons to available buttons that are NOT used by the XBOX DVD remote. Enter the name for your new button in the Label field, choose XBMC Media Center as the device to control, and then choose an un-used button for each button you add.TIP: Only use one of of the PowerOn, PowerOff, PowerToggle buttons as they use the same code. Also, I encountered weird behavior with the Angle button so I would avoid it too (it returned multiple codes). Now lets go ahead and create a replacement for that missing title button mentioned earlier. Type in: show Context, choose XBMC Media Center as the device and choose, Title as the button. Your custom button configuration should look something like this: ![]() Once you have finished adding you custom buttons, click the Done button, connect your Harmony 880 to your computer and update it to reflect the changes we just made. (contined) - hogfan - 2010-01-14 21:16 Part III Configure Files to get Custom Buttons working in XBMC Ok, we are now at the part where it gets rather confusing with all of the older guides out there. We will be working with 4 configuration files to get our custom buttons working in XBMC. The files are: hardware.conf - hardware config for Lirc (I didnt' have to do much with this file until upgrading to Lucid Lynx) lircd.conf - our Lirc configuration file Lircmap.xml - Maps XBMC functions to Lirc commands remote.xml - tells our remote how to function in XbMC by referencing Lircmap.xml IMPORTANT: We will NOT be working with the file keymap.xml! This file no longer exists as of XBMC 9.11 Camelot. Basically this file has been split into remote.xml & keyboard.xml. This has been the cause of a lot of confusion when setting up remote configurations lately. Getting the RAW button codes for the New Custom Buttons Ok, so we've got basic functionality in XBMC, and we have setup our new custom buttons for our Harmony remote and update the remote. Now it's time to get the RAW button codes for our newly created buttons. On your HTPC press CTRL+ALT+F2 to bring up the terminal. (alternately you can SSH into your HTPC and perform the steps from a remote terminal session) We need to stop Lirc so we can run a Lirc utility called Mode2. Mode2 will give us the RAW button codes for our new custom buttons we created. To stop Lirc, type: Code: sudo /etc/init.d/lirc stopNow type: Code: sudo mode2 -r -d /dev/lirc0Add The Custom Buttons to lircd.conf Ok, now that we have the raw button codes for all of our custom buttons, it is time to add them to our lircd.conf file. At the terminal Type: Code: sudo nano /etc/lirc/lircd.confCode: begin remoteOnce all codes have entered, press CTRL+O and then ENTER to save the file. Then press CTRL+X to return to the terminal. (continued) - hogfan - 2010-01-14 21:19 Part IV Setting up Lircmap.xml Now that we have our lircd.conf file all setup, we need to configure Lircmap.XML so that it knows about the new button codes we just added to lircd.conf. Copy the file /usr/share/xbmc/system/Lircmap.xml to your home folder ~/xbmc/.xbmc/userdata At this point, you can follow the steps above to edit the Lircmap.xml in your userdata folder from the terminal with nano, or if you have FTP/SSH access to your HTPC, you can simply copy this file down to your computer to edit it and upload it back to the HTPC. The choice is yours. The Lircmap.xml by default contains mappings for several remotes. If you do not plan to use any other remotes, I recommend removing the sections for remotes other than the XboxDVDDongle. This does nothing more than cleanup the file. Now we need to create <obc##> tags to map our XBMC funtions to our new custom button commands in the lircd.conf file. On the Linux platform, we will simply use any numeric codes that are not already in use by the Xbox DVD remote in place of ## in the <obc##> tags. To see a chart of what codes are in use click HERE. When completed our Lircmap.xml file should look something like the sample below. Notice that within the <obc##> tags, we have entered the name of the XBMC Function we created in our lircd.conf file. (ie.<obc117>UPVID</obc117>) Code: <lircmap>Now save your Lircmap.xml file and exit to the terminal, or FTP your edited file back up to your HTPC in ~/XBMC/.xbmc/userdata. Setting up remote.xml The last configuration file we need to edit is remote.xml. All we will be doing in this file is adding a small section to add support for our custom obc##'s we just finished setting up in the Lircmap.xml file. Copy the file /usr/share/xbmc/system/keymaps/remote.xml to your home folder in ~/xbmc/.xbmc/userdata/keymaps/remote.xml Edit this file the same way you edited Lircmap.xml, either with nano from the terminal via your computer if you are using the FTP method. Add the following section to your remote.xml file immediately after the <global> tag, but before the <remote> tag: Code: <universalremote>Replace the ## in the <obc##> tags with the corresponding numeric codes you used in your Lircmap.xml file. With each set of tags, insert the XBMC function that you want to perform. When complete the <universalremote> section of your remote.xml file should look something like this: Code: <universalremote>Now save your remote.xml file and exit to the terminal, or FTP your edited file back up to your HTPC in ~/XBMC/.xbmc/userdata/keymaps. Reboot your HTPC and Test your Remote At the terminal type: Code: sudo rebootWhen XBMC comes back up, test out the newly configured custom buttons on your Harmony 880. Everything should be working now. If it is still not working, check your Lircmap.xml and remote.xml files to verify you closed all of your <obc##> tags (</obc##>), and then reboot and try again. IMPORTANT: UPDATED INFO FOR LIRC ON LUCID LYNX Ok, I'm not sure why I didn't really need to configure this file in Lirc back on Jaunty or Karmic, but editing etc/lirc/hardware.conf as follows got my remote working again on Lucid Lynx: Code: # /etc/lirc/hardware.confI hope those of you out there who are new to Linux or are struggling with getting your Harmony remote working find this guide helpful. I will try to answer any questions. Thanks and enjoy! -hogfan - Blue_Calx - 2010-01-15 05:13 This is awesome information. Thank you! Awesome Post - ohoffm - 2010-01-15 18:46 This is exactly what I have been looking for to get my Revo going with xbmc live install Thanks. - hogfan - 2010-01-15 20:14 Glad you find it helpful. Hopefully a mod will see it and move it to the Tutorials section. - myrison - 2010-01-15 21:00 Good stuff, thanks for posting. It is a great reference for a non Harmony remote as well.
- Evin - 2010-01-16 03:08 I'm using a mceusb-receiver. When I stop lirc and use Mode2 I get this after pressing a button: Code: space 101600Any ideas?
- GhostDog - 2010-01-16 05:04 Nice work. You may want to mention that you renamed "Game Console w/ DVD --> Microsoft -- XBOX" (MS Xbox) Device to "XBMC Media Center". I just left mine as "MS Xbox". ![]() I actually mapped the "TITLE" function to the Menu button on my harmony. |