-
- Posts: 1
- Joined: Sat Feb 16, 2013 10:05 pm
XBMC + i2c LCD on the Pi
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.
Re: XBMC + i2c LCD on the Pi
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:
Now, to get lcdproc and patch it for the Adafruit lcd piplate:
The LCDd.conf is long and boring...here's the essential edits for a model b, rev 2:
You can enable the keypad if you wish. It works as expected when enabled.
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
Code: Select all
sudo apt-get install cvs
sudo apt-get install autoconf automake
mkdir lcdtest
cd lcdtest
cvs -d:pserver:anonymous@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc login
cvs -z3 -d:pserver:anonymous@lcdproc.cvs.sourceforge.net:/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)
Code: Select all
[Server]
Driver=hd44780
[hd44780]
ConnectionType=i2c-piplate
Device=/dev/i2c-1
Port=0x20
Backlight=yes
Size=16x2
Re: XBMC + i2c LCD on the Pi
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
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
Re: XBMC + i2c LCD on the Pi
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 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?
Re: XBMC + i2c LCD on the Pi
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 <jltallon@adv-solutions.net>
#
### 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 <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for lcdproc by Jonathan Oxer <jon@debian.org>
#
#
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
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 <jltallon@adv-solutions.net>
#
### 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 <miquels@cistron.nl>.
# Modified for Debian
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for lcdproc by Jonathan Oxer <jon@debian.org>
#
#
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
Re: XBMC + i2c LCD on the Pi
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:
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:
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.
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
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
Hope this helps.
Re: XBMC + i2c LCD on the Pi
I want to control Squeezeslave with the plate.priority wrote:You can enable the keypad if you wish. It works as expected when enabled.
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*
Re: XBMC + i2c LCD on the Pi
Not very familiar with Squeezeslave, but reading its wiki, it shows support for LCDproc, so you should be able to get this to work.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.
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.
Re: XBMC + i2c LCD on the Pi
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
LCDd runs without any errors, but its no output on the Display.
Has anyone an idea?
dsiggi
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
Has anyone an idea?
dsiggi
Re: XBMC + i2c LCD on the Pi
Hi,
i have used current head of CVS lcdproc and it works fine for me.
You have an error in your config
should be
What error msg do you get?
@hsiboy
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
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
@hsiboy
Re: XBMC + i2c LCD on the Pi
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
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
-
- Posts: 5
- Joined: Wed May 30, 2012 6:12 pm
Re: XBMC + i2c LCD on the Pi
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
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
Re: XBMC + i2c LCD on the Pi
Hi I'm trying to get this working and I get stuck at:
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
I then do
and get these errors:
Also I think the output of my i2cdetect isnt correct:
Any help appreciated!!
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)
Code: Select all
wget http://lists.omnipotent.net/pipermail/lcdproc/attachments/20130218/01f45e0f/attachment-0001.obj -O lcdproc.patch
Code: Select all
patch -p0 < lcdproc.patch
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
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: -- -- -- -- -- -- -- --