Configure iMON PAD/VFD in LinuxMCE

iMON PAD and VFD

Preface

iMON IR receiver and VFD display are used by many producers of cases for HTPC. One of most popular of them is SilverStone. LinuxMCE doesn’t support them from the box but there is a way to add it into system. That howto explains the steps which should be performed to do that.

iMON PAD

The driver for iMON IR receiver is included in the LIRC distribution since version 0.7.1. To add it to LinuxMCE you should do following:

  1. Go to Advanced :: Configuration :: Device Templates, add new manufacture – SoundGraph, add a new template for that manufacture (choose LIRC Remote Control as Device Category)
  2. In the new template add a property – Configuration and put there LIRC configuration file for iMON PAD, for example, you can use that one – [Download not found].
  3. To be able to control MythTV add content of that file – [Download not found] into /home/mythtv/.mythtv/lircrc. For VDR replace LIRC section in the remote.conf by this codes [Download not found]
  4. Go to Wizard :: Media Directors and add iMON PAD remote control by pressing the button ‘Add Remote’ on the bottom of the form. After that all needed LIRC packages will be downloaded and installed automatically. You shouldn’t do that manually!
  5. Quick reload router. You should see running lircd process:
    ps -elf|grep lircd
    and file /etc/lircd/lircd.conf should contain the content of iMON PAD property Configuration.
  6. To test you remote control you can use utility irw. Just run it and press a few buttons on the remote. You should see the actual IR command as irw output.

As I mentioned above iMON remote control is supported by LIRC from the box. But to use iMON PAD buttons you have to re-compile LIRC with applied patch [Download not found]:

tar xvjf lirc-0.8.2.tar.bz2
CD lirc-0.8.2
patch -p1 < ../lirc-imon-pad2keys.patch ./configure make make install

  • download sources of LIRC 0.8.2 and diff file from Ubuntu site.
  • untar LIRC sources and apply diff to build the package:
    tar -vzxf lirc_0.8.2.orig.tar.gz
    CD lirc-0.8.2
    patch -p0 < ../lirc_0.8.2-0ubuntu8.diff
  • Apply iMON PAD patch:
    patch -p1 < ../lirc-imon-pad2keys.patch
  • Build the package:
    dpkg-buildpackage -rfakeroot
  • Note:

    • if you see error message 'dialog not found!' install dialog:
      apt-get install dialog
    • if you get en error: configure: error: C++ preprocessor "/lib/cpp" fails sanity check install build-essential:
      apt-get install build-essential

    iMON VFD display

    Note: the LCDProc includes supporting of iMON VFD display since version 0.5.0. You shouldn't compile it from the sources just install LCDProc using apt-get -
    sudo apt-get install lcdproc
    and define imon driver in the LCDd.conf.
    • Download the latest snapshot from venky.ws.
    • Untar the tarball: tar vzxf lcdproc-X.X.X-imon.tgz
    • Go to the lcdproc-X.X.X-imon directory, apply this patch [Download not found] to avoid display good bye message after PC will be switch off.
    • Prepare installation:
      aclocal && autoheader && autoconf && automake -a
      or get already patched version - [Download not found].
    • Run ./configure && make && make install
    • Copy LCDd.conf to /usr/local/etc or modify script /etc/init.d/lcdd to point on LCDd.conf
    • Copy Debian scripts to the /etc/init.d:
      cp scripts/init-lcdd.debian /etc/init.d/lcdd
      and run update-rc.d lcdd defaults to create symlinks to start/stop lcd daemon and client.
    • Make a symlink: ln -s /usr/local/sbin/LCDd /usr/local/bin if you install LCD in the default path.

    The configuration file LCDd.conf contains a set of options for LCDd. Most of them are already defined. So, probably you won't touch that file. However, it might be useful for troubleshooting set following options:
    ReportLevel=5
    ReportToSyslog=yes

    To get more debug information in the /var/log/syslog.
    It's also possible to run LCDd from command line:
    LCDd -c <config file> -d <driver>
    In our case the command should be like that:
    LCDd -c LCDd.conf -d imon

    Enable VFD display in MythTV

    You can find the setup options in Utilities/Setup->Setup->Appearance->LCD device display. Tick the box Enable VFD device and a few options appear. To bring some data to VFD display mythlcdserver should be run.

    Enable VFD display in VDR

    To be able use VFD display with VDR you have to install plug-in vdr-lcdproc:

    • Download and untar somewhere appropriate version of VDR sources (1.4.7 in case of LinuxMCE)
    • Download the latest version of vdr-lcdproc plug-in
    • Untar it into <your_vdr_src_dir>/PLUGINS/src and make a symlink - ln -s lcdproc-0.0.10-jw2 lcdproc
    • Build plug-in: make plugins. Note, for AMD64 you should add option -fPIC to the CXXFLAGS into lcdproc Makefile. Otherwise you'll get this error:
      /usr/bin/ld: lcdproc.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
      lcdproc.o: could not read symbols: Bad value
    • Copy <your_vdr_src_dir>/PLUGINS/lib/libvdr-lcdproc.so.1.4.5 to the /usr/lib/vdr/plugins
    • Add a new config file plugin.lcdproc.conf into /etc/vdr/plugins and put there following options:
      -h 127.0.0.1
      -p 13666

      Where -h defines LCDProc host and -p - LCDProc port (you can find those values in the /etc/LCDProc.conf)
    • Restart VDR:
      sudo /etc/init.d/vdr restart
    Note: if by some reason you don't have VDR sources just install VDR headers:
    sudo apt-get install vdr-dev
    apply that patch - [Download not found] to the vdr-lcdproc sources
    CD lcdproc-0.0.10-jw2
    patch -p0 < ../lcdproc-0.0.10-jw2-package.diff
    and build the package
    dpkg-buildpackage -rfakeroot
    Then install created package and restart VDR.

    Now your VFD display should display information from VDR.

    You may use my built package for AMD64 - [Download not found].

    Media Director Issue

    To compile lcdproc on diskless media director you have install following packages first:

    • gcc
    • libc6-dev
    • kernel-headers
    • libncurses5-dev
    • dialog

    Troubleshooting

    If your remote control or VFD display doesn't work check following:

    • LIRCd needs /dev/lirc0 and LCDProc - /dev/lcd0. If you cannot see them then something is wrong.
    • Check /var/log/syslog. It can contain an error message about problems with LIRCd config file. This is a common case (at least for me).
    • Check connection iMON VFD with USB port. I spent some time to figure out why my remote doesn't work but iMON VFD USB cable was plugged not very well.

    See also