Apr 272011
 

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).

Assembly

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.

Installation

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

Configuration

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
make
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
./configure
# ^ check for warnings
make
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

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

Using the Display with LCDproc

See this for instructions:

#!/bin/bash
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
make
sudo make install

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

37,38c37
< #DriverPath=server/drivers/
< DriverPath=/usr/local/lib/lcdproc/
---
> DriverPath=server/drivers/
54,55c53
< #Driver=curses
< Driver=glcd
---
> Driver=curses
360c358
< ConnectionType = glcd2usb
---
> ConnectionType=t6963

then run

LCDd
lcdproc

Remaining Questions

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

Resources

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)

Related Posts:

  • No Related Posts

  7 Responses to “128×64 ks0108 based Graphical Display using GLCD2USB on OpenWrt / Raspbian / Ubuntu”

  1. GLCD2USB is now supported by serdisplib. So you can also use this to display with vdr-plugin-graphlcd. I have it running under Debvision, deb10ega and YaVDR64-0.4.0. Maybe it is possible to even go through LCDproc → glcdlib Driver → serdisplib → GLCD2USB Haven’t tried it jet.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  2. […] GLCD2USB allows you to connect a LCD screen to the USB port. You can display all kinds of stuff on it. See my other blog post. […]

  3. Philipp,.. Further to the above,.. Using the Display with LCDproc,.. when running configure as below:-

    #!/bin/bash
    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

    I get the message:

    checking for glcdproclib/glcdprocdriver.h... no
    configure: WARNING: The glcdlib driver needs glcdproclib/glcdprocdriver.h
    checking ncurses.h usability... no
    checking ncurses.h presence... no
    checking for ncurses.h... no
    checking curses.h usability... no
    checking curses.h presence... no
    checking for curses.h... no
    checking for main in -lncurses... no
    checking for main in -lcurses... no
    
    configure: WARNING: The curses driver needs the curses (or ncurses) library.

    followed by:

    LCDd will be compiled with the drivers:
        -  glcd
        -  text

    is this to be expected,.. I am slightly confused?

    Kind regards

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Yes, I think this should be fine. As the diff shows, I use ldcproc with Driver=glcd and ConnectionType = glcd2usb. So you may be able to simply ignore the missing curses and glcdlib drivers…

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  4. Many thanks for the response Philipp,.. taking things a little further,.. I now get he following:-

    why is my connection type, “glcd2usb” unknown,.. Any thourghts?….

    Kind regards

    LCDd version CVS-current-20130410 starting
    Built on May 15 2014, protocol version 0.3, API version 0.5
    Using Configuration File: etc/LCDd.conf
    Set report level to 5, output to stderr
    Server forking to background
    Listening for queries on 127.0.0.1:13666
    screenlist_init()
    driver_load(name="glcd", filename="/usr/local/lib/lcdproc/glcd.so")
    glcd_init()
    glcd: unknown ConnectionType: glcd2usb
    Driver [glcd] init failed, return code -1
    Module /usr/local/lib/lcdproc/glcd.so could not be loaded
    Could not load driver glcd
    There is no output driver
    
    Critical error while initializing, abort.
    
    mark@mhtpc:/usr/local$ ll /usr/local/lib/lcdproc/glcd.so
    -rwxr-xr-x 1 root root 34K May 20 09:54 /usr/local/lib/lcdproc/glcd.so*
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Hi, sorry it took some time… OK, so you basically have the library glcd.so but the connection type glcd2usb was not included/supported. I had a look into the file glcd-drivers.h from the lcdproc project and in there you can see that the support for glcd2usb depends on the availability of libusb. So please install libusb first. The way to do this depends on your operating system. Then recompile lcdproc. Best, Philipp

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • Philipp,.. just to close this one out,.. I finally got LCDproc running,.. (or sort of gave up during the summer months and ran with lcd4linux,.. which includes the USB driver by default).

        Antway,.. Loaded the libusb-compat-0.1.4, USB driver library ( tx for the pointer),.. (the 1.0.9 does not work!!) config’d and make all fine,. then ran “./configure --prefix=/usr/local --enable-drivers=glcd,text,curses“,.. and make install etc,… and then “sudo LCDd” works, ( following the LCDd.conf edits ).

        Oh one last thing I discovered build essentials,.. must be loaded

        sudo apt-get install --no-install-recommends build-essential K.R.

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>