OnionRingMan
Posts: 1
Joined: Sat Feb 16, 2013 10:05 pm

XBMC + i2c LCD on the Pi

Sun Feb 17, 2013 5:19 am

Hello there. I recently purchased and assembled a LCD 16x2 kit from adafruit (http://www.adafruit.com/products/1115) and I got it working successfully on Raspbian. Now, my goal from the beginning was to see if this would work for Raspbmc to display movie information and such. Now, I'm 90% sure its possible to do, but I'm having a hard time trying to get it to display. I got lcd-proc for the pi, as well as i2c-tools. A quick test of "sudo i2cdetect -y 1" does show that the device is connected. Now, I know I need to edit LCDd.conf to get the plate to work, and I've found a forum that listed a similar device here (http://forum.stmlabs.com/showthread.php?tid=1864). So, seeing as I had the same model of LCD as him, and that he was using i2c aswell, I thought I could replicate his results. Now, needless to say that it didn't work. I was wondering if a few people here might be able to help me understand what I need to do to configure LCDd.conf to get my LCD to display on Raspbmc successfully, or if I'm completely offbase with what I am doing. Thanks for any help you can provide! If this is not the appropriate place to post this, I apologize.

priority
Posts: 22
Joined: Sat Mar 16, 2013 6:26 pm

Re: XBMC + i2c LCD on the Pi

Wed Apr 03, 2013 7:54 pm

Here's recipe that will have your RPi smokin' hot:

First make sure i2c is enabled. Adafruit has a nice tutorial. Assuming you have a configured RPi running Wheezy, update and enable i2c:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo vi /etc/modules (edit file to enable i2c; see Adafruit tutorial)
sudo reboot
Now, to get lcdproc and patch it for the Adafruit lcd piplate:

Code: Select all

sudo apt-get install cvs
sudo apt-get install autoconf automake
mkdir lcdtest
cd lcdtest
cvs -d:pserver:[email protected]:/cvsroot/lcdproc login
cvs -z3 -d:pserver:[email protected]:/cvsroot/lcdproc checkout -P lcdproc
patch -p0 < lcdproc.patch   (the patch file I used was downloaded from link at bottom of http://lists.omnipotent.net/pipermail/lcdproc/2013-February/014133.html)
cd lcdproc/
sh ./autogen.sh
./configure --enable-drivers=hd44780
sudo make install
sudo vi  /etc/LCDd.conf    (edit LCDd.conf to use the hd44780 driver with i2c-piplate)
sudo LCDd  -c /etc/LCDd.conf     (LCDd will only start properly if run as root; backlight should turn on if you set it to turn on in LCDd.conf)
sudo lcdproc M &  (just to test it that everything is working; should have multiple screens being shown on LCD)
ps aux | grep LCDd  (verify LCDd is running)
ps aux | grep lcdproc   (verify lcdproc is running)
The LCDd.conf is long and boring...here's the essential edits for a model b, rev 2:

Code: Select all

[Server]
Driver=hd44780
 
[hd44780]
ConnectionType=i2c-piplate
Device=/dev/i2c-1
Port=0x20
Backlight=yes
Size=16x2
You can enable the keypad if you wish. It works as expected when enabled.

ukha
Posts: 4
Joined: Mon Jan 28, 2013 4:53 am

Re: XBMC + i2c LCD on the Pi

Wed Apr 03, 2013 8:20 pm

LCDd does not start automatically when Raspbmc starts up
The only way I can get it to run is via connecting in with Putty and typing

sudo /etc/init.d/LCDd restart

Had a look into how init.d works and done an update LCDd defaults
Anyone else had the same problem ?

Tip to slow fast scrolling of text on your display have a look at the LCDproc plugin found under :-
System
Settings
Add-ons
Services
XBMC LCDproc

It provides a gui to add the advanced settings for your display RSS feeds + Scroll speed
Many thanks to developer for providing that Add-on
------------------------------------------
Components used Pi Model B V2 + Raspbmc + Ebay i2c 4 x 20 LCD display

priority
Posts: 22
Joined: Sat Mar 16, 2013 6:26 pm

Re: XBMC + i2c LCD on the Pi

Wed Apr 03, 2013 10:36 pm

ukha wrote:LCDd does not start automatically when Raspbmc starts up
The only way I can get it to run is via connecting in with Putty and typing

sudo /etc/init.d/LCDd restart

Had a look into how init.d works and done an update LCDd defaults
Anyone else had the same problem?
I have not seen any issues with LCDd startup at boot on two different RPi systems. What exact command are you using to enable the daemon at boot?

ukha
Posts: 4
Joined: Mon Jan 28, 2013 4:53 am

Re: XBMC + i2c LCD on the Pi

Sat Apr 06, 2013 8:18 pm

Thansk for your reply priority

If Ilook in the /etc/init.d I have a file called LCDd if I open in an editor it contains the following

I assume this script starts at boot because its in the init.d directory ?

I have found that LCDd wont run from the command line unless I run as Sudo LCDd

-------------------------------------------------------------------------------------------------------------------


#! /bin/sh
#
# LCDd initscript for LCDd
# by Jose Luis Tallon <[email protected]>
#
### BEGIN INIT INFO
# Provides: lcdd LCDd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: LCD daemon
# Description: Control LCD displays connected to the computer
### END INIT INFO
#
# Written by Miquel van Smoorenburg <[email protected]>.
# Modified for Debian
# by Ian Murdock <[email protected]>.
# Modified for lcdproc by Jonathan Oxer <[email protected]>
#
#


PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/LCDd
NAME="LCDd"
DESC="LCDd"
DAEMON_OPTS="-s 1 -f -c /etc/LCDd.conf"

test -x $DAEMON || exit 0

set -e

case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --background \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --quiet \
--exec $DAEMON
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
$0 stop
sleep 1
$0 start
;;
*)
N=/etc/init.d/$NAME
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

priority
Posts: 22
Joined: Sat Mar 16, 2013 6:26 pm

Re: XBMC + i2c LCD on the Pi

Sun Apr 07, 2013 1:26 am

ukha,
I have to run LCDd as root as well. Not sure what the problem is, but running as root was not a big deal to me.

To start LCDd at boot try the following at a command line:

Code: Select all

 sudo update-rc.d LCDd defaults
After entering the above command, reboot and see if LCDd starts. I have LCDd configured to turn on the backlight of my lcd, so it is easy to tell if the LCDd daemon is loaded during boot as I run my RPi headless.

To see more what the update-rc.d command does, do a man update-rc.d.

There is also a companion command to start/stop/restart init.d related stuff with out reboot:

Code: Select all

sudo invoke-rc.d LCDd start
You can also use stop|status|restart|reload in place of start in the above command. This is good for verifying the init.d script is good and also that the daemon loads properly.

Hope this helps.

deathos73
Posts: 1
Joined: Sun Jun 02, 2013 1:41 pm

Re: XBMC + i2c LCD on the Pi

Sun Jun 02, 2013 1:53 pm

priority wrote:You can enable the keypad if you wish. It works as expected when enabled.
I want to control Squeezeslave with the plate.
I turn the keypad option to on but the buttons don't work.
I searched on Google, but I found nothing on this plate.

*Sorry for bad English I'm french*

priority
Posts: 22
Joined: Sat Mar 16, 2013 6:26 pm

Re: XBMC + i2c LCD on the Pi

Mon Jun 03, 2013 3:05 am

deathos73 wrote: I want to control Squeezeslave with the plate.
I turn the keypad option to on but the buttons don't work.
I searched on Google, but I found nothing on this plate.
Not very familiar with Squeezeslave, but reading its wiki, it shows support for LCDproc, so you should be able to get this to work.

LCDproc updates are progressing very rapidly since my original post in this topic and there is no longer a need to apply a patch. The current trunk supports the Adafruit piplate. See http://ncid.sourceforge.net/lcdncid/lcdncid.html for better instructions on how to get this LCD working on an RPi; I realize you probably don't care about caller-id, but there are specific instructions just for setting up LCDproc. I also recommend downloading the source code for LCDncid to get a known good LCDproc config file including setting up the buttons.

dsiggi
Posts: 3
Joined: Sun Jul 07, 2013 9:11 am

Re: XBMC + i2c LCD on the Pi

Sun Jul 07, 2013 9:19 am

Hi,
get anyone, the Display to work with the cvs-build from lcdproc?
With the adafruit python-code, does the display and the buttons perfectly work.
No I will get lcdproc to work.
I downloaded the latest cvs-build, and build it with hd44780-support.

Here is my LCDd.conf

Code: Select all

[server]
DriverPath=/usr/local/lib/lcdproc/
Driver=hd44780
Bind=127.0.0.1
Port=13666
User=nobody
WaitTime=5

[hd44780]
ConnectionType=raspberrypi
Device=/dev/i2c-1
Port=0x20
Size=16x2
LCDd runs without any errors, but its no output on the Display.
Has anyone an idea?

dsiggi

hsiboy
Posts: 6
Joined: Thu Aug 09, 2012 11:57 am

Re: XBMC + i2c LCD on the Pi

Mon Jul 08, 2013 12:13 pm

Hi,

i have used current head of CVS lcdproc and it works fine for me.

You have an error in your config

Code: Select all

[server]
DriverPath=/usr/local/lib/lcdproc/
Driver=hd44780
Bind=127.0.0.1
Port=13666
User=nobody
WaitTime=5

[hd44780]
ConnectionType=raspberrypi
Device=/dev/i2c-1
Port=0x20
Size=16x2
should be

Code: Select all

[server]
DriverPath=/usr/local/lib/lcdproc/
Driver=hd44780
Bind=127.0.0.1
Port=13666
User=nobody
WaitTime=5

[hd44780]
ConnectionType=piplate
Device=/dev/i2c-1
Port=0x20
Size=16x2
What error msg do you get?

@hsiboy

dsiggi
Posts: 3
Joined: Sun Jul 07, 2013 9:11 am

Re: XBMC + i2c LCD on the Pi

Mon Jul 08, 2013 4:33 pm

Oh my god,
I tested it so much, also with ConnectionType=piplate, and it never works.
And now I know why.

When I use the display with the adafruit-python-code, and close the python program, lcdproc doesen't work.
I must reconnect the display too the pi, too use it with lcdproc.

So simple.

Thanks for your help,
dsiggi

pmiller056
Posts: 5
Joined: Wed May 30, 2012 6:12 pm

Re: XBMC + i2c LCD on the Pi

Sat Jan 04, 2014 10:45 pm

Hi

I've tried over many hours and not got an Adafruit i2c LCD to work with LCDproc. I know the display works correctly with the Adafruit demo python code. I have tried to use the standard LCDproc installed with apt-get install....... (which returns ver 0.5.5 when asked), which does not appear to know about the raspberrypi and piplate connection methods. I have downloaded and tried to compile the source of LCDproc from sourceforge as directed further above but it fails to complete with a load of warning and error messages - I'm not a programmer, I'm a hardware person so I find it very difficult to work out what's gone wrong before I try again. Can some kind person provide a link to a version of LCDproc that knows about an Adafruit piplate i2c connected LCD display that can be installed with apt-get install.....

Thanks

Peter

Morphy99
Posts: 14
Joined: Mon Jan 13, 2014 9:51 pm

Re: XBMC + i2c LCD on the Pi

Mon Feb 10, 2014 11:33 pm

Hi I'm trying to get this working and I get stuck at:

Code: Select all

patch -p0 < lcdproc.patch   (the patch file I used was downloaded from link at bottom of http://lists.omnipotent.net/pipermail/lcdproc/2013-February/014133.html)
I'm a bit of linux newb so bare with me but I'm guessing we need the code at the end of that post

Code: Select all

 wget http://lists.omnipotent.net/pipermail/lcdproc/attachments/20130218/01f45e0f/attachment-0001.obj -O lcdproc.patch
I then do

Code: Select all

patch -p0 < lcdproc.patch
and get these errors:

Code: Select all

patching file ./lcdproc/acinclude.m4
Hunk #1 FAILED at 227.
1 out of 1 hunk FAILED -- saving rejects to file ./lcdproc/acinclude.m4.rej
patching file ./lcdproc/server/drivers/hd44780-drivers.h
Hunk #1 FAILED at 31.
Hunk #2 FAILED at 80.
2 out of 2 hunks FAILED -- saving rejects to file ./lcdproc/server/drivers/hd44780-drivers.h.rej
patching file ./lcdproc/server/drivers/hd44780-i2c-piplate.c
patching file ./lcdproc/server/drivers/hd44780-i2c-piplate.h
patching file ./lcdproc/server/drivers/hd44780-low.h
Hunk #1 FAILED at 54.
1 out of 1 hunk FAILED -- saving rejects to file ./lcdproc/server/drivers/hd44780-low.h.rej
patching file ./lcdproc/server/drivers/Makefile.am
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 95.
1 out of 1 hunk FAILED -- saving rejects to file ./lcdproc/server/drivers/Makefile.am.rej
Also I think the output of my i2cdetect isnt correct:

Code: Select all

 sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Any help appreciated!!

Return to “Beginners”