Repurposing a Media PC Case's LCD Display

I managed to get access to an old media PC case for a home surveillance build I’m working on. It’s made of steel and is HEAVY. However, one of it’s cool features is a LCD display. This is what the device looks like on Linux:

Bus 005 Device 002: ID 0403:fa01 Future Technology Devices International, Ltd Matrix Orbital MX2 or MX3

The device node it exposes is /dev/TTYUSB0. So I figured, might as well try talking to it and and see if it can display stuff.

I’ll cut right to the chase so you folks that found this in a Google search can get right to business using it.

#!/bin/bash
# Prints raw characters
chr() {
  printf \\$(printf '%03o' $1)
}

# Prints clear screen sequence
lcdclear() {
  CLEAR="$(chr 254)$(chr 88)"
  echo $CLEAR > /dev/ttyUSB0
}

# Set the mode of the virtual serial device
stty -F/dev/ttyUSB0 19200 cs8 -cstopb

This little shell snippet gives you the ability to clear the screen using lcdclear(), and sets the params to talk to the serial interface using stty. From there you can pretty much just write directly to the device:

date "+%F %R" > /dev/ttyUSB0

That should give you enough to script up whatever you want to display on the LCD. Note that there aren’t that many characters, so you’ll have to be terse.

Have fun!

Dialogue & Discussion