sudo apt-get install lcdproc
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
tar xzf lcdproc.tar.gz
cd lcdproc-0.5.6 ./configure make sudo make install
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).
dmesg
[ 3710.377212] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
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
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
And:
sudo nano /etc/inittab
T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
# T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
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.
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
sudo nano /etc/LCDd.conf
# 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
DriverPath=/usr/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
One more line should be edited for initial testing:
#Foreground=yes
sudo LCDd
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…
#Foreground=yes
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
#! /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
Make sure the script is executable:
sudo chmod 755 LCDd
sudo nano /etc/rc.local
/usr/bin/lcdproc
Now reboot the system. The LCD should spring to life automatically, cycling through several screens of system information.