Installation (the Easy Way)

Many Linux distributions (Ubuntu, Raspbian “Wheezy,” Occidentalis, etc.) offer LCDproc as a package, which greatly simplifies basic installation (though you’ll still need to work through the configuration steps). From a command line, simply type:
sudo apt-get install lcdproc
You’ll be prompted whether you want to install all the prerequisite packages. Answer “Y” and the software should all be download and installed in a minute or so.

Installation (the Hard Way)

It’s not really that hard, just involves a few extra steps.

First, download the latest version of the source code, using this link from a web browser, or from the command line type (as a single contiguous line):
wget http://sourceforge.net/projects/lcdproc/files/lcdproc/0.5.6/lcdproc-0.5.6.tar.gz/download -O lcdproc.tar.gz
Then extract the archive. If using a GUI desktop, this can usually be done by double-clicking the file, or right-clicking and selecting “Extract…” or similar. Or from the command line, type:
tar xzf lcdproc.tar.gz
To build and install the software, you’ll then need to enter these commands in a terminal window:
cd lcdproc-0.5.6
./configure
make
sudo make install
(You may need to change the first command to match the current version number.)

This should take just a few minutes to complete. If it stops due to a missing library, you’ll need to track down and install the missing components (perhaps using apt-get).

USB Connection

Connect the LCD backpack to a USB port, then in a terminal type the following:
Toward the bottom of the output you’ll see references to a USB device. One of these lines will include a tty name, e.g.:
[ 3710.377212] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
Remember that name “ttyACM0” (or whatever yours has assigned), you’ll need it for configuring the software.

TTY Serial Connection

With a Raspberry Pi, we can skip the USB port and connect the LCD backpack to the Pi’s GPIO header…especially useful on the Model A board.

Normally the serial connection on the header is used to log in with a terminal. This needs to be turned off in order to allow use with the LCD (the terminal function is then unavailable — you need to use a USB keyboard or a wireless network connection to log in). Two files need to be edited:
sudo nano /boot/cmdline.txt
Change this line:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
to:
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
(Basically, delete the references to ttyAMA0)

And:
sudo nano /etc/inittab
Comment out or delete the last line. i.e. change this:
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
to:
# T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
Or simply delete that line.

Remember the name “ttyAMA0”, you’ll need it for configuring the software.

The system must be rebooted for this to take effect. You can either do that now, or after setting up the LCD configuration files.

Configuring LCDd, the LCD daemon

The location of the configuration file LCDd.conf can vary depending on the installation method used. If installed using the package manager (apt-get), then it’s most likely in: /etc
If installed from source, it’s most likely in: /user/local/etc
If it doesn’t appear to be in either of those locations, use the find command:
sudo find / -name LCDd.conf -print
This file must be edited as root, e.g.:
sudo nano /etc/LCDd.conf
The default configuration file that ships with LCDproc is huge, with support for many devices and every imaginable option. Rather than try to guide you through this massive file, it’s much easier to replace the entire file’s contents with this much-simplified version, limited to our LCD backpack. Then only a couple lines need editing. (You may want to back up the original file first.)
# Pared-down LCDd configuration file; contains only those
# settings relevant to the Adafruit USB+Serial Backpacks.

# Global settings apply to all driver types -------------
[server]

# Path to driver modules.  IMPORTANT: EDIT THIS TO MATCH
# YOUR SETUP.  Last character should ALWAYS be slash.
DriverPath=/usr/lib/lcdproc/
# Select Matrix Orbital driver
Driver=MtxOrb

# Interface, port and user under which daemon runs
Bind=127.0.0.1
Port=13666
User=nobody

# If 'yes' server runs in foreground (handy during setup)
#Foreground=yes

# Settings specific to Matrix Orbital driver ------------
[MtxOrb]

# Output device.  IMPORTANT: EDIT THIS FOR YOUR SETUP!
Device=/dev/ttyACM0

# Speed applies only to serial pins; ignored w/USB.
Speed=9600

# Display size, type, contrast and brightness range.
Size=16x2
Type=lkd
Contrast=750
hasAdjustableBacklight=yes
Brightness=1000
OffBrightness=0
The lines of interest include:
DriverPath=/usr/lib/lcdproc/
This is the location of the LCDproc driver files, and will usually be either /usr/lib/lcdproc/ or /usr/local/lib/lcdproc/
As with the location of the configuration file, you might need to use the “find” command. When editing this line, make sure the last character is a forward slash: /
Device=/dev/ttyACM0
This is the device name for the LCD backpack, which was discovered in an earlier step. On most Linux systems it will be /dev/ttyAMC0 for a USB-connected backpack, or /dev/ttyAMA0 for a serial connection to the Raspberry Pi GPIO header.

One more line should be edited for initial testing:
#Foreground=yes
This line is commented out by default. Remove the initial # character to enable it. This keeps the LCDd process running in the foreground, so it’s easily stopped with Control+C rather than having to muck around with kill commands. Once we know everything works, the comment character can be added back in.

Test Run

Let’s see if it works! Type:
sudo LCDd
If this throws up an error message, it’s most likely that the wrong device name was specified on the Device line, the DriverPath line doesn’t correctly point to the location of the driver files (or is missing the trailing slash), or the configuration file is not in the expected location.

If LCDd runs as expected, you should get a greeting message on the LCD. That’s good news! Press Control+C to stop the program, then we’ll do more configuration…

Set up lcdproc and Auto-Start

If LCDd is running acceptably, we can restore it to the background configuration. Edit LCDd.conf as before and Add the initial # back to the “Foreground” line:
#Foreground=yes
There are a few different clients that can work with LCDd, but the most useful among these is lcdproc, which cycles through several system status screens.

lcdproc.conf is the configuration file for lcdproc. It should be located in the same directory alongside LCDd.conf. This is another hefty file to slog through…you’re welcome to root around and change it to your liking, but the default configuration is pretty useful and we’ll keep it as-is for simplicity’s sake.

We’ll set up both LCDd and lcdproc to start up automatically when the system boots.

If you installed using the package manager (apt-get), LCDd should already be set up to auto-start. Otherwise, you can create this file in /etc/init.d:
cd /etc/init.d
sudo nano LCDd
Copy and paste the following into the file as a start; we’ll tweak a couple lines afterward.
#! /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
The lines of interest are DAEMON and DAEMON_OPTS. Edit these to reflect the actual locations of the LCDd program and configuration file, respectively.

Make sure the script is executable:
sudo chmod 755 LCDd
Then we’ll set up lcdproc to start a little later in the bootup process.
sudo nano /etc/rc.local
Toward the end of this file (but before the final 'exit 0'), add this line:
/usr/bin/lcdproc
You might need to change the path to reflect the installation on your system (e.g. might be /usr/local/bin or similar).

Now reboot the system. The LCD should spring to life automatically, cycling through several screens of system information.

This guide was first published on May 10, 2013. It was last updated on May 10, 2013.

This page (Linux (incl. Raspberry Pi)) was last updated on May 03, 2013.

Text editor powered by tinymce.