No input data in emoncms

Good morning to all,
I installed emoncms on my raspberryi pi following the good guide published on github.
In the past the system worked properly with Wheezy but with Jessie I’m experiencing many errors.
2018-04-14 17:52:17.133|ERROR|input_controller.php|Format error, json value is not numeric
on this directory “/var/log/emoncms.log” and following on http://192.168.1.100/emoncms/admin/view :thinking:
I get the data by serial port and checking with minicom everything is ok. Could it be a problem of permission users/directory (dialout,www-data)or in some php file?
Do you know if is there a folder where the data are collected?
Many thanks

Can you tell us which guide you followed and whether you did anything else other than what is in that guide?

The first line of your screenshot refers to a php serial class, PHP should not be accessing the serial port.

Further down, there are references to a file called “rps3.php” what is that? I have never come across that file but it appears to be in the emoncms folder.

From where? What format?

It could be many things at this point, we need more info

Do you have emonhub installed?
If no, what is connecting emoncms to the serial port?

Good day Paul,I followed this guide:

I haven’t install emonhub.
In var/www/emoncms I installed 3 .php files as you can see in the picture below.
The system should acquire the temp. data from solar panel device.
Below the command and the answer:

[email protected]:/var/www/emoncms $ minicom -b 9600 -o -D /dev/ttyAMA0
Welcome to minicom 2.7
OPTIONS: I18n 
Compiled on May  7 2017, 05:18:49.
Port /dev/ttyAMA0
Press CTRL-A Z for help on special keys
0;0;0;0;27;44;50;19;0,0;;0
0;0;0;0;27;44;50;19;0,0;;0
0;0;0;0;27;44;50;19;0,0;;0

I think that rps3.phph is the connections between serial port and emoncms.

<?php
include "php_serial.class.php";
include "Snoopy.class.php";

error_reporting(E_ALL);
ini_set("display_errors",1);
define("PORT","/dev/ttyAMA0");
$serial = new phpSerial;
$serial->deviceSet("PORT");
$serial->confBaudRate("9600");
$serial->confParity("none");
$serial->confCharacterLength("8");
$serial->confStopBits("1");
$serial->confFlowControl("none");
$serial->deviceOpen();
sleep("15");
$read = $serial->readPort();
$serial->deviceClose();
//Parse the data string
echo ">>";
echo $read;
echo "<BR>";
$data = str_replace(",",".",$read);
$data = explode(";", $data);
//Temperature correction factors
$a = -0.0002;
$b = -0.0472;
$c = +1.0434;
//Assign data
$HA = $data[0];
$BK = $data[1];
$P1 = $data[2];
$P2 = $data[3];
$TK = $data[4];
$y = ($a*($data[5])^2)+($b*($data[5]))+$c;
//Apply polynomial data correction
$TR = ($data[5]+$y);
$y = ($a*($data[6])^2)+($b*($data[6]))+$c;
//Apply polynomial data correction
$TS = ($data[6]+$y);
$TV = $data[7];
$P = $data[8];
$snoopy = new Snoopy;
$address = "http://192.168.1.100/emoncms/input/post.json?node=1&json={HA:$HA,BK:$BK,Pompa1:$P1,Pompa2:$P2,TCollettore:$TK,TRitorno:$TR,TBollitore:$TS,TMandata:$TV,Flow:$P}&apikey=8821e61bfcba8104642f0ac04f1d2fbb";
$snoopy->fetch($address);

?>

I found a mistake in rps3.php file. Now I can post the data on emoncms
I’m sorry if you lost your time for this issue.
it was 3 month that I tried to make it work!!!
:grinning:

1 Like