Peter_n,
My project in description sounds simple. It is an arduino that has analog glass temperature sensors. Every 60 seconds it writes the current temperature to the sd card for the given day. Ex: tp150828.txt. And writes it line by line....
On my website, I use PHP because you can insert external files to it. In my case. I have prebuilt PHP files for every day. And I use the php include function to insert the data from the text file that was uploaded. ( I hope I am explaining it well.)
For example. I use google charts. So I can have the text file write:
[[hour,minute,second], sensor00, sensor01, sensor02, sensor03, sensor04, sensor05]
So I get a text file for today tp150826.txt (tp for temperature, Year, Month, Day).
[[03,19,01], 78.61 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,20,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,21,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,22,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,23,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,24,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,25,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,26,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,27,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,28,01], 78.93 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,29,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,30,01], 78.93 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
Then on the PHP file. I have an include to input the file. PHP looks like this:
<html>
<head>
<title>ICE Tent 2015 Daily Report</title>
<link href="http://eqrunner.com/eqCSSscript.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='http://www.google.com/jsapi'></script>
<script type="text/javascript">
google.load('visualization', '1.1', {packages: ['line']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
// data.addColumn('datetime', 'Date');
data.addColumn('timeofday', 'Time');
data.addColumn('number', 'TempSensor');
data.addColumn('number', 'LightSensor');
data.addColumn('number', 'KnobSensor');
data.addColumn('number', 'KnobSensor');
data.addColumn('number', 'Sensor04');
data.addColumn('number', 'Sensor05');
data.addRows([
<?php include("temperature/tp150826.txt"); ?>
]);
var options = {
chart: {
// title: 'ICE COLD Tent 2015',
// subtitle: 'DATE OF DAY'
},
height: 800,
};
var chart = new google.charts.Line(document.getElementById('linechart_material'));
chart.draw(data, options);
}
</script>
</head>
<body>
<p><a href="http://ice2015.eqrunner.com">ICE Tent 2015 Daily Report</a></p>
2015-08-27
<div id="linechart_material"></div>
<p align="right"><a href="http://eqrunner.com">Created and run by eqrunner inc</a></p>
</body>
</html>
When you view it on the site server side. The PHP INCLUDE is replaced by the content of the file it is including. Thus getting a completed chart.
I want to have a local log file in addition to the log on my server.
This is what you see on the server:
<html>
<head>
<title>ICE Tent 2015 Daily Report</title>
<link href="http://eqrunner.com/eqCSSscript.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='http://www.google.com/jsapi'></script>
<script type="text/javascript">
google.load('visualization', '1.1', {packages: ['line']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
// data.addColumn('datetime', 'Date');
data.addColumn('timeofday', 'Time');
data.addColumn('number', 'TempSensor');
data.addColumn('number', 'LightSensor');
data.addColumn('number', 'KnobSensor');
data.addColumn('number', 'KnobSensor');
data.addColumn('number', 'Sensor04');
data.addColumn('number', 'Sensor05');
data.addRows([
[[03,19,01], 78.61 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,20,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,21,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,22,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,23,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,24,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,25,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,26,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,27,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,28,01], 78.93 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,29,01], 78.77 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
[[03,30,01], 78.93 , -118.55 , 129.53 , 75.72 , null , 109.32 ],
]);
var options = {
chart: {
// title: 'ICE COLD Tent 2015',
// subtitle: 'DATE OF DAY'
},
height: 800,
};
var chart = new google.charts.Line(document.getElementById('linechart_material'));
chart.draw(data, options);
}
</script>
</head>
<body>
<p><a href="http://ice2015.eqrunner.com">ICE Tent 2015 Daily Report</a></p>
2015-08-27
<div id="linechart_material"></div>
<p align="right"><a href="http://eqrunner.com">Created and run by eqrunner inc</a></p>
</body>
</html>