Utilzando PHP para controlar o LCDd

D.I.Y.  |    20/09/2009   |   3764 hits   |   J. Ricardo Simões Rodrigues
Utilzando PHP para controlar o LCDd via sockets. As informações exibidas são obtidas dos arquivos /proc e arquivos gerados pelo lmsensors em /sys/devices/platform/*

Mais informações sobre o dispositivo no artigo sobre o LCDTorrents.

Abaixo, vídeo demonstrando o script em ação.

O script LCDProc.php é o seguinte:

<?php
/*
Config LCDd
*/
$server='localhost';
$port='13666';
$version='0.5';
$title = "PHPLCDProc";
$l = 20;
$h = 4;

/*
Arquivo de stats do Torrentflux
*/
$filename = 'http://' . $server . '/torrentflux/stats.php?t=all&f=xml';

//Config do lmsensors
//lm_sensors
$chip='/sys/devices/platform/it87.656';
$sensors = array( 'cpusens' => 'temp3_input', // cpu sensor
'syssens' => 'temp2_input', // mobo sensor
'fan1sens' => 'fan1_input', // cpufan
'fan2sens' => 'fan2_input', // casefan
'cpumaxsens' => 'temp3_max', // cpumax
'cpuminsens' => 'temp3_min', // cpumin
'sysmaxsens' => 'temp2_max', // sysmax
'sysminsens' => 'temp2_min' // sysmin
);
/*
Iniciallização de variáveis de persistência
*/
$netstats = array();
$netstats['last']['Time'] = microtime(true);
$netstats['last']['Received']['bytes']=0;
$netstats['last']['Received']['packets']=0;
$netstats['last']['Received']['errs']=0;
$netstats['last']['Transmited']['bytes']=0;
$netstats['last']['Transmited']['packets']=0;
$netstats['last']['Transmited']['errs']=0;

$netstats['now']['Time'] = microtime(true);
$netstats['now']['Received']['bytes']=0;
$netstats['now']['Received']['packets']=0;
$netstats['now']['Received']['errs']=0;
$netstats['now']['Transmited']['bytes']=0;
$netstats['now']['Transmited']['packets']=0;
$netstats['now']['Transmited']['errs']=0;

$load = array();
$int = "eth0";

for($i = 1; $i <= 20; $i++){
$net['d'][$i] = 1;
}
for($i = 1; $i <= 20; $i++){
$net['u'][$i] = 1;
}
for($i = 1; $i <= 20; $i++){
$load['Load 1 min'][$i] = 1;
}
for($i = 1; $i <= 20; $i++){
$tempfan['cpu'][$i] = 1;
$tempfan['sys'][$i] = 1;
}


/*
Funções de uso geral
*/
function _clear_str($str){
while (strrpos($str, " ")) {
$str = trim(str_replace(" ", " ", $str));
}
return $str;
}

function _s($str){
return str_replace ( ' ' , '' , $str );
}

function bits_convert($bits, $precision=0) {
$units = array('', 'kb', 'Mb', 'Gb', 'Tb', 'Tb', 'Eb', 'Zb', 'Yb');
$unit = 0;
do {
$bits /= 1024;
$unit++;
} while ($bits > 1024);
return sprintf("%1.{$precision}f%s", $bits, $units[$unit]);
}

function bytes_convert($bytes, $precision=0) {
$units = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$unit = 0;
do {
$bytes /= 1024;
$unit++;
} while ($bytes > 1024);
return sprintf("%1.{$precision}f%s", $bytes, $units[$unit]);
}

function hertz_convert($hertz, $precision=2) {
$units = array(' MHz', ' GHz', ' THz', ' PHz', ' EHz', ' ZHz', ' YHz');
$unit = 0;
do {
$hertz /= 1024;
$unit++;
} while ($hertz > 1024);
return sprintf("%1.{$precision}f%s", $hertz, $units[$unit]);
}

function seconds_convert($seconds) {
return time_duration ($seconds);
}

/**
* A function for making time periods readable
*
* @author Aidan Lister
* @version 2.0.0
* @link http://aidanlister.com/2004/04/making-time-periods-readable/
* @param int number of seconds elapsed
* @param string which time periods to display
* @param bool whether to show zero time periods
*/
function time_duration($seconds, $use = null, $zeros = false)
{
$periods = array (
'a' => 31556926,
'm' => 2629743,
'sem' => 604800,
'd' => 86400,
'h' => 3600,
'min' => 60,
's' => 1
);
$seconds = (float) $seconds;
foreach ($periods as $period => $value) {
if ($use && strpos($use, $period[0]) === false) {
continue;
}
$count = floor($seconds / $value);
if ($count == 0 && !$zeros) {
continue;
}
$segments[strtolower($period)] = $count;
$seconds = $seconds % $value;
}
foreach ($segments as $key => $value) {
//$segment_name = substr($key, 0, -1);
$segment_name = $key;
$segment = $value . '' . $segment_name;
if ($value != 1) {
//$segment .= 's';
}
$array[] = $segment;
}

$str = implode(' ', $array);
return $str;
}

/*
Funções para leitura e processamento de $chip
*/
function _read_sensors ( ){
global $chip;
global $sensors;
$sensor_values = array();
foreach ($sensors as $sensor => $value) {
$filename = $chip . "/" . $value;
$handle = fopen($filename, "r");
$sensor_values[$sensor] = trim(stream_get_contents($handle));
fclose($handle);
}
return $sensor_values;
}

function _process_sensor ( ) {
$sensor_values = _read_sensors ( );

return $sensor_values;
}

/*
Funções para leitura e processamento de /proc/*
*/
function _read_proc_fs ( $filename = '/proc/cpuinfo' ){
$handle = fopen($filename, "r");
$proc = stream_get_contents($handle);
fclose($handle);
return $proc;
}

function _process_proc_fs ( $filename = '/proc/cpuinfo' ) {
global $netstats;
global $int;
$proc = _read_proc_fs ( $filename );

switch ($filename){
case '/proc/cpuinfo':
$proc = explode ("\n", $proc);
$model_name = explode (":", $proc[4]);
$model_name = trim($model_name[1]);
$cpu_MHz = explode (":", $proc[6]);
$cpu_MHz = trim($cpu_MHz[1]);
unset ( $proc );
$proc['Cpu MHz'] = hertz_convert($cpu_MHz);
$proc['Model name'] = _clear_str($model_name);
break;

case '/proc/loadavg':
$proc_ = explode (" ", $proc);
unset ( $proc );
$proc['Load 1 min'] = $proc_[0];
$proc['Load 5 min'] = $proc_[1];
$proc['Load 10 min'] = $proc_[2];
$proc['Processes'] = $proc_[3];
break;

case '/proc/meminfo':
$proc = explode ("\n", $proc);
$aux = explode (":", $proc[0]);
$Men['Total'] = trim($aux[1]);
$aux = explode (":", $proc[1]);
$Men['Free'] = trim($aux[1]);
$aux = explode (":", $proc[11]);
$Swap['Total'] = trim($aux[1]);
$aux = explode (":", $proc[12]);
$Swap['Free'] = trim($aux[1]);
unset ( $proc );
$proc['Men'] = str_replace("kB", "", $Men);
$proc['Swap'] = str_replace("kB", "", $Swap);
break;

case '/proc/uptime':
$aux = explode (" ", $proc);
$Uptime = trim($aux[0]);
$Idle = trim($aux[1]);
unset ( $proc );
$proc['Uptime'] = $Uptime;
$proc['Idle'] = $Idle;
break;

case '/proc/version':
$aux = $proc;
unset ( $proc );
$proc['Version'] = $aux;
break;

case '/proc/net/dev':
$aux = explode ("\n", $proc);
foreach($aux as $l){
$l = explode (":", $l);
if(trim($l[0]) == $int){
unset ( $proc );
$l[1] = _clear_str($l[1]);
$l_ = explode (" ", $l[1]);
$netstats['last']['Time'] = $netstats['now']['Time'];
$netstats['last']['Received']['bytes'] = $netstats['now']['Received']['bytes'];
$netstats['last']['Received']['packets'] = $netstats['now']['Received']['packets'];
$netstats['last']['Received']['errs'] = $netstats['now']['Received']['errs'];
$netstats['last']['Transmited']['bytes'] = $netstats['now']['Transmited']['bytes'];
$netstats['last']['Transmited']['packets'] = $netstats['now']['Transmited']['packets'];
$netstats['last']['Transmited']['errs'] = $netstats['now']['Transmited']['errs'];

$netstats['now']['Time'] = microtime(true);
$netstats['now']['Received']['bytes']=$l_[0];
$netstats['now']['Received']['packets']=$l_[1];
$netstats['now']['Received']['errs']=$l_[2];
$netstats['now']['Transmited']['bytes']=$l_[8];
$netstats['now']['Transmited']['packets']=$l_[9];
$netstats['now']['Transmited']['errs']=$l_[10];

$dT = $netstats['now']['Time'] - $netstats['last']['Time'];
if($netstats['last']['Received']['bytes']>0){
$dRec = $netstats['now']['Received']['bytes'] - $netstats['last']['Received']['bytes'];
}else{
$dRec=0;
}
if($netstats['last']['Transmited']['bytes']>0){
$dTra = $netstats['now']['Transmited']['bytes'] - $netstats['last']['Transmited']['bytes'];
}else{
$dTra =0;
}
if($dT > 0){
//$dRecdT = bits_convert($dRec/$dT) . "/s";
//$dTradT = bits_convert($dTra/$dT) . "/s";
$dRecdT = $dRec/$dT;
$dTradT = $dTra/$dT;
}else{
$dRecdT = 0;
$dTradT = 0;
}

$netstats['Down'] = $dRecdT;
$netstats['Up'] = $dTradT;

$proc = $netstats;
// print_r($proc);
}
}
break;
}
return $proc;
}

/*
Funções para escrita no LCD
*/
function _i($i="BLOCK_FILLED", $x=1, $y=1, $n="blc"){
_w("widget_add scr1 $n icon\n");
_w("widget_set scr1 $n $x $y $i \n");
}

function _w($in){
global $socket;
$ret = socket_write($socket, $in, strlen($in));
if ($ret === false) {
$errorcode = socket_last_error();
$errormsg = socket_strerror($errorcode);
echo "Erro: [$errorcode] $errormsg";
socket_clear_error($socket);
}
}

$create = array('tit1 title',
'info0 string',
'info1 string',
'info2 string',
'info3 string',
'info4 string',
'info5 string',
'info6 string',
'info7 string',
'hbar1 hbar',
'hbar2 hbar',
'scroll1 scroller',
'scroll2 scroller',
'scroll3 scroller');

function _clear($time=5, $delvbar=false){
sleep($time);
global $create;

foreach ($create as $widget)
_w("widget_del scr1 " . substr($widget, 0, strpos($widget, " ")) . " \n");
if($delvbar)
for($i = 1; $i <= 20; $i++)
_w("widget_del scr1 vbar$i \n");

_w("screen_del scr1\n");
}

function _create($createvbar=false){
global $create;
_w("screen_add scr1\n");
_w("screen_set scr1 heartbeat off duration 40\n");

foreach ($create as $widget)
_w("widget_add scr1 " . $widget . " \n");
if($createvbar)
for($i = 1; $i <= 20; $i++)
_w("widget_add scr1 vbar$i vbar\n");

//echo "Flush.<br>\n";
}

/*
Funções para display de Telas
*/
function display_Time($time=3){
_w("screen_add hora \n");
_w("screen_set hora heartbeat off duration 40 \n");
for($i = 0; $i <= 7; $i++)
_w("widget_add hora d" . $i . " num \n");

$pos = array(1, 4, 8, 11, 15, 18);
$data = date("dmy");
$values = array($data[0], $data[1], $data[2], $data[3], $data[4], $data[5]);
$values_ = array_combine($pos, $values);
$i = 0;

$j = 0;
$pos = array(1, 4, 7, 8, 11, 14, 15, 18);
while ($j<=$time){
$data = date("His");
$values = array($data[0], $data[1], 10, $data[2], $data[3], 10, $data[4], $data[5]);
$values_ = array_combine($pos, $values);
$i = 0;
foreach ($values_ as $key => $value){
_w("widget_set hora d" . $i++ . " " . $key . " {" . $value . "}\n");
}
$j++;
sleep(1);
}

_w("screen_del hora \n");
}

//******************************************
function display_CPU($time=5,$title='CPU'){
$proc = _process_proc_fs('/proc/cpuinfo');
$proc2 = _process_proc_fs('/proc/version');
$proc2_ = explode ("(",$proc2['Version']);
$v[] = trim($proc2_[0],")");
$proc2__ = explode (")", $proc2_[3]);
$v[] = trim($proc2__[0],")");
_create();
_w("widget_set scr1 tit1 {" . $title . "}\n");
_i();
_w("widget_set scr1 info1 1 2 {" . str_pad($proc['Model name'], $config['wid'], " ", STR_PAD_BOTH) . "}\n");
_w("widget_set scr1 info2 1 3 {" . str_pad("@" . $proc['Cpu MHz'], $config['wid'], " ", STR_PAD_BOTH) . "}\n");
_w("widget_set scr1 scroll3 1 4 20 4 m 2 {" . $v[0] . $v[1] . " }\n");
_clear($time);
}

//******************************************
function display_Up($time=5,$title='UPTIME'){
global $config;
_create();
_w("widget_set scr1 tit1 {" . $title . "}\n");
_i();
while ($j<$time){
$proc = _process_proc_fs('/proc/uptime');
_w("widget_set scr1 info1 1 2 {" . str_pad(date("d/m/Y H:i", time()), $config['wid'], " ", STR_PAD_BOTH) . "}\n");
_w("widget_set scr1 scroll2 1 3 20 4 m 3 {Up " . seconds_convert($proc['Uptime']) . " }\n");
_w("widget_set scr1 scroll3 1 4 20 4 m 3 {Idle " . seconds_convert($proc['Idle']) . " }\n");
sleep(1);
$j++;
}
_clear(1);
}

//******************************************
function display_Load($time=5,$title='CARGA MEDIA'){
global $load;

while ($j<$time){
_w("screen_add scr1 \n");
_w("screen_set scr1 heartbeat off duration 40 \n");
_w("widget_add scr1 tit1 title \n");
_w("widget_set scr1 tit1 {" . $title . "} \n");
$proc = _process_proc_fs('/proc/loadavg');
$load_['Load 1 min'][1] = round(($proc['Load 1 min']*23)/(2))+1; //23 altura máxima
for($i = 1; $i <= 20; $i++)
$load_['Load 1 min'][$i+1] = $load['Load 1 min'][$i];

$load = $load_;
for($i = 1; $i <= 20; $i++){
$vb = "vbar".$i;
_w("widget_add scr1 $vb vbar\n");
}
for($i = 1; $i <= 20; $i++){
$vb = "vbar".$i;
$value = (int)$load['Load 1 min'][$i];
_w("widget_set scr1 $vb $i 2 $value \n");
}

sleep(1);
$j++;
_w("screen_del scr1 \n");
}

}

//******************************************
function displayNetAux(){
//TODO: quando mudar a escala, recalcular
global $net;
$proc = _process_proc_fs('/proc/net/dev');

//duas escalas para down
if($proc['Down'] < 131072){
//máximo da conexão: 1Mb = 128kB = 131072 Bytes
$net_['d'][1] = round(($proc['Down']*23)/(131072))+1;
$scaleDwn = "1Mb";
}else{
//máximo da conexão: 100Mb = 13107200 Bytes
$net_['d'][1] = round(($proc['Down']*23)/(13107200))+1;
$scaleDwn = "100Mb";
}
for($i = 1; $i <= 20; $i++)
$net_['d'][$i+1] = $net['d'][$i];

//duas escalas para up
if($proc['Up'] < 131072){
$scaleUp = "1Mb";
//máximo da conexão: 1Mb = 128kB = 131072 Bytes
$net_['u'][1] = round(($proc['Up']*23)/(131072))+1;
}else{
$scaleUp = "100Mb";
//máximo da conexão: 100Mb = 13107200 Bytes
$net_['u'][1] = round(($proc['Up']*23)/(13107200))+1;
}
for($i = 1; $i <= 20; $i++)
$net_['u'][$i+1] = $net['u'][$i];

$net = $net_;

return array($net, $scaleDwn, $scaleUp);
}

function display_Net($time=3){
global $int;
_create();
_w("widget_set scr1 tit1 {REDE}\n");
_w("widget_add scr1 aup icon\n");
_w("widget_add scr1 adw icon\n");
_i();
_w("widget_set scr1 aup 1 3 ARROW_DOWN \n");
_w("widget_set scr1 adw 13 3 ARROW_UP \n");
_w("widget_set scr1 info0 1 2 {" . $int . "}\n");
_w("widget_set scr1 info1 3 3 {Download}\n");
_w("widget_set scr1 info2 15 3 {Upload}\n");
$j = 0;
while ($j < $time){
$proc = _process_proc_fs('/proc/net/dev');
_w("widget_set scr1 info3 1 4 {" . bytes_convert($proc['Down']) . "/s}\n");
_w("widget_set scr1 info4 13 4 {" . bytes_convert($proc['Up']) . "/s}\n");
sleep(1);
$j++;
}
_clear(1);
//DW
$j = 0;
while ($j < $time){
$net = displayNetAux();
_w("screen_del scr1 \n");
_w("screen_add scr1\n");
_w("screen_set scr1 heartbeat off duration 40\n");
_w("widget_add scr1 tit1 title\n");
_w("widget_set scr1 tit1 {Download/" . $net[1] . "}\n");
for($i = 1; $i <= 20; $i++){
$vb = "vbar".$i;
_w("widget_add scr1 $vb vbar\n");
}
for($i = 1; $i <= 20; $i++){
$vb = "vbar".$i;
$value = (int)$net[0]['d'][$i];
_w("widget_set scr1 $vb $i 3 $value \n");
}
sleep(1);
$j++;
}
_clear(1);
//UP
$j = 0;
while ($j < $time){
$net = displayNetAux();
_w("screen_del scr1 \n");
_w("screen_add scr1\n");
_w("screen_set scr1 heartbeat off duration 40\n");
_w("widget_add scr1 tit1 title\n");
_w("widget_set scr1 tit1 {Upload/" . $net[2] . "}\n");
for($i = 1; $i <= 20; $i++){
$vb = "vbar".$i;
_w("widget_add scr1 $vb vbar\n");
}
for($i = 1; $i <= 20; $i++){
$vb = "vbar".$i;
$value = (int)$net[0]['u'][$i];
_w("widget_set scr1 $vb $i 3 $value \n");
}
sleep(1);
$j++;
}
_clear(1);
}

//******************************************
function display_Mem($time=3){
global $mem;
_create();
_w("widget_set scr1 tit1 {Memoria}\n");
_i();
_w("widget_set scr1 info0 1 3 {Free} \n");
_w("widget_set scr1 info1 1 4 {Total} \n");
_w("widget_set scr1 info6 1 2 { RAM Swap } \n");
$j = 0;
while ($j < $time){
$proc = _process_proc_fs('/proc/meminfo');
$mem = round((($proc['Men']['Free'])*50)/($proc['Men']['Total']));
$swap = round((($proc['swap']['Free'])*45)/($proc['Swap']['Total']));
_w("widget_set scr1 info2 7 3 {" . bytes_convert($proc['Men']['Free']*1024) ."} \n");
_w("widget_set scr1 info4 7 4 {" . bytes_convert($proc['Men']['Total']*1024) ."} \n");
_w("widget_set scr1 info3 14 3 {" . bytes_convert($proc['Swap']['Free']*1024) ."} \n");
_w("widget_set scr1 info5 14 4 {" . bytes_convert($proc['Swap']['Total']*1024) ."} \n");
sleep(1);
$j++;
}
_clear(1);
}

//******************************************
function display_TempFanAux($sensor_values){
global $tempfan;

$tempfan_['cpu'][1] = $sensor_values['cpusens'];
$tempfan_['sys'][1] = $sensor_values['syssens'];
for($i = 1; $i < 20; $i++){
$tempfan_['cpu'][$i+1] = $tempfan['cpu'][$i];
$tempfan_['sys'][$i+1] = $tempfan['sys'][$i];
}
return $tempfan = $tempfan_;
}

function display_TempFan($time = 5){
_create();
_w("widget_set scr1 tit1 {Temperaturas}\n");
_i();
_w("widget_set scr1 info0 1 2 {CPU} \n");
_w("widget_set scr1 info1 11 2 {Sistema} \n");
$j = 0;
while ($j < $time){
$sensor_values = _process_sensor ( );
$tempfan = display_TempFanAux($sensor_values);
_w("widget_set scr1 info2 1 3 {" . round($sensor_values['cpusens']/1000) . "°C" . "} \n");
_w("widget_set scr1 info3 11 3 {" . round($sensor_values['syssens']/1000) . "°C" . "} \n");
$cpu = round( ( ($sensor_values['cpusens']/1000) * (5*9) ) / ($sensor_values['cpumaxsens']/1000) );
$sys = round( ( ($sensor_values['syssens']/1000) * (5*9) ) / ($sensor_values['sysmaxsens']/1000) );
_w("widget_set scr1 hbar1 1 4 $cpu \n");
_w("widget_set scr1 hbar2 11 4 $sys \n");
sleep(1);
$j++;
}
_clear(1);
_create();
_w("widget_set scr1 tit1 {Ventilacao}\n");
_i();
_w("widget_set scr1 info0 1 2 {" . str_pad("CPU", 10, " ", STR_PAD_BOTH) . "} \n");
_w("widget_set scr1 info1 11 2 {" . str_pad("Sistema", 10, " ", STR_PAD_BOTH) . "} \n");
$j = 0;
while ($j < $time){
_w("widget_set scr1 info2 1 3 {" . str_pad((round($sensor_values['fan1sens']) . " RPM"), 10, " ", STR_PAD_BOTH) . "} \n");
_w("widget_set scr1 info3 11 3 {" . str_pad((round($sensor_values['fan2sens']) . " RPM"), 10, " ", STR_PAD_BOTH) . "} \n");
sleep(1);
$j++;
}
_clear(1);

}

/*
Início do programa
*/

//echo "Iniciando $title $version<br>\n";
//echo "Host: $server:$port<br>\n";

//Get IP do servidor
$command = "ifconfig eth0";
exec ( $command , $output, &$return_var );
$ip = explode(":", $output[1]);
$ip = explode(" ", $ip[1]);
$ip = $ip[0];

//criar socket
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if ($socket === false) {
die("socket_create() failed: reason: " . socket_strerror(socket_last_error()) . "\n");
} else{
//echo "Socket criado.<br>\n";
}

$result = socket_connect($socket, $server, $port);
if ($result === false) {
die("socket_connect() failed.\nReason: ($result) " . socket_strerror(socket_last_error($socket)) . "\n");
}else{
//echo "Socket conectado.<br>\n";
}

$in = "hello\n";
$out = '';

socket_write($socket, $in, strlen($in));

$out = socket_read($socket, 2048);

if(strpos ($out, 'LCDproc') > 0){
$info = explode(" ", $out);
$config['version'] = $info[2];
$config['protocol'] = $info[4];
$config['wid'] = $info[7];
$config['hgt'] = $info[9];
$config['maxdim'] = 5 * ( $config['wid'] - 8 );
//echo "Configs do LCD: <br>\n";
//print_r($info) . "<br>\n";

}else{
die("socket_read() failed.\nReason: ($result) " . socket_strerror(socket_last_error($socket)) . "\n");
}

//Nome do cliente
_w("client_set -name {" . $title . "} \n");

while (true){
//echo "Iniciando ciclo.<br>\n\n";

display_Time();

display_CPU();

display_TempFan();

display_Up();

display_Load();

display_Net();

display_Mem();

}


/*
45 {ICON_BLOCK_FILLED, "BLOCK_FILLED"},
46 {ICON_HEART_OPEN, "HEART_OPEN"},
47 {ICON_HEART_FILLED, "HEART_FILLED"},
48 {ICON_ARROW_UP, "ARROW_UP"},
49 {ICON_ARROW_DOWN, "ARROW_DOWN"},
50 {ICON_ARROW_LEFT, "ARROW_LEFT"},
51 {ICON_ARROW_RIGHT, "ARROW_RIGHT"},
52 {ICON_CHECKBOX_OFF, "CHECKBOX_OFF"},
53 {ICON_CHECKBOX_ON, "CHECKBOX_ON"},
54 {ICON_CHECKBOX_GRAY, "CHECKBOX_GRAY"},
55 {ICON_SELECTOR_AT_LEFT, "SELECTOR_AT_LEFT"},
56 {ICON_SELECTOR_AT_RIGHT, "SELECTOR_AT_RIGHT"},
57 {ICON_ELLIPSIS, "ELLIPSIS"},
58 {ICON_PAUSE, "PAUSE"},
59 {ICON_PLAY, "PLAY"},
60 {ICON_PLAYR, "PLAYR"},
61 {ICON_FF, "FF"},
62 {ICON_FR, "FR"},
63 {ICON_NEXT, "NEXT"},
64 {ICON_PREV, "PREV"},
65 {ICON_REC, "REC"},
66 {0,NULL}
*/

Executar com o seguinte comando:

 php LCDProc.php 

Última edição concluída em 29/11/2009 por J. Ricardo Simões Rodrigues.