LCDproc

Some PC's boxes as for home theaters can be equipped with a display. LCDproc is the Linux package to put some hardware and software to the empty front panel. See: http://lcdproc.org/ or http://lcdproc.omnipotent.net/

A closer look shows that LCDproc has a server and a client. LCDd the server is an abstraction of the LCD display and keys. That is independently of what will be shown on the LCD.

There are many clients that can then make use of the display. The default client is lcdproc that can be configured to show different things about the running PC.

LCDd

LCDd is the server that offers the display. Its configuration file is /etc/LCDd.conf. It needs a driver to control the LCD. As default it uses the driver curses, this is actually no LCD it is a terminal on the PC.

Check the used guide http://lcdproc.sourceforge.net/docs/current-user.html for other drivers requiring hardware and do the settings in /etc/LCDd.conf

Driver=hd44780
ConnectionType=winamp
Size=16x4

To see better what the server does add

ReportLevel=4 

Start LCDd with its OpenRC init script:

/etc/init.d/LCDd start

rc-update add LCDd default and to have an LCDproc client do rc-update add lcdproc default

LCDproc clients

Since client and server communicate via TCP/IP the LCDd server can be tested with telnet (from netkit-telnetd package) acting as client: telnet localhost 13666 this opens the connection then the initial command hello needs to be typed in. The server responds with its important configuration data, after that other commands can be sent. Check the developer guide for more commands http://lcdproc.sourceforge.net/docs/current-dev.html

The following writes hello to the display:

screen_add <screen_id>

widget_add <screen_id> <text_id> string

widget_set <screen_id> <text_id> 1 1 Hello

screen_set <screen_id> priority foreground makes that just this screen is displayed

lcdproc client

lcdproc is the client coming with the package lcdproc

lcdproc -s 127.0.0.1 -p 13666 C M T

Do a /etc/init.d/lcdproc start to have a LCDproc client running that puts system information to the display. If you are happy add it to the runlevel

To get the keystrokes, the client must add the keys client_add_key A

Per default the direct wired keys are A,B,C,D,E.

The keys appear at the client just when its screen has the listen status.

lcdproc python

Python socket programming can be used to get a client.

Alternative there are are different libraries

Hardware issues

LCDproc supports many different display hardware. The following considers a industry standard text display 4 lines with 16 characters. The controller chip is from Hitachi HD44780 or the compatible equivalent from Samsung KS0066. The display can be wired to the parallel port of the PC. Therefore boot the PC and go into the BIOS settings. The parallel port has been introduced to control printers, but due to lack of a parallel interface it got quickly used (and also accepted) for other purposes. Therefore make sure DMA access to the parallel port is disabled, since the display is much too slow for that and might cause some timing issues. Very old parallel port interfaces where restricted to just write to the port (who wants to read from a printer?), new ones can also read back data, so check that this is enabled in the BIOS. Reading back is used for the busy bit (handshake). Using the busy bit, the slow display indicates to the very fast PC that it is taking the character, but does not want to already be bothered with a new character. It therefore slows down the data throughput, but makes sure nothing gets lost. Without handshake the PC would have to wait (some unknown time) until the display is ready for the next character. Not using the handshake signal and setting a fixed wait time for the PC is problematic and easily characters could get lost.

Figure 3.12. Lcds

lcd


There is no 5V power on the parallel port, so 5V power can be taken from a drive connector (or USB, 15pin Gameport). For the ground pin 18 to 25 of the parallel port can be used, so the signals taking that as reference and not the noisy ground of the drives. To make the 5V clean, some bypass capacitors between the 5V and the ground of the parallel port are recommended. If the display has high input impedance and long wires would be attached, then the signals could bounce due to EMC noise, resulting in wrong characters in the display. Therefore putting pull down resistors (as 4k7) to all signals coming from the parallel port might be a good idea.

There are different ways to wire this up to the parallel port. Promising are the 4 bit or the 8 bit modes.

The 4 bit mode

The 4 bit mode has 4 wires less to connect but is more challenging for the software. A 8 bit character has to be split to two times 4 bit and two sequential accesses to the hardware. The handshake bit is set after the two accesses and therefore a handshake between the two 4 bit accesses is missing. This has the danger that half characters could get lost and the display could trip out of synchronization. If out of synchronization it would take the 4 bit from the previous character and 4 bits of the next character to form probably a very ugly result.

The 8 bit mode

Soldering 4 extra wires to have a cleaner and faster interface pays back. Therefore the 8 bit winamp is recommended.


Linurs startpage