Mam mały problem dane z $temp_water niestety źle mi się wyświetlają tzn. wcale
ale w tabeli gdzie jest <td>Temperatura powietrza</td> wyświetla tekstowo tak jak powinno chciałem zaadoptować tą wartość nako temp_water do div-a tempgauge_water
czy powinienem to inaczej zrobić niż inne wartości
Mógłby ktoś na to zerknąć
<html>
<head>
<title>AquaPI by Traczu</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="assets/css/main2.css" />
<link rel="stylesheet" href="stylesheets/main.css">
<link rel="stylesheet" href="stylesheets/button.css">
<script src="javascript/raphael.2.1.0.min.js"></script>
<script src="javascript/justgage.1.0.1.min.js"></script>
<!--[if lte IE 8]><script src="assets/js/html5shiv.js"></script><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
</head>
<body>
require_once('db.php');
?>
<?php
$temp_water = shell_exec(' /sys/bus/w1/devices/28-000006db5817/w1_slave'); $temp_water = round($temp_water[1
] / 1000
, 1
);
$tempcpu = shell_exec('cat /sys/class/thermal/thermal_zone*/temp'); $tempcpu = round($tempcpu / 1000
, 1
);
$clock = shell_exec('cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq'); $clock = round($clock / 1000
);
$voltage = shell_exec('/opt/vc/bin/vcgencmd measure_volts'); $voltage = $voltage[1];
$voltage = substr($voltage,0
,-2
);
$cpuusage = 100
- shell_exec("vmstat | tail -1 | awk '{print $15}'");
$uptime = explode(' up ', $uptimedata); $uptime = explode(',', $uptime[1
]); $uptime = $uptime[0].', '.$uptime[1];
include 'localization/'.LANGUAGE.'.lang.php';
?>
<script>
function checkAction(action){
if (confirm('
<?php echo TXT_CONFIRM
; ?> ' + action + '?'))
{
return true;
}
else
{
return false;
}
}
window.onload = doLoad;
function doLoad()
{
setTimeout( "refresh()", 30*1000 );
}
function refresh()
{
window.location.reload( false );
}
</script>
<!-- Wrapper -->
<div id="wrapper">
<!-- Main -->
<section id="main">
<header>
<span class="avatar"><img src="images/aquarium-icon.png" alt="" /></span>
</header>
<div>
<div id="lewy">
<p><a href="info.php"><img src="images/info_off.png" alt="" border="0"/></a></p>
<p><a href="light.php"><img src="images/light_off.png" alt="" border="0"/></a></p>
</div>
<div id="srodek">
<p><a href="setting.php"><img src="images/setting_off.png" alt="" border="0"/><a href="light.php"></a></p>
</div>
<div id="prawy">
<p><a href="index.php?logout"><img src="images/power_off.png" alt="" /></a></p>
</div>
<br><br><br>
<table border="0" cellspacing="10" align="center">
<tr>
<td>Temperatura powietrza</td>
<td bgcolor="white">
<?php
//File to read
$file = '/sys/bus/w1/devices/28-000006db5817/w1_slave';
//Read the file line by line
//Get the temp from second line
//Setup some nice formatting (i.e. 21,3)
//And echo that temp
?>
</td>
</tr></table>
<div id="tempgauge_water"></div>
<script>
var t = new JustGage({
id: "tempgauge_water",
value:
<?php echo $temp_water; ?>,
min: 0,
max: 100,
title: "
<?php echo TXT_TEMPERATURE_WATER
; ?>",
label: "°C"
});
</script>
<?php } ?>
<div id="tempgauge"></div>
<script>
var t = new JustGage({
id: "tempgauge",
value:
<?php echo $tempcpu; ?>,
min: 0,
max: 100,
title: "
<?php echo TXT_TEMPERATURE_CPU
; ?>",
label: "°C"
});
</script>
<?php } ?>
<div id="voltgauge"></div>
<script>
var v = new JustGage({
id: "voltgauge",
value:
<?php echo $voltage; ?>,
min: 0.8,
max: 1.4,
title: "
<?php echo TXT_VOLTAGE
; ?>",
label: "V"
});
</script>
<?php } ?>
<div id="cpugauge"></div>
<script>
var u = new JustGage({
id: "cpugauge",
value:
<?php echo $cpuusage; ?>,
min: 0,
max: 100,
title: "
<?php echo TXT_USAGE
; ?>",
label: "%"
});
</script>
<?php } ?>
<div id="clockgauge"></div>
<script>
var c = new JustGage({
id: "clockgauge",
value:
<?php echo $clock; ?>,
min: 0,
max: 1000,
title: "
<?php echo TXT_CLOCK
; ?>",
label: "MHz"
});
</script>
<?php } ?>
<?php
$datum = date("Y-m-d (D) H:i:s",$timestamp); ?>
</div>
</div>
</div>
<?php if ($_SESSION['auth'] == TRUE) {
}
else {
echo '<meta http-equiv="refresh" content="0; URL=index.php">'; }
?>
</body>
</html>