[Live] IMON LCD/IR full install with MCEUSB on Ubuntu 9.10 and XBMC 9.11 Camelot
#1
Exclamation 
Hi,





after a long journey, i´m proud about my full working config(suspend issue not testet yet) of my Imon 0038 LCD (Silverstone ML02mxr case, Zotac ion Atom 330) configured for MCEUSB (RC6 model) and full customized Harmony 555.



My install ist the 9.11b1 Live HDD install.



You might have to add the standard sources in your etc/apt/sources.list.







I will add here my how to:



1. First you have to configure or install lirc



Install: sudo apt-get install lirc

configure: sudo dpkg-reconfigure lirc


I´ve followed this guide for lirc:



https://help.ubuntu.com/community/IMON_V...armic_9.10



here my modified Guide





You will prompted to Choose a remote if you would like to preload a configuration:



The iMon devices will be listed alphabetically under Soundgraph:

There are several other Soundgraph remotes listed. Pick yours ( in my case IMON IR/LCD) and select OK.



Unless you've added a transmitter you should select None and Ok on the transmitter page.



You should see

* Loading LIRC modules [ OK ]

* Starting remote control daemon(s) : LIRC [ OK ]





Using the correct module parameters



The 9.10 Karmic version of the lirc_imon module has the following parameters:








Code:
debug:Debug messages: 0=no, 1=yes(default: no) (int)
display_type:Type of attached display. 0=autodetect, 1=vfd, 2=lcd, 3=vga, 4=none (default: autodetect) (int)
ir_protocol:Which IR protocol to use. 0=native iMON, 1=Windows Media Center Ed. (RC-6), 2=iMON w/o PAD stabilize (default: native iMON) (int)
nomouse:Disable mouse input device mode when IR device is open. 0=don't disable, 1=disable. (default: don't disable) (int)
pad_thresh:Threshold at which a pad push registers as an arrow key in kbd mode (default: 28) (int)







So create a file at the following location:

/etc/modprobe.d/lirc.conf



and put your choice of those options in it similar to this Imon LCD with MCE RC6 Remote:


Code:
options lirc_imon debug=0 nomouse=1 display_type=2 ir_protocol=1 pad_thresh=5





I've got nomouse enabled because I have no use for it. The pad_thresh is fantastic for using the pad as arrow keys to control things like XBMC. The threshold setting at 5 means I don't have to mash the heck out of the pad to get arrow events to register in lirc. This was a very nice find using modinfo against the lirc_imon module.





Now get my Lircd.conf and hardware.conf and copy it to /etc/lirc/



Lircd.conf

Quote:# this config file was hand-generated
# using lirc-0.8.5 (imon) on Wed Jun 17 23:37:25 2009
#
# contributed by Jarod Wilson <[email protected]>
#
# brand: Philips
# model no. of remote control: Windows Media Center Edition
# devices being controlled by this remote:
# -Antec Veris Multimedia Station Premiere & Elite
# -iMON UltraBay, Touch, VFD, LCD (any recent iMON device)
#
# Note that these codes CANNOT be used with a standard mceusb
# receivers, as they're decoded values passed along by the iMON
# receiver, not the actual RC6 remote codes.
#

begin remote

name MCE_via_iMON
bits 64
eps 30
aeps 100

one 0 0
zero 0 0
gap 139998
ignore_mask 0x0000800000000fff
min_repeat 1
toggle_bit 0

begin codes
KEY_POWER 0x800f040c000002ae # Power
KEY_TV 0x800f0446000002ae # MY TV
KEY_AUDIO 0x800f8447000002ae # MY MUSIC
KEY_PHOTO 0x800f8449000002ae # MY PICTURES
KEY_VIDEO 0x800f044a000002ae # MY VIDEOS
KEY_STOP 0x800f8419000002ae # STOP
KEY_RECORD 0x800f0417000002ae # RECORD
KEY_PAUSE 0x800f8418000002ae # PAUSE
KEY_PLAY 0x800f0416000002ae # PLAY
KEY_REWIND 0x800f8415000002ae # REWIND
KEY_FASTFORWARD 0x800f0414000002ae # FORWARD
KEY_REPLAY 0x800f841b000002ae # REPLAY
KEY_SKIP 0x800f041a000002ae # SKIP
KEY_BACKSPACE 0x0200002a00000000 # BACK
KEY_INFO 0x800f040f000002ae # INFO/MORE
KEY_UP 0x0200005200000000 # UP
KEY_DOWN 0x0200005100000000 # DOWN
KEY_LEFT 0x0200005000000000 # LEFT
KEY_RIGHT 0x0200004f00000000 # RIGHT
#KEY_OK 0x0200002800000000 # OK -- same code as KEY_ENTER
KEY_VOLUMEUP 0x800f0410000002ae # Vol+
KEY_VOLUMEDOWN 0x800f8411000002ae # Vol-
WindowsMCE 0x800f040d000002ae # Big ugly windows logo
KEY_CHANNELUP 0x800f0412000002ae # Ch+
KEY_CHANNELDOWN 0x800f8413000002ae # Ch-
KEY_MUTE 0x800f840e000002ae # Mute
RecordedTV 0x800f0448000002ae # RECORDED TV
KEY_DVD 0x800f8424000002ae # DVD MENU
Guide 0x800f0426000002ae # GUIDE
LiveTV 0x800f8425000002ae # LIVE TV
KEY_ONE 0x0200001e00000000 # 1
KEY_TWO 0x0200001f00000000 # 2
KEY_THREE 0x0200002000000000 # 3
KEY_FOUR 0x0200002100000000 # 4
KEY_FIVE 0x0200002200000000 # 5
KEY_SIX 0x0200002300000000 # 6
KEY_SEVEN 0x0200002400000000 # 7
KEY_EIGHT 0x0200002500000000 # 8
KEY_NINE 0x0200002600000000 # 9
KEY_ZERO 0x0200002700000000 # 0
Star 0x0220002500000000 # *
Hash 0x0220002000000000 # #
KEY_DELETE 0x0200002900000000 # CLEAR/DELETE
KEY_ENTER 0x0200002800000000 # ENTER
Red 0x800f845b000002ae # Red
Green 0x800f845c000002ae # Green
Yellow 0x800f845d000002ae # Yellow
Blue 0x800f845e000002ae # Blue
Caption 0x800f845a000002ae # Closed Caption/Teletext
end codes

end remote

#
# this config file was hand-generated
# using lirc-0.8.4a (imon) on Fri Nov 7 13:55:44 2008
#
# contributed by Jarod Wilson <[email protected]>
#
# brand: Antec Veris
# model no. of remote control: Multimedia Station Premiere Front Panel
# devices being controlled by this remote:
# -Antec Veris Multimedia Station Premiere
#

begin remote

name Antec_Veris_Premiere
bits 64
eps 30
aeps 100

one 0 0
zero 0 0
gap 139998
ignore_mask 0x0000000000000301
min_repeat 1
toggle_bit 0

begin codes
# Front Panel Buttons
Go 0x000000000f0002ee # Go
KEY_AUDIO 0x000000001f0002ee # Music
KEY_VIDEO 0x00000000200002ee # Videos
KEY_PHOTO 0x00000000210002ee # Pictures
KEY_DVD 0x00000000270002ee # DVD
# KEY_TV gack. mine doesn't send *anything*, might be busted
KEY_PREVIOUS 0x00000000050002ee # Prev
KEY_REWIND 0x00000000070002ee # Rewind
KEY_STOP 0x00000000040002ee # Stop
KEY_PLAYPAUSE 0x000000003c0002ee # Play/Pause
KEY_FASTFORWARD 0x00000000080002ee # F.Fwd
KEY_NEXT 0x00000000060002ee # Next
KEY_RIGHT 0x00000001000002ee # Navigation Clockwise
KEY_LEFT 0x00000100000002ee # Navigation Counter-Clockwise
KEY_SELECT 0x000000003d0002ee # Navigation Knob Push
KEY_VOLUMEUP 0x00010000000002ee # Volume Up (CW)
KEY_VOLUMEDOWN 0x01000000000002ee # Volume Down (CCW)
KEY_MUTE 0x00000000010002ee # Mute (Volume Knob Push)
end codes

end remote
Reply
#2
hardware.conf

Quote:# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Soundgraph iMON IR/LCD"
REMOTE_MODULES="lirc_dev lirc_imon"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_LIRCD_CONF="imon/lircd.conf.imon"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
REMOTE_SOCKET=""
TRANSMITTER_SOCKET=""






After reloading the module or rebooting you should be able to use irw to see events when you press keys. The lirc daemon must be running. If you used apt-get to install it then you can use the init script to make sure it's started. That looks like this:





sudo /etc/init.d/lirc restart

sudo irw




If you get output of your keypressing, everything is fine….



It should be 0200002800000000 00 #KEY_OK MCE_via_iMON

for example.

Copy my Lircmap.xml for testing in your /usr/share/xbmc/system/



You can edit the lircmap if you want.


Code:
<!-- This file contains the mapping of LIRC keys to XBMC keys used in Keymap.xml  -->
<!--                                                                              -->
<!-- How to add remotes                                                           -->
<!-- <remote device="name_Lirc_calls_the_remote">                                 -->
<!--                                                                              -->
<!-- For the commands the layout following layout is used                         -->
<!-- <XBMC_COMMAND>LircButtonName</XBMC_COMMAND>                                  -->
<!--                                                                              -->
<!-- For a list of XBMC_COMMAND's check out the <remote> sections of keymap.xml   -->

<lircmap>
    <remote device="MCE_via_iMON">
        <pause>KEY_PAUSE</pause>
        <stop>KEY_STOP</stop>
        <forward>KEY_FASTFORWARD</forward>
        <reverse>KEY_REWIND</reverse>
        <left>KEY_LEFT</left>
        <right>KEY_RIGHT</right>
        <up>KEY_UP</up>
        <down>KEY_DOWN</down>
        <select>KEY_ENTER</select>
        <pageplus>KEY_CHANNELUP</pageplus>
        <pageminus>KEY_CHANNELDOWN</pageminus>
        <back>KEY_BACKSPACE</back>
        <menu>KEY_RECORD</menu>
        <play>KEY_PLAY</play>
        <info>KEY_INFO</info>
        <skipplus>Skip</skipplus>
        <skipminus>Replay</skipminus>
        <volumeplus>KEY_VOLUMEUP</volumeplus>
        <volumeminus>KEY_VOLUMEDOWN</volumeminus>
        <mute>KEY_MUTE</mute>
        <power>KEY_POWER</power>
        <title>WindowsMCE</title>
        <one>KEY_ONE</one>
        <two>KEY_TWO</two>
        <three>KEY_THREE</three>
        <four>KEY_FOUR</four>
        <five>KEY_FIVE</five>
        <six>KEY_SIX</six>
        <seven>KEY_SEVEN</seven>
        <eight>KEY_EIGHT</eight>
        <nine>KEY_NINE</nine>
        <zero>KEY_ZERO</zero>
    </remote>
    
    <remote device="XboxDVDDongle">
        <play>PLAY</play>
        <pause>PAUSE</pause>
        <stop>STOP</stop>
        <forward>FORWARD</forward>
        <reverse>REVERSE</reverse>
        <left>LEFT</left>
        <right>RIGHT</right>
        <up>UP</up>
        <down>DOWN</down>
        <select>SELECT</select>
        <back>BACK</back>
        <menu>MENU</menu>
        <title>TITLE</title>
        <info>INFO</info>
        <skipplus>SKIP+</skipplus>
        <skipminus>SKIP-</skipminus>
        <display>DISPLAY</display>
        <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="Microsoft_Xbox">
        <play>PLAY</play>
        <pause>PAUSE</pause>
        <stop>STOP</stop>
        <forward>FORWARD</forward>
        <reverse>REVERSE</reverse>
        <left>LEFT</left>
        <right>RIGHT</right>
        <up>UP</up>
        <down>DOWN</down>
        <select>SELECT</select>
        <back>BACK</back>
        <menu>MENU</menu>
        <title>TITLE</title>
        <info>INFO</info>
        <skipplus>SKIP+</skipplus>
        <skipminus>SKIP-</skipminus>
        <display>DISPLAY</display>
        <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="PinnacleSysPCTVRemote">
        <play>Play</play>
        <pause>pause</pause>
        <stop>Stop</stop>
        <forward>FForward</forward>
        <reverse>Rewind</reverse>
        <left>Vol-Rew</left>
        <right>Vol+FF</right>
        <up>Chan+Play</up>
        <down>Chan-Stop</down>
        <pageplus>channel+</pageplus>
        <pageminus>channel-</pageminus>
        <select>middle</select>
        <back>undo</back>
        <menu>Menu</menu>
        <title>L</title>
        <info>Info</info>
        <skipplus>next</skipplus>
        <display>Fullscreen</display>
        <record>Record</record>
        <volumeplus>vol+</volumeplus>
        <volumeminus>vol-</volumeminus>
        <mute>Mute</mute>
        <power>Power</power>
        <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="anysee">
        <pause>pause</pause>
        <stop>stop</stop>
        <forward>f1</forward>
        <reverse>f2</reverse>
        <left>left</left>
        <right>right</right>
        <up>chan-up</up>
        <down>chan-down</down>
        <select>ok</select>
        <back>exit</back>
        <menu>menu</menu>
        <title>play</title>
        <info>info</info>
        <skipplus>jump-fwd</skipplus>
        <skipminus>jump-back</skipminus>
        <display>size</display>
        <start>star</start>
        <record>rec</record>
        <volumeplus></volumeplus>
        <volumeminus></volumeminus>
        <mute>mute</mute>
        <power>power</power>
        <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>
        <red>red</red>
        <green>green</green>
        <yellow>yellow</yellow>
        <blue>blue</blue>
    </remote>
    <remote device="iMON-PAD">
        <power>Power</power>
        <record>Record</record>
        <play>Play</play>
        <reverse>Rewind</reverse>
        <pause>Pause</pause>
        <stop>Stop</stop>
        <forward>FastForward</forward>
        <left>Left</left>
        <right>Right</right>
        <up>Up</up>
        <down>Down</down>
        <select>Enter</select>
        <pageplus>Ch+</pageplus>
        <pageminus>Ch-</pageminus>
        <back>Esc</back>
        <back>Backspace</back>
        <menu>Multimon</menu>
        <title>MouseMenu</title>
        <info>SelectSpace</info>
        <skipplus>NextChapter</skipplus>
        <skipminus>PrevChapter</skipminus>
        <display>FullScreen</display>
        <start>MultiMon</start>
        <volumeplus>Vol+</volumeplus>
        <volumeminus>Vol-</volumeminus>
        <mute>Mute</mute>
        <myvideo>MyMovie</myvideo>
        <mymusic>MyMusic</mymusic>
        <mypictures>MyPhoto</mypictures>
        <mytv>MyTV</mytv>
        <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>
</lircmap>



reboot the system

Now you have a fully working remote in XBMC 9.11b1 Karmic
Reply
#3
Now we setup the LCD

I prefer a manual compiled and installed version of lcdproc to edit the render frequency(scrolling speed) of the text.


1.login as root in terminal
Code:
wget http://internap.dl.sourceforge.net/sourceforge/lcdproc/lcdproc-0.5.3.tar.gz

2.
tar xvfz lcdproc-0.5.3.tar.gz

3.
rm lcdproc-0.5.3.tar.gz

4.
cd lcdproc-0.5.3/

5. Change #define RENDER_FREQ 8 to #define RENDER_FREQ 2
nano server/main.h

and save it.[/quote]

Now we have to compile it. I need to install automake via apt-get
sudo apt-get install automake

Quote:the compiling and installation:
1.
aclocal && autoconf && automake
2.
./configure --enable-drivers=imonlcd
3.
make
4.
sudo make install
Quote:NOTE: IMPORTANT: If you want to uninstall this manual lcdproc..... do not delete the lcdproc-0.5.3 directory. For uninstall get into the directory and do: sudo make uninstall

The Imon Configuration

sudo nano /usr/local/etc/LCDd.conf

change
Driver=curses
to
Driver=imonlcd

change

DriverPath=server/drivers/
to
DriverPath=/usr/local/lib/lcdproc/


Edit if you want the goodbye message

GoodBye=" X B M C"
GoodBye=" MEDIA CENTER"

Search this area and edit it like this(the Protocol is important, the rest is personal taste)

Code:
## Soundgraph iMON LCD ##
[imonlcd]
# Specify which iMon protocol should be used [legal: 0=15c2:ffdc device,
# 1=15c2:0038 device; default: 0]
Protocol=1

# Set the exit behavior [legal: 0=leave shutdown message, 1=show the big clock,
# 2=blank device; default: 1]
#OnExit=2

# Select the output device to use [default: /dev/lcd0]
Device=/dev/lcd0

# Select the displays contrast [default: 200; legal: 0-1000]
Contrast=200

# Specify the size of the display in pixels [default: 96x16]
#Size=96x16

# Set the backlight state [default: on; legal: on, off]
#Backlight=on
___________________________________________________

Now save the file

Quote:TEST your setup

sudo LCDd -f -r 4


this shows you now the lcdproc server screen........


now you make a start/stop script :
sudo nano /etc/init.d/lcdd

Quote:#! /bin/sh
### BEGIN INIT INFO
# Provides: lcdd
# Required-Start: $etc-setserial
# Required-Stop: $etc-setserial
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts the LCDd
### END INIT INFO

# Author: Stephan Häuslschmid

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Starts the LCDd"
NAME=LCDd
DAEMON=/usr/local/sbin/$NAME
DAEMON_ARGS="-i 0 -s 1"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

# Function that starts the daemon/service
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}

# Function that stops the daemon/service
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
#start-stop-daemon --stop --quiet --retry=KILL/2 --pidfile $PIDFILE --name $NAME
#RETVAL="$?"
#[ "$RETVAL" = 2 ] && return 2
#start-stop-daemon --stop --quiet --oknodo --retry=KILL/5 --exec $DAEMON
#[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
killall $NAME
RETVAL="$?"

rm -f $PIDFILE
return "$RETVAL"
}

# Function that sends a SIGHUP to the daemon/service
do_reload() {
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}

case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac

:


Quote:chmod 755 /etc/init.d/lcdd

Now you can

Quote:sudo /etc/init.d/lcdd start
sudo /etc/init.d/lcdd stop
sudo /etc/init.d/lcdd restart

to control it and make it autostart on boot

Quote:sudo update-rc.d lcdd defaults



now go to xbmc system settings and enable the lcd usage.....


reboot and love your LCD.....




greetz muggi


___________________________________________________________________________
Code:
thanks to follow tutorials:

http://www.vdr-wiki.de/wiki/index.php/An...%C3%A4nger

and

https://help.ubuntu.com/community/IMON_V...armic_9.10
Reply
#4
Setup your pretty Imon Icons

This guide based on another Thread in this forum(http://forum.xbmc.org/showthread.php?tid...imon+icons). I added a part here to complete the installation of the lcd. It check over the webserver if something is playing curently. So you have to enable your webserver with the standard port und user and without password



1.go into Terminal as root

1.1 install this perlmodule

sudo apt-get install libwww-perl

1.2 edit LCD.xml to see Text and Icons while playing.

edit /home/${YOURUSER}/.xbmc/userdate/lcd.xml

second line edit

Code:
<disableonplay>video</disableonplay>


to

<disableonplay></disableonplay>

2. make a file named imon.pl
sudo nano /root/imon.pl

3. paste the folowing code in the file

Code:
#!/usr/bin/perl
use HTTP::Request::Common;
use LWP::UserAgent;
use IO::Socket;

my $sockres;
my $sock;

#see here for details of imon lcd driver output control bits
#http://lcdproc.cvs.sourceforge.net/viewvc/lcdproc/lcdproc/server/drivers/imonlcd.c?view=markup


$sock = new IO::Socket::INET (PeerAddr => 'localhost', PeerPort => '13666', Proto => 'tcp', );

die "Could not create socket: $!\n" unless $sock;

print $sock "hello\n";

$sockres = readline $sock;

do
{

my $output = "";

my $progress = 0;
my $icondata = 0;

my $ua = LWP::UserAgent->new;
my $res = $ua->request(GET 'http://localhost:8080/xbmcCmds/xbmcHttp?command=GetCurrentlyPlaying');

if ($res->is_success)
{
   $output = $res->content;

   #remove html tags
   $output =~ s/<html>//gi;
   $output =~ s/<.html>//gi;
   $output =~ s/<li>//gi;
}

my @lines = split(/\n/, $output);

foreach my $val (@lines)
{
   if ($val =~ /Filename:/i)
   {
      if ($val =~ /.mpg/i)  { $icondata = $icondata | (1<<19) }; #turn on MPG icon
      if ($val =~ /.mpeg/i) { $icondata = $icondata | (1<<19) }; #turn on MPG icon
      if ($val =~ /.avi/i)  { $icondata = $icondata | (2<<19) }; #turn on DIVX icon
      if ($val =~ /.wmv/i)  { $icondata = $icondata | (4<<19) }; #turn on WMV icon

      if ($val =~ /.wma/i) { $icondata = $icondata | (3<<13) }; #turn on WMA icon
      if ($val =~ /.mp3/i) { $icondata = $icondata | (1<<13) }; #turn on MP3 icon
      if ($val =~ /.ogg/i) { $icondata = $icondata | (2<<13) }; #turn on OGG icon
      if ($val =~ /.wav/i) { $icondata = $icondata | (4<<13) }; #turn on WAV icon
   }

   if ($val =~ /Type:/)
   {
      if ($val =~ /Video/i) { $icondata = $icondata | (2<<1) }; #turn on MOVIE icon
      if ($val =~ /Video/i) { $icondata = $icondata | 1 }; # enable play animation
      if ($val =~ /Audio/i) { $icondata = $icondata | (1<<1) }; # turn on MUSIC icon
      if ($val =~ /Audio/i) { $icondata = $icondata | 1 }; # enable play animation
      if ($val =~ /Picture/i) { $icondata = $icondata | (3<<1) }; # turn on PHOTO icon
   }

   if ($val =~ /Percentage:/)
   {
      $val =~ s/Percentage://i;
      $progress = $val *32 / 100;
   }
}


printf $sock "output %i\n",$icondata;

$sockres = readline $sock;

sleep 1;

printf $sock "output %i\n",(($progress <<6) | (1<<28)); # configure upper progress bar

$sockres = readline $sock;

sleep 1;

} while 1;

close $sock;


4.make it executeable
sudo chmod +x imon.pl

I let it in the root directory. If you want to copy it in another dir, you have to modify the start script


5. Make the start script


sudo nano /etc/init.d/imon


copy the code in this file

Code:
#!/bin/bash
### BEGIN INIT INFO
# Provides: Imon Icons
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Start, Stop or Restart IMon Icons
### END INIT INFO

# Shell functions sourced from /etc/rc.status:
# set -e
# Reset status of this service
# rc_reset

#
case "$1" in
start)
echo -n "Starting Imon Icons "
/root/imon.pl &


;;
stop)
echo -n "Shutting down Imon Icons "
/usr/bin/killall imon.pl

;;
restart)
echo -n "Restart Imon Icons "
$0 stop
sleep 20
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
# rc_exit
exit 0

6. make it executable and set it to autostart

chmod 755 /etc/init.d/imon




7. Now you can test it with:
sudo /etc/init.d/imon start

and play now a media file in xbmc..... you´ll see the icons....Big Grin



8. Now add it to autostart(this works on my machine good)

sudo update-rc.d imon defaults 65 65






Greetz Muggi
_______________________________________________________________

and

thanks to Phantasm4489 for this Icon-Script...
Reply
#5
Beautifull tutorial, worked like a charm! Sticky!

Only thing not working is the LCD:
Quote:xbmc@XBMCLive:~$ sudo /etc/init.d/LCDd restart
sudo: /etc/init.d/LCDd: command not found

when I test he LCD it is showing the server screen on my lcd..
Reply
#6
Nik1984 Wrote:Beautifull tutorial, worked like a charm! Sticky!

Only thing not working is the LCD:


when I test he LCD it is showing the server screen on my lcd..

Thanks for the flowersBig Grin

i´ve delete the wrong entry


greetz
Reply
#7
muggi Wrote:Thanks for the flowersBig Grin

i´ve delete the wrong entry


greetz

Still nothing to show on my lcd Sad
Reply
#8
Nik1984 Wrote:Still nothing to show on my lcd Sad

hi


i´ve updated the second post...


to autostart you need the lcdd script and get it to autostart on boot with


sudo update-rc.d lcdd defaults



please test it


greetz muggi
Reply
#9
Ok, got the LCD to work.

Now when setting up the icons I receive the following error when starting the service:
Quote:xbmc@XBMCLive:~$ sudo /etc/init.d/imon start
Starting Imon Icons Can't locate HTTP/Request/Common.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /root/imon.pl line 2.
BEGIN failed--compilation aborted at /root/imon.pl line 2.
/etc/init.d/imon: line 41: exit: 06.: numeric argument required
xbmc@XBMCLive:~$

Now If I get that to work I'm fully set!
Great guide, again, sticky!!!

ps: in the first post you misspelled: sudo dpkg-reconfigure lirc
Reply
#10
[quote=Nik1984]Ok, got the LCD to work.

Now when setting up the icons I receive the following error when starting the service:


Now If I get that to work I'm fully set!
Great guide, again, sticky!!!

ps: in the first post you misspelled: sudo dpkg-reconfigure lirc[/QUOTE


do this and it works


sudo apt-get install libwww-perl
Reply
#11
muggi Wrote:[quote=Nik1984]Ok, got the LCD to work.

Now when setting up the icons I receive the following error when starting the service:


Now If I get that to work I'm fully set!
Great guide, again, sticky!!!

ps: in the first post you misspelled: sudo dpkg-reconfigure lirc[/QUOTE


do this and it works


sudo apt-get install libwww-perl

Ok, the error is gone. Now when playing a movie the lcd goes blank.
So no icons are shown.
Reply
#12
last but not least....



edit /home/xbmc/.xbmc/userdata/lcd.xml

second line edit

<disableonplay>video</disableonplay>


to

<disableonplay></disableonplay>
Reply
#13
hi

i´ve editet the imon icon start script for background start.......



hint.....


in my personal version of imon.pl, i delete the music icons.... because while playing it slow down my hole htpc


greetz muggi
Reply
#14
display is now working while playing video.
However no icon's are shown. But nevertheless it is now all working better then I ever hoped!!
Thank you for this guide, really helped me alot!
Reply
#15
Thanks for this how-to.

I have a fresh Karmic instalation with a MCE receiver. I have some problem with lirc.

Every new reboot I must type this command to work:

Code:
sudo mkdir /var/run/lirc
sudo lircd -d /dev/lirc0

How can I solve this problem?

This is my hardware.conf:

Code:
$ cat /etc/lirc/hardware.conf

REMOTE="MCE"
REMOTE_MODULES="lirc_mceusb2"
REMOTE_DRIVER="default"
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""

TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

START_LIRCD="false"
#START_LIRCMD="false"
LOAD_MODULES="true"
LIRCMD_CONF=""
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""

Thanks for all.
Reply

Logout Mark Read Team Forum Stats Members Help
[Live] IMON LCD/IR full install with MCEUSB on Ubuntu 9.10 and XBMC 9.11 Camelot1