Delta Solivia

others protocols
jeanmarc
Posts: 1858
Joined: Thu Aug 29, 2013 7:16 am

Re: Delta Solivia

Post by jeanmarc » Sat Aug 20, 2016 4:03 pm

Uncomment the print_r($dataarray); and return the output

TonyP62
Posts: 97
Joined: Fri May 01, 2015 11:07 pm

Re: Delta Solivia

Post by TonyP62 » Sat Aug 20, 2016 4:16 pm

The output is:

Code: Select all

Array ( [0] => )

jeanmarc
Posts: 1858
Joined: Thu Aug 29, 2013 7:16 am

Re: Delta Solivia

Post by jeanmarc » Sat Aug 20, 2016 4:36 pm

You sure the command is correct ? And this test, in a terminal type : php test.php ?

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);
echo "return : $CMD_RETURN \n";
/* 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';
}
?>

TonyP62
Posts: 97
Joined: Fri May 01, 2015 11:07 pm

Re: Delta Solivia

Post by TonyP62 » Sat Aug 20, 2016 4:46 pm

with this new file the output is :

Code: Select all

return : Array ( [0] => )
I don't understand this line on your code :

Code: Select all

if ($dataarray[16] == 'OK') {
I don't see any "OK" into the python output.

jeanmarc
Posts: 1858
Joined: Thu Aug 29, 2013 7:16 am

Re: Delta Solivia

Post by jeanmarc » Sat Aug 20, 2016 5:22 pm

What command are you using from the terminal? :roll:
The ok was previously trim from pvo return..

TonyP62
Posts: 97
Joined: Fri May 01, 2015 11:07 pm

Re: Delta Solivia

Post by TonyP62 » Sat Aug 20, 2016 5:30 pm

Yes, but i have modified the python script for avoid to send data on pvoutput every time it was launched.
Now the script is sending the output i have write before :

Code: Select all

Date: d=20160820, Time: t=18:26
Energy Today: v1=21587Wh, Instantaneous Power: v2=390W
Volts: v6=234, Temp: v5=46 oC
and as you can see there is a ',' between Energy today an Instantaneous Power that there is not between Time and Energy Today and Instantaneous Power and Volts. So i think arrays are not valued for this.

jeanmarc
Posts: 1858
Joined: Thu Aug 29, 2013 7:16 am

Re: Delta Solivia

Post by jeanmarc » Sat Aug 20, 2016 5:52 pm

If your command output something, the test script should also say something in return :?
Do you really did a php test.php in a terminal ?

TonyP62
Posts: 97
Joined: Fri May 01, 2015 11:07 pm

Re: Delta Solivia

Post by TonyP62 » Sat Aug 20, 2016 6:04 pm

I have commented the line "if ($dataarray[16] == 'OK') {"
because, IMHO, there is not any ok on OUTPUT from inverter.
If i launch php delta.php now, i obtain this output :

Code: Select all

Date: d=20160820, Time: t=18:59
Energy Today: v1=21729Wh, Instantaneous Power: v2=133W
Volts: v6=233, Temp: v5=45 oC
return :
Array
(
    [0] =>
)
PHP Notice:  Undefined offset: 7 in /var/www/123solar/scripts/protocols/delta.php on line 25
PHP Notice:  Undefined offset: 10 in /var/www/123solar/scripts/protocols/delta.php on line 29
PHP Notice:  Undefined offset: 12 in /var/www/123solar/scripts/protocols/delta.php on line 33
PHP Notice:  Undefined offset: 14 in /var/www/123solar/scripts/protocols/delta.php on line 37
kwh 0 g1p 0 g1v 0 temp 0

jeanmarc
Posts: 1858
Joined: Thu Aug 29, 2013 7:16 am

Re: Delta Solivia

Post by jeanmarc » Sat Aug 20, 2016 6:09 pm

Do this output anything from cli ? python /home/pi/delta/DeltaPVOutput.py -v :cry:

TonyP62
Posts: 97
Joined: Fri May 01, 2015 11:07 pm

Re: Delta Solivia

Post by TonyP62 » Sat Aug 20, 2016 6:16 pm

If i launch from terminal
python /home/pi/delta/DeltaPVOutput.py -v i obtain :

Code: Select all

root@raspberrypi:/var/www/123solar/scripts/protocols# python /home/pi/delta/DeltaPVOutput.py -v
Date: d=20160820, Time: t=19:15
Energy Today: v1=21755Wh, Instantaneous Power: v2=75W
Volts: v6=233, Temp: v5=44 oC
if i laugh from terminal
php delta.php i obtain :

Code: Select all

root@raspberrypi:/var/www/123solar/scripts/protocols# php delta.php
Date: d=20160820, Time: t=19:06
Energy Today: v1=21743Wh, Instantaneous Power: v2=101W
Volts: v6=234, Temp: v5=45 oC
return :
Array
(
    [0] =>
)
PHP Notice:  Undefined offset: 16 in /var/www/123solar/scripts/protocols/delta.php on line 23

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest