XBMC, LCDproc, 44780 LCD (I2C)


7 posts
by texy » Sun Dec 15, 2013 1:00 pm
A short tutorial using a hd44780 I2C based LCD with Raspbmc.
SSH into the pi and install LCDproc and i2c-tools :
Code: Select all
sudo apt-get install lcdproc i2c-tools -y

Enable i2c on the pi :
Code: Select all
sudo nano /etc/modules

and add
Code: Select all
i2c-bcm2708
i2c-dev

You need to configure LCDproc for your particular display and connection method. Edit /etc/LCDd.conf :
Code: Select all
sudo nano /etc/LCDd.conf

Within the Server section change to :
Code: Select all
[Server]
Driver=hd44780
.
.
ServerScreen=no


and change the [hd44780] section to :
Code: Select all
[hd44780]

# Select what type of connection. See documentation for types.
ConnectionType=i2c

# Port where the LPT is. Usual value are: 0x278, 0x378 and 0x3BC
Port=0x20

# Device of the serial interface [default: /dev/lcd]
Device=/dev/i2c-1 # make this i2x-0 for Revision 1 Pi's

# Bitrate of the serial port (0 for interface default)
Speed=0

# If you have a keypad connected.
# You may also need to configure the keypad layout further on in this file.
Keypad=no

# Set the initial contrast (bwctusb and lcd2usb) [default: 500; legal: 0 - 1000]
Contrast=0

# Set brightness of the backlight (lcd2usb only) [default: 0; legal: 0 - 1000]
#Brightness=1000
#OffBrightness=0

# If you have a switchable backlight.
Backlight=no # it's reversed for this display, so no really means yes !

# If you have the additional output port ("bargraph") and you want to
# be able to control it with the lcdproc OUTPUT command
OutputPort=no

# Specifies if the last line is pixel addressable (yes) or it controls an
# underline effect (no). [default: yes; legal: yes, no]
#Lastline=yes

# Specifies the size of the LCD.
# In case of multiple combined displays, this should be the total size.
Size=20x4
# For multiple combined displays: how many lines does each display have.
# Vspan=2,2 means both displays have 2 lines.
#vspan=2,2

# If you have an HD66712, a KS0073 or another 'almost HD44780-compatible',
# set this flag to get into extended mode (4-line linear).
#ExtendedMode=yes

# In extended mode, on some controllers like the ST7036 (in 3 line mode)
# the next line in DDRAM won't start 0x20 higher. [default: 0x20]
#LineAddress=0x10

# Character map to to map ISO-8859-1 to the LCD's character set
# [default: hd44780_default; legal: hd44780_default, hd44780_euro, ea_ks0073,
# sed1278f_0b, hd44780_koi8_r, hd44780_cp1251, hd44780_8859_5, upd16314 ]
# (hd44780_koi8_r, hd44780_cp1251, hd44780_8859_5 and upd16314 are possible if
# compiled with additional charmaps)
CharMap=hd44780_default
# LCDd, garbage can appear on the LCDd. Set this delay factor to 2 or 4
# to increase the delays. Default: 1.
#DelayMult=2

# Some displays (e.g. vdr-wakeup) need a message from the driver to that it
# is still alive. When set to a value bigger then null the character in the
# upper left corner is updated every <KeepAliveDisplay> seconds. Default: 0.
#KeepAliveDisplay=0

# If you experience occasional garbage on your display you can use this
# option as workaround. If set to a value bigger than null it forces a
# full screen refresh <RefreshDiplay> seconds. Default: 0.
#RefreshDisplay=5

# You can reduce the inserted delays by setting this to false.
# On fast PCs it is possible your LCD does not respond correctly.
# Default: true.
DelayBus=false

# If you have a keypad you can assign keystrings to the keys.
# See documentation for used terms and how to wire it.
# For example to give directly connected key 4 the string "Enter", use:
#   KeyDirect_4=Enter
# For matrix keys use the X and Y coordinates of the key:
#   KeyMatrix_1_3=Enter
KeyMatrix_4_1=Enter
KeyMatrix_4_2=Up
KeyMatrix_4_3=Down
KeyMatrix_4_4=Escape

After those changes reboot the pi.
XBMC now supports a python based application to communicate with LCDproc so make sure that LCD/VFD is disabled in System/Settings/Video menu otherwise the services will clash.
You can download the installation script from here : https://github.com/herrnst/script.xbmc. ... master.zip. I copied it to a usb drive and then used the
install from zip method from the System/settings/Add-ons menu. Then go to the configuration page for XBMC LCDproc via System,Settings, Add-ons. XBMC LCDproc, Configure. The only thing you should need to adjust is the Delay for scrolling text as by default it is too fast too read. I also disabled the Show heartbeat symbol, but that's up to you.
Image
Image
Also when XBMC goes into screensave mode, the display shows the time :
Image

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555
Forum Moderator
Forum Moderator
Posts: 4961
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Pijus Magnificus » Tue Dec 17, 2013 12:20 pm
Hello mate.
This tutorial helps me to my problem?
Only I have to install the zip file?
It is the same screen lcd?
Thank you.

Copy/paste:
First apologize for my English, I use google translator.
I bought this screen, thinking it would be plug and play, but far from reality, now I'm lost, I have also opened several fronts and I'm a bit saturated:

https://www.modmypi.com/raspberry-pi-RG ... r_name=lcd

I have installed OpenELEC of modi, and installing this screen or turn on. I had to install Raspbian, and I followed this tutorial Manufacturer:

http://learn.adafruit.com/adafruit-16x2 ... y-pi/usage

Now turn on, but only square displayed on the screen, and no longer continue, I reinstalled OpenELEC and I have configured in the system vfd screen and LCD HD44780 model but still with squares and not show any information . Can anyone help me?
Thank you.
Posts: 41
Joined: Fri Dec 06, 2013 4:45 pm
Location: Spain
by texy » Tue Dec 17, 2013 7:35 pm
Hi,
No the board in the fist post is of my own design.
The link for modmypi is incomplete?
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555
Forum Moderator
Forum Moderator
Posts: 4961
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by texy » Tue Dec 17, 2013 7:35 pm
Actually both of the links are incomplete.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555
Forum Moderator
Forum Moderator
Posts: 4961
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Pijus Magnificus » Tue Dec 17, 2013 8:00 pm
Sorry, the ldc screen:

https://www.modmypi.com/raspberry-pi-RG ... r_name=lcd

Tutorial:

http://learn.adafruit.com/adafruit-16x2 ... y-pi/usage

I have now reconnected the raspberry with lcd screen, and it will not turn on again. :(
Posts: 41
Joined: Fri Dec 06, 2013 4:45 pm
Location: Spain
by exzile » Sun Oct 05, 2014 4:03 am
Texy this program you have is the only one that will make my LCD print text. QC1602A is the model.
All other libraries don't seem to work that I have found through google. I've tried many....
Is there a way to get the source code so I can use it as an engine to talk to my LCD?
Posts: 132
Joined: Sun Jul 20, 2014 5:33 am
by texy » Sun Oct 05, 2014 8:34 am
Hi,
I have no connection with LCDproc. I suggest you "google LCDproc source" and see what comes up.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555
Forum Moderator
Forum Moderator
Posts: 4961
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England