ServerU Parallel LCM Utility
Most ServerU appliances comes with a LCM (Liquid Crystal Module) and a keypad with 4 keys. Those input/output devices are completely programmable and scriptable.
We offer a command line utility, called serveru-pcm-util which has the following usage syntax:
./serveru-plcm-util [-stop|-On|-Off|-DispOff|-DispOn|-LCM1|-LCM2|-Keypad|-Read1|-Read2|-Clear]
This utility is available in full source code if you want to dev something yourself, you can use it as reference. However it's made in such a way it's simple to wrap it upon any other scripting language. All outputs are easily parseable.
Before running the utility you should have the device driver already loaded to kernel. So you will have the following device available:
/dev/plcm_drv
- ./serveru-plcm-util
- The ./serveru-pcm-util is a utility which expects at least one argument as <option>, <option> is one of the following below:
- -stop
- Completely disables the kernel device driver which controls LCM and Keypad
- -On|-Off
- Switch the LCM On or Off without disabling it. No information can be displayed or read, but keypad stills working
- -DispOn|-DispOff
- Switch the LCM backlight On or Off; all information is still there but will only be read on iluminated environment if backlight is turned off
- -LCM1|-LCM2
- Switch betwen LCM Line #1 or LCM Line #2. LCM is in fact two independend display lines limited to 21 printable chars each; therefore you choose when you want to read or write from Line #1 or from Line #2; running ./serveru-plcm-util -LCM1 && echo -n "Hello" > /dev/pcm_drv &&
- ./serveru-plcm-util -LCM2 && echo -n "World!" > /dev/pcm_drv will write Hello on the first line and World! on the second
- -Read1|-Read2
- Will read and print to stdout what is written on LCM Line #1 or Line #2. It's very useful when more than one program write to the LCM (for example, a shell script and a daemon, an application and the operating system, etc); this will allow for remote reading of critical information if one is not phisically in front of the ServerU
- -Clear
- Completely clears both LCM Line #1 and Line #2
- -Keypad
- Will display a hex value of which keypad buttom was last pressed, making distinction between pressed-released buttons or pressed-hold buttons, allowing for amazing flexibility of programatic behaviors; returning values are: a7 = key #1 released; 87 = key #2 released; 8f = key #3 released; af = key #4 released; e7 = key #1 on hold; c7 = key #2 on hold; cf = key #3 on hold; ef = key #4 on hold;
Consider this very simple shell script:
#!/bin/sh
#
# ServerU PLCM Utility
#
# ServerU - http://www.ServerU.com.br http://www.ServerU.us
# PLCM with 2 lines with 4 keys pad model Netmap L100 & Netmap L800
#
# Example useless shell script
#
# Remember LCM display 1 and 2 has 21 chars limit.
#
./serveru-plcm-util -LCM1
/bin/echo -n "Attention! Important!" > /dev/plcm_drv
./serveru-plcm-util -LCM2
/bin/echo -n "This is just a test. " > /dev/plcm_drv
count=20
while [ $count -gt 0 ] ; do
./serveru-plcm-util -Off
sleep 0.3
./serveru-plcm-util -On
sleep 0.3
count=$(( $count -1 ))
done
./serveru-plcm-util -On
This script will write Attention! Important! on LCM Line #1 and This is just a test. on Line #2 and will blink the display 20 times, cycle turning it off & on.