Page 3 of 5

Re: Delta Solivia

Posted: Sun Aug 30, 2015 11:02 am
by TonyP62
Today i have try to test the new script and i see that the result is the same of the other scripts tested this days.
New script is test.php and this the result:

Code: Select all

 php dtest.php
Date: d=20150830, Time: t=11:53
Energy Today: v1=11240Wh, Instantaneous Power: v2=2985W
Volts: v6=238, Temp: v5=52 oC
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    68  100    20  100    48     24     58 --:--:-- --:--:-- --:--:--   116
Array
(
    [0] => OK
    [1] => 200:
    [2] => Added
    [3] => Status
)
As you see, no data on arrays. The arrays for date, time, Energy, Power, etc. don't be printed in output, so i think that them have a null value.
In which way we can solve ?

Re: Delta Solivia

Posted: Sun Aug 30, 2015 2:49 pm
by jeanmarc
Odd.. and that ?

Code: Select all

<?php
$CMD_RETURN = exec('python DeltaPVOutput.py -v  > /dev/null 2>&1');
$dataarray  = preg_split('/[[:space:]]+/', $CMD_RETURN);
print_r($dataarray);
?>
I don't get why the array don't fill with values.

Re: Delta Solivia

Posted: Sun Aug 30, 2015 5:35 pm
by TonyP62
This new script returns:

Code: Select all

 php dt2.php
Array
(
    [0] => 
)

Re: Delta Solivia

Posted: Sun Aug 30, 2015 5:39 pm
by jeanmarc
hmm, i don't know what's wrong. :|
Maybe your could create some sort of daemon script then read from an output file.

Re: Delta Solivia

Posted: Mon Aug 31, 2015 10:22 am
by jeanmarc
Could you rather try that : (DeltaPVOutput script is to feed PVOutput)

Code: Select all

<?php
$CMD_RETURN = exec('python power-now.py');
$dataarray  = preg_split('/[[:space:]]+/', $CMD_RETURN);
print_r($dataarray);
?>

Re: Delta Solivia

Posted: Tue Sep 01, 2015 10:19 am
by TonyP62
With 'power-now' script , the result is always that same:

Code: Select all

python power-now.py
AC Power command failed: Invalid Response: Empty reply. RS485 id: 0
Retry count: 1 Reinitialize connection
This type of script don't works with delta solivia 5.0 .

Re: Delta Solivia

Posted: Tue Sep 01, 2015 11:00 am
by jeanmarc
Perhaps that would be better to ask the guy over the script, just ask him the thing to do to show output :geek:
I don't know much about python.

Re: Delta Solivia

Posted: Fri Aug 19, 2016 6:20 pm
by TonyP62
Hello JeanMarc.
I have try with new version of 123solar and now the Delta.php is returning this:

Code: Select all

python /home/pi/DeltaPVOutput/DeltaPVOutput.py -v return : OK 200: Added Status 
error : / 
.

It seems to be working, but i don't understand why is giving an error. OK 200 Added Status is the inverter response when it sends all data to pvoutput. Can you help me for a solution ?

Re: Delta Solivia

Posted: Fri Aug 19, 2016 6:52 pm
by jeanmarc
Hi Tony,
Yup it's an output from PVOutput. I believe the command is wrong in scripts/protocols/delta.php.
Did it worked previously ? Did i change that :? ?

Re: Delta Solivia

Posted: Sat Aug 20, 2016 3:04 pm
by TonyP62
Yes JeanMarc. the delta.php file was written from you, i have not made any modification.
I create a new copy of the python script and i have commented all lines for sending data to pvoutput.
Now the output is:

Code: Select all

Date: d=20160820, Time: t=16:51
Energy Today: v1=20105Wh, Instantaneous Power: v2=1487W
Volts: v6=236, Temp: v5=49 oC
I uncomment lines from your delta.php file for testing and the result is:

Code: Select all

Array ( [0] => )

It seems to work but there is no data .
This is the delta.php file :

Code: Select all

<?php
if (!defined('checkaccess')) {
// comment this line to test from command line
    die('Direct access not permitted');
}

$CMD_RETURN = '';

$CMD_POOLING = 'python /home/pi/delta/DeltaPVOutput.py -v';
$CMD_RETURN = exec($CMD_POOLING);

/* Test line
$CMD_RETURN = "
Date: d=20150719, Time: t=10:36
Energy Today: v1=8142Wh, Instantaneous Power: v2=2570W
Volts: v6=239, Temp: v5=47 oC";
*/

$dataarray = preg_split('/[[:space:]]+/', $CMD_RETURN);
// uncomment this line to test
//print_r($dataarray);

if ($dataarray[16] == 'OK') {

    $KWHT = $dataarray[7];
    $KWHT = substr($KWHT, 3);
    settype($KWHT, 'float');

    $G1P = $dataarray[10];
    $G1P = substr($G1P, 3);
    settype($G1P, 'float');

    $G1V = $dataarray[12];
    $G1V = substr($G1V, 3);
    settype($G1V, 'float');

    $INVT = $dataarray[14];
    $INVT = substr($INVT, 3);
    settype($INVT, 'float');
    // uncomment this line to test
    echo "kwh $KWHT g1p $G1P g1v $G1V temp $INVT ";
    $RET = 'OK';
} else {
    $RET = 'NOK';
}
?>
Any suggestion ?