www/getfermenter.php

Mon, 21 Jan 2019 20:45:18 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 21 Jan 2019 20:45:18 +0100
changeset 194
d202777ebae5
parent 180
a5aa3502310c
child 296
69fadd1aded2
permissions
-rw-r--r--

Added design notes for the csv log format from fermenters. In bmsd configuration added the web_root entry. Switched fermenter DLOG messages to store the log in flat csv files instead of the database. This is much faster and the graphs look better.

<?php

require_once('config.php');

if (isset($_GET["uuid"]))
	    $uuid = $_GET["uuid"];
else
	    $uuid = "'ef166f25-1bb4-4bef-b112-a867af77f766'";


$mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
$query = "SELECT * FROM mon_fermenters WHERE uuid=".$uuid."";
$result = $mysqli->query($query);
$resultArray = $result->fetch_array(MYSQLI_ASSOC);
if ($resultArray['online'] == 'Y') {
  $resultArray['online'] = 1;
} else {
  $resultArray['online'] = 0;
}
echo json_encode($resultArray);

mercurial