3RSystem Mstation HT-3000 - 15c2:ffdc - LCD display on Linux

Friday, April 21, 2017



#!/bin/bash
#
# ht3klcd
#
# script by Cleber de Mattos Casali   http://cmcgames.blogspot.com
#  
# This is a bash script to get my LCD display working on Linux.
# It came with the Mstation HT-3000 case from 3RSystem.
# The device is identified as ID 15c2:ffdc SoundGraph Inc. iMON PAD Remote Controller.
# However, the LCD panel is different from the others I have seen around in the internet.
#
# It has:
#  - 12 text characters for messages and the clock;
#  - 3 fan indicators (updated automatically);
#  - a temperature indicator (updated automatically);
#  - a CPU usage bar;
#  - another bar in the left I couldn't get to work.
#
# LCDd does keep the panel on, but it can't update any info, and the clock just keeps frozen at 12:00.
# I've tried both the imon and the imonlcd drivers, same results.
# This script does get it working, however, you need to stop LCDd before running it.
#
#
# Usage:
#
# ht3klcd
#   run in loop mode
#
# ht3klcd "MESSAGE"
#   display a text message (uses a pipe, needs a running instance)
#  


#PROTOCOL INFO - COMMANDS:

#TIME/DATE:  0d 0f < MM/DD HHMM > 00 02

#TEXT MESSAGE: 0d 0f <12 chars="" message=""> 00 02

#CPU USAGE:  02 0e 00 00 00 00 00 00 00 00 00 00 00 00 02

#Windows driver keeps doing this, but I don't know what it does: 02 1b 01 00 00 00 00 00 00 00 00 00 00 00 00 02

#I don't know how to activate the left bar (volume?). Could'n get it to move on Windows either.

#Buffer always ends with 02 on Windows, but it doesn't seem to make a difference.


#parameters
device=/dev/lcd2
pipeurl="/tmp/.ht3klcd-pipe"
interval=2


#command-line parameter: display message and exit
if [ -n "$1" ]
 then
    mkfifo $pipeurl
    echo "$1">$pipeurl
    exit
fi


while true
do

#get CPU usage
CPU_usage=$(cat <(grep 'cpu ' /proc/stat) <(sleep $interval && grep 'cpu ' /proc/stat) | awk -v RS="" '{printf "%.f\n", ($13-$2+$15-$4)*9/($13-$2+$15-$4+$16-$5)}')

#receive message
if [ -e $pipeurl ]
then

    while read getmsg
    do
      msg=$getmsg
    done<$pipeurl
   
    rm $pipeurl

    #display message
    echo -e -n '\x0d\x0f'$msg >$device
   
else 

    #get date/time in the correct format
    msg=$(date +" %m/%d %H%M")

fi

    #display date/time or message
    echo -e -n '\x0d\x0f'$msg >$device

    #display CPU usage
    echo -e -n "\x02\x0e\x0$CPU_usage" >$device

done

1 comentários:

Nida Rose 26/5/17 15:13  

This game website is amazing,Very cool i realy like it .

Post a Comment

Easy-Share


template by Ourblogtemplates.com
©Copyright 2009, Cleber de Mattos Casali. All rights reserved.