Menu

GPIO-LCD

GPIO LCD (1)
Kirk Davis

Setting up GPIO LCD Display

Rasplex is capable of displaying menu's and other information on a small LCD display. There are a number if these small LCD displays available to plug into the Raspberry Pi and they are inexpensive. This walk-though will cover the HD44780 based displays that are connected directly to the Raspberry Pi's GPIO port.

Most of these steps will have to be done from a shell prompt on your Rasplex. you can do this by secure shelling into it.

Step 1: Installing the right driver

The latest version of rasplex (I tested this on 0.1.31) doesn't have the driver installed that supports one of these LCD displays.

Download and install the driver:

mkdir -p /storage/lcdproc
cd /storage/lcdproc
wget http://www.bohica.net/projects/hd44780.so
chmod 644 hd44780.so


Step 2: Modify the configuration

The configuration file supplied in your rasplex needs to be changed to use the new driver.

Copy and edit the LCDd.conf config file:

cp /etc/LCDd.conf /storage/.config/LCDd.conf
nano /storage/.config/LCDd.conf

Look for the following variables in the file and change then to what is show below:

DriverPath=/storage/lcdproc/
Driver=hs44780
ServerScreen=no
TitleSpeed=2

Scroll down in the file until you find the [hd44780] driver section and change the connection type to use the Raspberry Pi's GPIO port.

ConnectionType=rpi

Note: There is not a standard for what pins the LCD uses on your GPIO port. I have a couple of different LCD displays and they use different pins. you will have to figure out what pins your display uses or ask the manufacture. The following information is correct for one of the LCD displays bought from MyPiShop (and possibly many others).

Right after the ConnectionType line in the file, insert the following lines:

D7=22
D6=27
D5=18
D4=17
RS=7
EN=8

Looks for the Size line and change it to match your display. Mine has 2 lines and 16 characters per line.

Size=16x2

Save and exit the LCDd.conf file.

Step 3: Tell Rasplex to use the LCD display

Rasplex needs to know about the LCD display. There are two different places to configure it. The first place tells Rasplex what type of display you have and the second turns the display on.

On the Rasplex menu, naviage to the following place:
Preferences -> Rasplex Settings -> System
Make sure the LCD/VFD driver is set tp hd44780

Next navigate to the following place to turn the display on:
Preferences -> System -> Video Output
Enable LCD/VFD

Restart the Rasplex system and your should now see a working display.

Optional: Slowing down the scroll rate

If your LCD has to display any information that is longer than will fit, it scrolls it on the display. The scroll is quite fast be default. Here is some information that will help slow down the rate.

The LCD scroll rate is an advanced setting. Create a new advanced settings file or edit the existing file if one is there.

cd /storage/.plexht/userdata
nano advancedsettings.xml

Copy the following information into the file:

<advancessettings>
    <lcd>
        <scrolldelay>5</scrolldelay>
    </lcd>
</advancedsettings>

Save the file and restart your system.

Optional: Changing the LCD messages

The startup and shutdown messages are in the LCDd.conf file. This is the one you created in step 2. You can edit the file and change the Hello and GoodBye variables with your own message. Here is what I have in mine.

Hello="   Welcome to "
Hello="    Rasplex   "

GoodBye="Thanks for using"
GoodBye="   Rasplex      "

The messages and menu information that Rasplex displays on the LCD screen when it is running is in the xml file /storage/.plexht/userdata/LCD.xml You can edit this file with your own messages.

Have fun and enjoy your display.


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.