Page 2 of 2

Re: Problems after month change

Posted: Mon Aug 17, 2015 2:07 pm
by jeanmarc
But what -am0 is suppose to do ? And why only on the first month's day ? :?

Re: Problems after month change

Posted: Tue Sep 01, 2015 7:31 am
by pv81
The problem is still there, it's the 1st of sep ... ;)
#1 01/09/2015 08:29:12 Connection lost

#1 01/09/2015 08:24:51 Connection lost

#* 01/09/2015 08:19:27 123Solar awake

#* 01/09/2015 08:18:26 Starting 123Solar
If I start the program in the console with:

Code: Select all

/usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=DATA -cfg/mnt/usb/www/123solar/config/SBFspot_0.cfg -nosql
the response is:

Code: Select all

20150901-08:29:36 230.820 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 50.030 0.000 51.470 0.000 22330.214 377.680 0.000 0.000 377.620 0.000 0.000 230.820 0.000 0.000 >>>S123:OK
There is no data to export!

Re: Problems after month change

Posted: Tue Sep 01, 2015 8:19 am
by jeanmarc
Could you request that test.php page from a browser and return the output :

Code: Select all

<?php
$CMD_RETURN = '';
$CMD_POOLING = "/usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=DATA -cfg/mnt/usb/www/123solar/config/SBFspot_0.cfg -nosql";
$datareturn = exec($CMD_POOLING);

// test line
/*
$CMD_RETURN ="20150901-08:29:36 230.820 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 50.030 0.000 51.470 0.000 22330.214 377.680 0.000 0.000 377.620 0.000 0.000 230.820 0.000 0.000 >>>S123:OK
There is no data to export!";
*/

$dataarray = preg_split('/[[:space:]]+/', $CMD_RETURN);
if ($dataarray[24] == '>>>S123:OK') {
    $RET = 'OK';
} else {
    $RET = 'NOK';
}
echo "It's $RET";

print_r($dataarray);
?>

Re: Problems after month change

Posted: Tue Sep 01, 2015 11:48 am
by pv81
Result:
It's NOKArray ( [0] => )
Edit:
FALSE: --> $CMD_RETURN

Code: Select all

$dataarray = preg_split("/[[:space:]]+/", $CMD_RETURN);
TRUE: --> $datareturn

Code: Select all

$dataarray = preg_split("/[[:space:]]+/", $datareturn);
Result:
It's OKArray ( [0] => 20150901-13:16:38 [1] => 231.270 [2] => 2.421 [3] => 558.000 [4] => 0.000 [5] => 0.000 [6] => 0.000 [7] => 0.000 [8] => 0.000 [9] => 0.000 [10] => 49.990 [11] => 97.213 [12] => 54.000 [13] => 0.000 [14] => 22332.027 [15] => 376.160 [16] => 0.775 [17] => 291.000 [18] => 378.030 [19] => 0.751 [20] => 283.000 [21] => 231.270 [22] => 2.421 [23] => 558.000 [24] => >>>S123:OK )

Re: Problems after month change

Posted: Tue Sep 01, 2015 1:12 pm
by jeanmarc
No problem here. And even with the additional string 'There is no data to export!', it should be Ok..

Re: Problems after month change

Posted: Tue Sep 01, 2015 6:34 pm
by pv81
jeanmarc wrote:No problem here. And even with the additional string 'There is no data to export!', it should be Ok..
"There is no data to export!" is probably yet the reason.

With an additional parameter "-nocsv" in "Communication options", it works ! :shock:
If there is only one Parameter (-nosql), it doesn't work ...

Why ? :?:


Look the source of SBFspot (CSVexport.cpp):

Code: Select all

int ExportMonthDataToCSV(const Config *cfg, InverterData *inverters[])
{
	char msg[80 + MAX_PATH];
	if (cfg->CSV_Export == 1)
	{
		if (VERBOSE_NORMAL) puts("ExportMonthDataToCSV()");

		if (inverters[0]->monthData[0].datetime <= 0)	//invalid date?
			puts("There is no data to export!"); //First day of the month?
		else
		{
			FILE *csv;
			
			ect.
			........
			


Edit:
THE REASON: :idea:

"$datareturn" delivers 2 Strings back.
1. String:
20150901-08:29:36 230.820 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 50.030 0.000 51.470 0.000 22330.214 377.680 0.000 0.000 377.620 0.000 0.000 230.820 0.000 0.000 >>>S123:OK
2. String:
There is no data to export!
This is the reason, because 123solar can't find data ...

SOLUTION: Parameter "-nocsv" is required !

OR

see here: https://sbfspot.codeplex.com/discussions/644444

and the developer of SBFspot fix it ...

Re: Problems after month change

Posted: Sat Sep 26, 2015 9:03 am
by jeanmarc
:idea: Good news, it seem like it has been fixed with SBFspot V3.1.2