2008-11-13, 01:39
Over the past few days, I have been configuring my new Antec MicroFusion Remote case to work with LIRC and LCDproc. Here is what I did to get it to work in XBMC on Ubuntu 8.04.1 and 8.10 (I had some issues getting my audio to work in Intrepid, so I reverted back to Hardy):
Before starting, I wanted to make sure I had everything I needed. Here is what I ran:
Next, you need to make sure you don't load the usbhid driver for the iMON device:
You will want to look for the device that has Vendor=152c and ProdID=0038. In that device's block, you will see a section labeled "Driver". If it says "none", you can skip the next step and continue with the install. If it reads "usbhid", enter the following:
Add the following line to the usbhid file:
Now run this:
You will now need to reboot. The device should now no longer read usbhid in the driver section. You can check this be running the "cat cat /proc/bus/usb/devices" line again. Once you have ensured that the Driver section reads "None" continue with the next step.
We need to check out the latest version of LIRC from CVS. Find a suitable directory to store the files, and run these commands:
After running setup.sh, you will see a setup screen. Select the following:
Driver configuration
->USB Devices
-->Soundgraph iMON IR/LCD
The select "Save configuration and run configure"
Run the following:
Modify the following command to match where you have downloaded the LIRC files.
For Ubuntu 8.0.4.1:
For Ubuntu 8.10:
Finally, run this command:
If all goes well, you should be able to reboot and have your device recognized. You can check this by running the same cat /proc/bus/usb/device command and look in the driver section. It should now read "imon_lcd".
Now, you are ready to setup the lirc.conf file. The case that I have comes with a crappy remote that only has a few buttons on it. I wanted to use the old MCE remote I've had for ages to control XBMC. If you have one of these remotes, you can use the following commands to get it set up:
Paste the following into the file, overwriting anything that was there before:
The new Antec IR/LCD devices actually create two lirc devices. This caused much frustration until I figured out that I needed to launch 2 lirc instances.
You can now start the two instances of LIRCD.
If all is well, you should now be able to run the the command "irw". After executing, press buttons on your remote and you should see them appear in your console. You can also check your LIRC installations by running the following commands:
The LCD should now display the clock (it is not the correct time, though). If you see the display change, you are ready to install LCDproc. Clear your LCD screen by running this:
Download the LCDproc files and required patches:
Extract the LCDproc files:
Use the first patch on LCDproc files:
Next you will want to make some changes to the LCD refresh rate. From what I've read, this increases the stability of the device
Edit RENDER_FREQ. Change it from 8 to a lower number. I used 4
Install LCDProc now:
Patch the LCDd.conf to work with the LCD
You should now have a working LIRC and LCDproc. I ensured that everything restarted at reboot my modifying the crontab file:
Add the following lines at the end:
I'm sure there is a better method to do this, so perhaps someone will reply and let me know what to do.
Last, but definitely not least, you have to configure XBMC to look for your new remote. I added this to my Lircmap.xml file:
When you restart XBMC, the remote should now work.
Good luck!
Before starting, I wanted to make sure I had everything I needed. Here is what I ran:
Code:
sudo apt-get install lirc-modules-source cvs build-essential dialog libtool automake1.9 autoconf
sudo apt-get build-dep lirc lcdproc
sudo apt-get remove lirc lcdproc
Next, you need to make sure you don't load the usbhid driver for the iMON device:
Code:
sudo mount -t usbfs none /proc/bus/usb
sudo cat /proc/bus/usb/devices
You will want to look for the device that has Vendor=152c and ProdID=0038. In that device's block, you will see a section labeled "Driver". If it says "none", you can skip the next step and continue with the install. If it reads "usbhid", enter the following:
Code:
sudo /etc/modprobe.d/usbhid
Add the following line to the usbhid file:
Code:
options usbhid quirks=0x15c2:0x0038:0x0004
Now run this:
Code:
sudo depmod -ae
sudo update-initramfs -u
You will now need to reboot. The device should now no longer read usbhid in the driver section. You can check this be running the "cat cat /proc/bus/usb/devices" line again. Once you have ensured that the Driver section reads "None" continue with the next step.
We need to check out the latest version of LIRC from CVS. Find a suitable directory to store the files, and run these commands:
Code:
cvs -d:pserver:[email protected]:/cvsroot/lirc login
cvs -z8 -d:pserver:[email protected]:/cvsroot/lirc co lirc
cd lirc
./autogen.sh
./setup.sh
After running setup.sh, you will see a setup screen. Select the following:
Driver configuration
->USB Devices
-->Soundgraph iMON IR/LCD
The select "Save configuration and run configure"
Run the following:
Code:
make
sudo make install
Modify the following command to match where you have downloaded the LIRC files.
For Ubuntu 8.0.4.1:
Code:
sudo cp .CVS/lirc/drivers/lirc_imon/lirc_imon.c /usr/src/lirc-0.8.3~pre1/drivers/lirc_imon
Code:
sudo cp .CVS/lirc/drivers/lirc_imon/lirc_imon.c /usr/src/lirc-0.8.3/drivers/lirc_imon
Finally, run this command:
Code:
sudo dpkg-reconfigure lirc-modules-source
If all goes well, you should be able to reboot and have your device recognized. You can check this by running the same cat /proc/bus/usb/device command and look in the driver section. It should now read "imon_lcd".
Now, you are ready to setup the lirc.conf file. The case that I have comes with a crappy remote that only has a few buttons on it. I wanted to use the old MCE remote I've had for ages to control XBMC. If you have one of these remotes, you can use the following commands to get it set up:
Code:
sudo nano /etc/lircd.conf
Paste the following into the file, overwriting anything that was there before:
Code:
#Allows the old MCE remote to work with Antec MicroFusion
#Save at /etc/lircd.conf
begin remote
name lirc0.conf
bits 64
eps 30
aeps 100
one 0 0
zero 0 0
post_data_bits 0
post_data 0x0
gap 139998
begin codes
Up 0x0200005200000000
Down 0x0200005100000000
Left 0x0200005000000000
Right 0x0200004f00000000
Back 0x0200002A00000000
Clear 0x0200002900000000
Enter 0x0200002800000000
1 0x0200001E00000000
2 0x0200001F00000000
3 0x0200002000000000
4 0x0200002100000000
5 0x0200002200000000
6 0x0200002300000000
7 0x0200002400000000
8 0x0200002500000000
9 0x0200002600000000
* 0x0220002500000000
0 0x0200002700000000
# 0x0220002000000000
end codes
end remote
begin remote
name lirc1.conf
bits 16
eps 30
aeps 100
one 0 0
zero 0 0
pre_data_bits 16
pre_data 0x800F
post_data_bits 32
post_data 0x1AE
gap 204002
toggle_bit_mask 0x0
begin codes
Start 0x040D
Power 0x840C
Stop 0x0419
Record 0x8417
Pause 0x0418
Play 0x8416
Rewind 0x0415
FastForward 0x8414
SkipBack 0x041B
SkipForward 0x841A
Info 0x040F
ChannelUp 0x8412
ChannelDown 0x0413
VolumeUp 0x8410
VolumeDown 0x0411
Mute 0x840E
RecordedTV 0x0448
Guide 0x0426
LiveTV 0x8425
Menu 0x0424
end codes
end remote
The new Antec IR/LCD devices actually create two lirc devices. This caused much frustration until I figured out that I needed to launch 2 lirc instances.
You can now start the two instances of LIRCD.
Code:
sudo /usr/local/sbin/lircd --driver=default --device=/dev/lirc0 --pidfile=/var/run/lirc0.pid --listen=8765
sudo /usr/local/sbin/lircd --driver=default --device=/dev/lirc1 --pidfile=/var/run/lirc1.pid --output=/dev/lircd --connect=localhost:8765
If all is well, you should now be able to run the the command "irw". After executing, press buttons on your remote and you should see them appear in your console. You can also check your LIRC installations by running the following commands:
Code:
sudo chmod 777 /dev/lcd0
perl -e 'print pack "H*", "80000000091e0088"' > /dev/lcd0
The LCD should now display the clock (it is not the correct time, though). If you see the display change, you are ready to install LCDproc. Clear your LCD screen by running this:
Code:
sudo perl -e 'print pack "H*", "4000000000000088"' > /dev/lcd0
Download the LCDproc files and required patches:
Code:
wget http://internap.dl.sourceforge.net/sourceforge/lcdproc/lcdproc-0.5.2.tar.gz
wget http://www.ronfrazier.net/ronfrazier.net/mythtv/downloads/lcdproc-0.5.2-imonlcd-0.3-v2.patch
wget http://www.ronfrazier.net/ronfrazier.net/mythtv/downloads/lcdproc-imon_0038-v2.patch
wget http://www.ronfrazier.net/ronfrazier.net/mythtv/downloads/LCDd.conf.patch
Extract the LCDproc files:
Code:
tar -zxvf lcdproc-0.5.2.tar.gz
Code:
cd lcdproc-0.5.2
patch -p1 < ../lcdproc-0.5.2-imonlcd-0.3-v2.patch
Next you will want to make some changes to the LCD refresh rate. From what I've read, this increases the stability of the device
Code:
nano server/main.h
Edit RENDER_FREQ. Change it from 8 to a lower number. I used 4
Install LCDProc now:
Code:
aclocal && autoconf && automake
patch -p1 <../lcdproc-imon_0038-v2.patch
./configure --enable-drivers=imonlcd
make
sudo make install
Code:
patch /usr/local/etc/LCDd.conf ../LCDd.conf.patch
You should now have a working LIRC and LCDproc. I ensured that everything restarted at reboot my modifying the crontab file:
Code:
sudo nano /etc/crontab
Add the following lines at the end:
Code:
@reboot root /usr/local/sbin/lircd --driver=default --device=/dev/lirc0 --pidfile=/var/run/lirc0.pid --listen=8765
@reboot root /usr/local/sbin/lircd --driver=default --device=/dev/lirc1 --pidfile=/var/run/lirc1.pid --output=/dev/lircd --connect=localhost:8765
@reboot root chmod 777 /dev/lcd0
@reboot root LCDd
I'm sure there is a better method to do this, so perhaps someone will reply and let me know what to do.
Last, but definitely not least, you have to configure XBMC to look for your new remote. I added this to my Lircmap.xml file:
Code:
<remote device="lirc0.conf">
<left>Left</left>
<right>Right</right>
<up>Up</up>
<down>Down</down>
<select>Enter</select>
<back>Back</back>
<one>1</one>
<two>2</two>
<three>3</three>
<four>4</four>
<five>5</five>
<six>6</six>
<seven>7</seven>
<eight>8</eight>
<nine>9</nine>
<zero>0</zero>
</remote>
<remote device="lirc1.conf">
<pause>Pause</pause>
<stop>Stop</stop>
<forward>FastForward</forward>
<reverse>Rewind</reverse>
<pageplus>ChannelUp</pageplus>
<pageminus>ChannelDown</pageminus>
<back>Back</back>
<menu>Menu</menu>
<title>Guide</title>
<info>Info</info>
<skipplus>Skip</skipplus>
<skipminus>Replay</skipminus>
<display>Teletext</display>
<start>Start</start>
<record>Record</record>
<volumeplus>VolumeUp</volumeplus>
<volumeminus>VolumeDown</volumeminus>
<mute>Mute</mute>
<power>Power</power>
<myvideo>RecordedTV</myvideo>
<mymusic>Music</mymusic>
<mypictures>Pictures</mypictures>
<mytv>LiveTV</mytv>
<mytv>Red</mytv>
<mymusic>Green</mymusic>
<mypictures>Yellow</mypictures>
<myvideo>Blue</myvideo>
</remote>
When you restart XBMC, the remote should now work.
Good luck!