SMA Communication error at Communication-Test

SBFspot protocol http://sbfspot.codeplex.com/
Cosmo Kramer
Posts: 13
Joined: Fri Jul 31, 2015 11:47 am

SMA Communication error at Communication-Test

Post by Cosmo Kramer » Fri Jul 31, 2015 5:11 pm

Hallo,

i want to use 123solar. But i have a Problem with the communication.
I use an SMA Tripower 8000, sbfspot 303 and 123solar 1.6.6.3 with Eternet-Comunication.

If i go in the admin-site and want to test the Communication, i get the answer:
timeout --kill-after=30s 10s /usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=DATA -cfg/config/SBFspot_0.cfg return :

error : /
when i test sbfspot, the communication is ok, but not in 123solar.
Where can be the Problem, debbugging is off.
I hope, someone can help me (if possible in german).

With regards

First answer Check if the www user is able to launch sbfspot.
Check, everybody is enable for sbfspot, but same Problem.

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

Re: SMA Communication error at Communication-Test

Post by jeanmarc » Fri Jul 31, 2015 5:33 pm

Is SBFspot located in /usr/local/bin/ ? Check with "whereis SBFspot".
You may need to change the path in scripts/protocols/SBFspot*.php then..

Cosmo Kramer
Posts: 13
Joined: Fri Jul 31, 2015 11:47 am

Re: SMA Communication error at Communication-Test

Post by Cosmo Kramer » Fri Jul 31, 2015 6:11 pm

In var/www/123solar/scripts/protocols the Data is change in

Code: Select all

if (!$DEBUG) {
    $CMD_POOLING = $timeout_setup . " [size=150]/usr/local/bin/sbfspot.3/SBFspot[/size] -finq -q -123s=DATA -cfg" . $cfgdir . "/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}";
} else { // This output is really verbose and does not respect the 123s data frame, hence why you will had no data
    $CMD_POOLING = $timeout_setup . "[size=150] /usr/local/bin/sbfspot.3/SBFspot[/size] -finq -d5 -v5 -123s=DATA -cfg" . $cfgdir . "/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}"; // Pooling with errors output ?
}
Startup:

Code: Select all

// Info file
$CMD_INFO = $timeout_setup." /usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=INFO -cfg".$cfgdir."/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}";

// Sync inverter
$CMD_SYNC = $timeout_setup." /usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=SYNC -cfg".$cfgdir."/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}";

?>
Spotcheks:

Code: Select all

// Info file
$CMD_INFO = $timeout_setup." /usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=INFO -cfg".$cfgdir."/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}";

// Sync inverter
$CMD_SYNC = $timeout_setup." /usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=SYNC -cfg".$cfgdir."/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}";

?>
and in /usr/local/bin/sbfspot.3 is sbfspot.

Answer from wheris: root@123solar:/home/pi#

Cosmo Kramer
Posts: 13
Joined: Fri Jul 31, 2015 11:47 am

Re: SMA Communication error at Communication-Test

Post by Cosmo Kramer » Sat Aug 01, 2015 5:24 am

Where can i find a Tutorial, for install 123solar and sbfspot on Wheezy?
Perhaps i have a wrong Tutorial for this.

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

Re: SMA Communication error at Communication-Test

Post by jeanmarc » Sat Aug 01, 2015 7:00 am

You can enable 123s debug and check the output to get the errors messages. So far, it seem like your 'www' user is unable to launch SBFspot.

You can also make this simple test script bellow, request it on your browser and check your server log.
in scripts/protocols/test.php

Code: Select all

<?php
$datareturn = null; 
$timeout_setup = "timeout --kill-after=10s 5s"; // TERM after 5" & KILL after 10"

$cfgdir = '/config'; // path to your sbf SBFspot_1.cfg config
$CMD_POOLING = $timeout_setup . " /usr/bin/SBFspot -finq -d5 -v5 -123s=DATA -cfg" . $cfgdir . "/SBFspot_1.cfg"; 

$datareturn = exec($CMD_POOLING);
echo $datareturn;
?>

Cosmo Kramer
Posts: 13
Joined: Fri Jul 31, 2015 11:47 am

Re: SMA Communication error at Communication-Test

Post by Cosmo Kramer » Sat Aug 01, 2015 3:35 pm

Thanks for your answer, i´m now back from work.

This is the answer for ls -l in
root@123solar:/usr/local/bin/sbfspot.3# ls
date_time_zonespec.csv SBFspot_1.cfg TagListES-ES.txt TagListNL-NL.txt
SBFspot TagListDE-DE.txt TagListFR-FR.txt
SBFspot_0.cfg TagListEN-US.txt TagListIT-IT.txt
root@123solar:/usr/local/bin/sbfspot.3# ls -l
insgesamt 1476
-rwxrwxrwx 1 root staff 35855 Jul 30 18:58 date_time_zonespec.csv
-rwxrwxrwx 1 root staff 287047 Jul 30 18:58 SBFspot
-rwxrwxrwx 1 root staff 5553 Jul 30 19:02 SBFspot_0.cfg
-rwxrwxrwx 1 root staff 5553 Jul 30 19:02 SBFspot_1.cfg
-rwxrwxrwx 1 root staff 193513 Jul 30 18:58 TagListDE-DE.txt
-rwxrwxrwx 1 root staff 185646 Jul 30 18:58 TagListEN-US.txt
-rwxrwxrwx 1 root staff 195943 Jul 30 18:58 TagListES-ES.txt
-rwxrwxrwx 1 root staff 199432 Jul 30 18:58 TagListFR-FR.txt
-rwxrwxrwx 1 root staff 194132 Jul 30 18:58 TagListIT-IT.txt
-rwxrwxrwx 1 root staff 188218 Jul 30 18:58 TagListNL-NL.txt

Here the Message from Test.php:

"Commandline Args: finq -d5 -v5 -123s=Data -cfg/config/SBFspot_1cfg"

On Apache 2 there no more errors after change $cfgdir.
But 123solar get no connection to the SMA-Inverter.

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

Re: SMA Communication error at Communication-Test

Post by jeanmarc » Sun Aug 02, 2015 3:52 pm

There is problem with your test.php file. Please, copy paste the example.
Request the page from your browser and also from the terminal with "php test.php". Quote both outputs.

Read also this thread (SMAspot.cfg files shall be copy into /srv/http/123solar/config/)

Cosmo Kramer
Posts: 13
Joined: Fri Jul 31, 2015 11:47 am

Re: SMA Communication error at Communication-Test

Post by Cosmo Kramer » Sun Aug 02, 2015 4:40 pm

Hallo,
I have take the code, copy them, make a File test.php in scripts/protocols/ in i find on the admintration-site an Option "test" (where i can select sbfspot, ...) and restart 123 solar an test the communication. The answer from them is

Code: Select all

Commandline Args: -finq -d5 -v5 -123s=DATA -cfg/config/SBFspot_1.cfg
timeout --kill-after=10s 5s /usr/local/bin/sbfspot.3/SBFspot -finq -d5 -v5 -123s=DATA -cfg/config/SBFspot_1.cfg return : Commandline Args: -finq -d5 -v5 -123s=DATA -cfg/config/SBFspot_1.cfg

error : /
.

If i writ on the Browser: http://1****/123solar/scripts/protocols/test.php the answer is:

Code: Select all

Commandline Args: -finq -d5 -v5 -123s=DATA -cfg/config/SBFspot_1.cfg
I have copy the sbfspot.cfg , rename in sbfspot_1.cfg and paste in */* 123solar/config like in the tutorial.

But i get everytime this request.

Here is the SBFspot.php:

Code: Select all

<?php
if(!defined('checkaccess')){die('Direct access not permitted');}
// For SBFspot https://sbfspot.codeplex.com/
// Use $COMOPTION for SBFspot CSV command switches (-ad# -am# -nocsv etc)

// Timeout setup : for SBFspot timeout management by 123Solar
// ( relies on timeout command )
$datareturn = null; 

$timeout_setup = "timeout --kill-after=10s 5s"; // TERM after 5" & KILL after 10"
$cfgdir = ' /var/www/123solar/config';
//echo $cfgdir;

if (!$DEBUG) {
    $CMD_POOLING = $timeout_setup . " /usr/local/bin/sbfspot.3/SBFspot -finq -q -=DATA -cfg" . $cfgdir . "/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}";
} else { // This output is really verbose and does not respect the 123s data frame, hence why you will had no data
    $CMD_POOLING = $timeout_setup . " /usr/local/bin/sbfspot.3/SBFspot -finq -d5 -v5 -123s=DATA -cfg" . $cfgdir . "/SBFspot_${'ADR'.$invt_num}.cfg ${'COMOPTION'.$invt_num}"; // Pooling with errors output ?
}
Console say :Keine Berechtigung (no permission?)

$datareturn = exec($CMD_POOLING);
//$array      = preg_split('/[[:space:]]+/', $datareturn);
if (isset($array[24])) { // SBFspot might send trames shorter than 24
    if ($array[24] == '>>>S123:OK') {
	$SDTE = $array[0];
        $G1V  = $array[1]; // GridMs.PhV.phsA
        settype($G1V, 'float');
        $G1A = $array[2]; // GridMs.A.phsA
        settype($G1A, 'float');
        $G1P = $array[3]; // GridMs.W.phsA
        settype($G1P, 'float');
        $G2V = $array[4]; // GridMs.PhV.phsB
        settype($G2V, 'float');
        $G2A = $array[5]; // GridMs.A.phsB
        settype($G2A, 'float');
        $G2P = $array[6]; // GridMs.W.phsB
        settype($G2P, 'float');
        $G3V = $array[7]; // GridMs.PhV.phsC
        settype($G3V, 'float');
        $G3A = $array[8]; // GridMs.A.phsC
        settype($G3A, 'float');
        $G3P = $array[9]; // GridMs.W.phsC
        settype($G3P, 'float');
        $FRQ = $array[10]; // GridMs.Hz
        settype($FRQ, 'float');
        $EFF = $array[11]; // Value computed by SBFspot
        settype($EFF, 'float');
        $INVT = $array[12]; // Inverter temperature - n/a for SMA inverters
        settype($INVT, 'float');
        $BOOT = $array[13]; // Booster temperature - n/a for SMA inverters
        settype($BOOT, 'float');
        $KWHT = $array[14]; // Metering.TotWhOut (kWh)
        settype($KWHT, 'float');
        $I1V = $array[15]; // DcMs.Vol[A]
        settype($I1V, 'float');
        $I1A = $array[16]; // DcMs.Amp[A]
        settype($I1A, 'float');
        $I1P = $array[17]; // DcMs.Watt[A]
        settype($I1P, 'float');
        $I2V = $array[18]; // DcMs.Vol[B]
        settype($I2V, 'float');
        $I2A = $array[19]; // DcMs.Amp[B]
        settype($I2A, 'float');
        $I2P = $array[20]; // DcMs.Watt[B]
        settype($I2P, 'float');
        $I3V = null;
        $I3A = null;
        $I3P = null;
        $I4V = null;
        $I4A = null;
        $I4P = null;
        $RET = 'OK';
    } else {
        $RET = 'NOK';
    }
    
} else {
    $RET = 'NOK';
}
?>
Last edited by Cosmo Kramer on Sun Aug 02, 2015 4:59 pm, edited 1 time in total.

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

Re: SMA Communication error at Communication-Test

Post by jeanmarc » Sun Aug 02, 2015 4:56 pm

Change $cfgdir = '/config'; to your full path /srv/http/123solar/config.
Also type in a terminal php /srv/http/123solar/scripts/protocols/test.php

Cosmo Kramer
Posts: 13
Joined: Fri Jul 31, 2015 11:47 am

Re: SMA Communication error at Communication-Test

Post by Cosmo Kramer » Sun Aug 02, 2015 5:01 pm

I have changed the config path here is the request:

Sun Aug 2 18:28:54 2015: INFO: Starting...
timeout --kill-after=10s 5s /usr/local/bin/sbfspot.3/SBFspot -finq -d5 -v5 -123s=DATA -cfg/var/www/123solar/config/SBFspot_1.cfg return : Sun Aug 2 18:28:54 2015: INFO: Starting...

error : /

and on Terminal the answer is:

Starting

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest