128x64 ks0108 based Graphical Display using GLCD2USB on OpenWrt / Raspbian / Ubuntu

This post is about GLCD2USB by Till Harbaum, a free electronics project to connect (ks0108 based) graphic LCDs via USB to a PC (or to a OpenWrt router in my case).


All parts ready to shop in a Reichelt Shopping Cart (Germany). A cheaper variant of the LCD can be found on Pollin (Germany).

I have successfully built the GLCD2USB hardware and tested it on my laptop.


Unfortunately you cannot just install lcd4linux using opkg update & opkg install lcd4linux as the lcd4linux package on OpenWrt lacks the support for most drivers (check with lcd4linux -l, see below) and has to be compiled using the OpenWrt Buildroot system.

lcd4linux -l
LCD4Linux 0.11.0-SVN-1158
Copyright (C) 2005, 2006, 2007, 2008, 2009 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>

available display drivers:
   NULL                : NULL driver for testing purposes
   TEW673GRU           : TEW673GRU driver

available plugins:
  cfg, math, string, test, time, cpuinfo, loadavg, meminfo, proc_stat, uptime


The glcd2usb example configuration (backup copy) can be used as a basis for own configurations. (Please make sure the tux.png from the lcd4linux package is in the current directory when running this demo config to make sure the little tux is displayed to show the graphic capabilities of the display.)

Installation on the Raspberry Pi

This is how the GLCD2USB module appears in dmesg when pluggin it in:

[803.607568] usb 1-1.3.2: new low-speed USB device number 8 using dwc_otg
[804.846327] usb 1-1.3.2: New USB device found, idVendor=1c40, idProduct=0525
[804.846362] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[804.846382] usb 1-1.3.2: Product: GLCD2USB
[804.846400] usb 1-1.3.2: Manufacturer: www.harbaum.org/till/glcd2usb
[805.923793] hid-generic 0003:1C40:0525.0001: hiddev0,hidraw0: USB HID v1.01 Device [www.harbaum.org/till/glcd2usb GLCD2USB] on usb-bcm2708_usb-1.3.2/input0

Here is how you install and set up lcd4linux:

sudo apt-get install lcd4linux

# create or copy the config file /etc/lcd4linux.conf
# You can get inspiration from lcd4linux's example configuration file lcd4linux.conf.sample:
# http://ssl.bulix.org/projects/lcd4linux/browser/trunk/lcd4linux.conf.sample).
cd ~/Downloads
wget http://ssl.bulix.org/projects/lcd4linux/export/1200/trunk/tux.png
wget http://www.harbaum.org/till/glcd2usb/lcd4linux.conf
mv /etc/lcd4linux.conf /etc/lcd4linux.conf.bak
mv lcd4linux.conf /etc/lcd4linux.conf
chmod 700 /etc/lcd4linux.conf
killall lcd4linux; sleep 1 && lcd4linux -vv -F
# ^ check for problems
# I had to disable all widgets of the class Bar, Icon and Image
# in order not to get a Segmentation fault
# From the lcd4linux example config file, the TestIcons layout worked however!
# Update: changing tick to tack for Bar class widgets works for me

There is also a small tool to set the brightness to zero:

cd ~/Downloads
sudo apt-get install libusb-dev
git clone https://github.com/pklaus/glcd2usb.git
cd ./testclient
sudo ./dimdown

Installation on Ubuntu 12.04

This is how the GLCD2USB module appears in dmesg when pluggin it in:

[234.16] generic-usb 0003:1C40:0525.0010: hiddev0,hidraw0: USB HID v1.01 Device [www.harbaum.org/till/glcd2usb GLCD2USB] on usb-0000:00:1d.0-1/input0

Here is how you install the SVN version of lcd4linux:

sudo apt-get install libgd2-noxpm libusb-dev
cd ~/Downloads
svn co https://ssl.bulix.org/svn/lcd4linux/trunk lcd4linux
cd lcd4linux
# ^ check for warnings
sudo make install

sudo su
# create or copy the config file /etc/lcd4linux.conf
killall lcd4linux; sleep 1 && lcd4linux -vv
# ^ check for problems

Check these links:

Flashing the Firmware

dmesg | tail
ls /dev/ttyUSB*
sudo chmod 666 /dev/ttyUSB1
cd ~/Downloads/glcd2usb/
sudo apt-get install avrdude
avrdude -c stk500v2 -p m16 -P /dev/ttyUSB1 -U hfuse:w:0xC9:m -U lfuse:w:0xDF:m
avrdude -c stk500v2 -p m16 -P /dev/ttyUSB1 -e -F -U flash:w:firmware.hex

Using the Display via serdisplib

cd ~/Downloads
svn co https://serdisplib.svn.sourceforge.net/svnroot/serdisplib/serdisplib/trunk serdisplib
sudo apt-get install libsdl-dev
sudo make install

Using the Display with LCDproc

See this for instructions:

cd ~/Downloads/
wget http://lcdproc.sourceforge.net/nightly/lcdproc-CVS-current.tar.gz
tar -xf lcdproc-CVS-current.tar.gz
cd lcdproc-CVS-current-20130410/
./configure --prefix=/usr/local --enable-drivers=glcd,glcdlib,text,curses
sudo make install

diff /usr/local/etc/LCDd.conf ~pi/Downloads/lcdproc-CVS-current-20130410/LCDd.conf :

< #DriverPath=server/drivers/
< DriverPath=/usr/local/lib/lcdproc/
> DriverPath=server/drivers/
< #Driver=curses
< Driver=glcd
> Driver=curses
< ConnectionType = glcd2usb
> ConnectionType=t6963

then run


Remaining Questions

Possible to set brightness on the fly with lcd4linux and the buttons?