123solar with SBFspot - anybody got it working ??

SBFspot protocol http://sbfspot.codeplex.com/
emka
Posts: 16
Joined: Fri Feb 27, 2015 3:04 pm
Location: Amberg, Germany
Contact:

123solar with SBFspot - anybody got it working ??

Post by emka » Fri Feb 27, 2015 3:45 pm

Hi SunnnyLoggers,
I used 123solar with SMAspot 2.06 pretty good running for years - til my HDD crashed :cry:

Now I tried to get it work again with the new SBFspot-Protocol (don't have a copy of the old SMAspot - grrr)

I managed to got a succesful "test connection" with the actual Converter-Data after some kind of adjustments (i.e. changed "SMAspot" to "SBFspot" and toggled the config-path in the script-files).

Unfortunately 123solar won't create any csv-data-file (therefore the date in the Index-site is still 01/01/1970...).

"123 Solar errors log" says:

Code: Select all

27/02/2015 15:20:32	Starting 123Solar

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
 11    62    0     0  100     7      0     11 --:--:-- --:--:-- --:--:--    22
100    62  100    55  100     7     88     11 --:--:-- --:--:-- --:--:--   175
PHP Notice:  Undefined offset: -1 in /var/www/123solar/scripts/123solar.php on line 405
PHP Warning:  file(): Filename cannot be empty in /var/www/123solar/scripts/123solar.php on line 406
These Lines are:

Code: Select all

$option     = $output[$xdays - 1];
$lines      = file($option);
Can I kind of check the values of the variables in the php-files, i.e. print them in an output-file?

Does anybody got 123solar working correctly with the SBFspot-Protocol ??

(SBFspot alone is working perfectly, when manually triggered)

Thanks for helping,
emka

My System:
Raspbian on RaspberryPi B+
SBFspot 3.05 (beta)
SMA SB 4000TL

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

Re: 123solar with SBFspot - anybody got it working ??

Post by jeanmarc » Fri Feb 27, 2015 6:21 pm

Hi,
Which version of 123s did you run previously ?
I believe the protocols file needs to be change a bit into SBFspot, i am awaiting feedback.
bye

emka
Posts: 16
Joined: Fri Feb 27, 2015 3:04 pm
Location: Amberg, Germany
Contact:

Re: 123solar with SBFspot - anybody got it working ??

Post by emka » Fri Feb 27, 2015 7:20 pm

Hi JeanMarc,
found this in my last backup (123solar-Readme.txt):
Version : 1.6.0
Last Update : 02/02/14


When I can help - just let know.

Bye,
Michael

P.S.: logged my "adjustements" in http://kaulbachs.de/joomla3/index.php/a ... n-123solar

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

Re: 123solar with SBFspot - anybody got it working ??

Post by jeanmarc » Fri Feb 27, 2015 8:06 pm

Well since 1.6.5, 123s run on top of the webserver, it might be the problem.
Make sure you read/follow the tips in help section.

emka
Posts: 16
Joined: Fri Feb 27, 2015 3:04 pm
Location: Amberg, Germany
Contact:

Re: 123solar with SBFspot - anybody got it working ??

Post by emka » Sun Mar 01, 2015 3:41 pm

Hi,
of course I've read and followed the ponits in the help/tips-section, also I already searched the forum - and the whole wide www too ;-)
(my PV-Data is collected properly daily at 11:30pm by sbfspot-cronjob)


Here the Infos of my info-/debug-site:

Test communication:
Communication is ok !

Arrays
I1V : 267.08 I1A : 0.437 I1P : 116
I2V : 321.2 I2A : 0.425 I2P : 136
I3V : I3A : I3P :
I4V : I4A : I4P :
Grid
G1V : 228.91 G1A : 1.111 G1P : 253
G2V : 0 G2A : 0 G2P : 0
G3V : 0 G3A : 0 G3P : 0
Inverter
FRQ : 50 EFF : 100.397 INVT : 46.21 BOOT : 0 KWHT : 16000.499



event-protocol

Code: Select all

#1 01/03/2015 15:10:00	Connection lost

#1 01/03/2015 15:10:00 ---

#1 01/03/2015 15:05:00	Connection lost

#1 01/03/2015 15:05:00 ---
...
Hardware and communication apps. rights :
You are using as user : www-data , it belong to those groups: www-data : www-data anze10
Your com. peripheral is on this group :

Checking PHP :
PHP version: 5.4.36-0+deb7u3
Json extension loaded
Calendar extension loaded
Shmop extension loaded
You timezone is set to Europe/Berlin (01/03/2015 15:14:47)
Your sendmail_path is set to /usr/sbin/sendmail -t -i

Checking Software :

Code: Select all

www-data 13303     1  0 Feb27 ?        00:08:58 php ../scripts/123solar.php
www-data 32112 13303  0 15:14 ?        00:00:00 sh -c timeout --kill-after=30s 10s /usr/local/bin/sbfspot.3/SBFspot -finq -d5 -v5 -123s=DATA -cfg/var/www/123solar/config/SBFspot_0.cfg -nosql
www-data 32113 32112  0 15:14 ?        00:00:00 timeout --kill-after=30s 10s /usr/local/bin/sbfspot.3/SBFspot -finq -d5 -v5 -123s=DATA -cfg/var/www/123solar/config/SBFspot_0.cfg -nosql
www-data 32114 32113 30 15:14 ?        00:00:00 /usr/local/bin/sbfspot.3/SBFspot -finq -d5 -v5 -123s=DATA -cfg/var/www/123solar/config/SBFspot_0.cfg -nosql	

Checking PVoutput :
Curl version : curl 7.26.0
curl extension loaded

PVoutput return log :

Code: Select all

#invt1 (10178) 0 Wh 0 W 0 V 0 C

Send for SYSID 10178 : 20150301 15:10 - 0 Wh 0 W 0 V 0 C
PVoutput returned: OK 200: Added Status

Checking communication app :
Current settings are -b -c -T -nosql -d0 -e /dev/ttyUSB0 2> data/errors/de.err

Shared memory : (150104 bytes - 512 kb)
Memory (#321)
Array ( [awake] => 1 [pmotd1] => 0 [pmotdt1] => 1424884160 [pmotdmulti] => 0 [pmotdtmulti] => 1424884160 [invtstat1] => timeout --kill-after=30s 10s /usr/local/bin/sbfspot.3/SBFspot -finq -q -123s=STATE -cfg/var/www/123solar/config/SBFspot_0.cfg -nosql [5minflag1] => [mailq1] => 0 [AWt1] => 1425219000 [AWriso1] => 0 [AWileak1] => 0 [peakotd1] => 0 [peakoat1] => 0 )

Live Memory (#524)
Array ( [SDTE1] => 1425188944 [I1V1] => 0 [I1A1] => 0 [I1P1] => 0 [I2V1] => 0 [I2A1] => 0 [I2P1] => 0 [I3V1] => 0 [I3A1] => 0 [I3P1] => 0 [I4V1] => 0 [I4A1] => 0 [I4P1] => 0 [G1V1] => 0 [G1A1] => 0 [G1P1] => 0 [G2V1] => 0 [G2A1] => 0 [G2P1] => 0 [G3V1] => 0 [G3A1] => 0 [G3P1] => 0 [FRQ1] => 0 [EFF1] => 0 [INVT1] => 0 [BOOT1] => 0 [SSR1] => 0 [KWHT1] => 0 )

Where do the above mentioned com-apps-options -b -c -T -d0 -e /devttyUSB0 come from ?
(I only put -nosql in my Converter-Config)
And where shall the path/file data/errors/de.err be ?
(123solar/data/invt1/errors exists and is empty)

Could it be, that the used paths are not correct ?
Therefore I asked about the possibility to output the used variables to start a logical search for the problem...

Bye, Michael

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

Re: 123solar with SBFspot - anybody got it working ??

Post by jeanmarc » Sun Mar 01, 2015 3:54 pm

Hi,
Well, the "communication app current settings" refered to aurora, i will remove that in the help page.
The communication is ok as i can see. If data are not written it may be because the www-data user don't have access to data/ folder and sub-folders ?

emka
Posts: 16
Joined: Fri Feb 27, 2015 3:04 pm
Location: Amberg, Germany
Contact:

Re: 123solar with SBFspot - anybody got it working ??

Post by emka » Sun Mar 01, 2015 6:49 pm

Hi,
www-data should've all rights:

root@raspbian:/var/www# ls -al
insgesamt 20
drwxr-sr-x 4 www-data www-data 4096 Feb 23 19:51 .
drwxr-xr-x 12 root root 4096 Jan 16 19:20 ..
drwxrwxrwx 11 www-data www-data 4096 Feb 25 18:05 123solar
drwxr-sr-x 13 www-data www-data 4096 Jan 20 08:40 AnzeCloud
-rw-r--r-- 1 www-data www-data 177 Jan 16 19:21 index.html

root@raspbian:/var/www# ls -al 123solar/data/
insgesamt 16
drwxrwxrwx 3 www-data www-data 4096 Feb 24 07:01 .
drwxrwxrwx 11 www-data www-data 4096 Feb 25 18:05 ..
drwxrwxrwx 7 www-data www-data 4096 Feb 23 19:51 invt1
-rw-r--r-- 1 www-data www-data 129 Mär 1 18:01 pvoutput_return.txt


root@raspbian:/var/www# ls -al 123solar/data/invt1/
insgesamt 28
drwxrwxrwx 7 www-data www-data 4096 Feb 23 19:51 .
drwxrwxrwx 3 www-data www-data 4096 Feb 24 07:01 ..
drwxrwxrwx 2 www-data www-data 4096 Aug 2 2014 csv
drwxrwxrwx 2 www-data www-data 4096 Aug 2 2014 errors
drwxrwxrwx 2 www-data www-data 4096 Feb 23 20:02 infos
drwxrwxrwx 2 www-data www-data 4096 Aug 2 2014 mailqueue
drwxrwxrwx 2 www-data www-data 4096 Aug 2 2014 production


But I've tried something else:
On my raspbian, there wasn't the usbutils-package installed ?!?
Now lsusb shows
root@raspbian:/var/www# lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 007: ID 13fd:1840 Initio Corporation Shintaro SH23SDOCK Hard Drive Docker [INIC-1608L]


So I changed the Inverter-Config-Port from /dev/ttyUSB0 to /dev/ttyUSB5 - Test connection is still working... waiting till tomorrow, hoping for the sun shining ;-)

Michael

emka
Posts: 16
Joined: Fri Feb 27, 2015 3:04 pm
Location: Amberg, Germany
Contact:

Re: 123solar with SBFspot - anybody got it working ??

Post by emka » Fri Mar 06, 2015 3:22 pm

Hi,
now I put my user www-data in the uucp-group - with no effects.
Set $SCRDIR = "/var/www/123solar/config"; in the prot-scripts and switched PVoutput to "no" - then coriously my PVoutput-sysid appeared in the error-section:

Code: Select all

PHP Notice:  Undefined offset: 10178 in /var/www/123solar/scripts/123solar.php on line 456
PHP Notice:  Undefined variable: GPtot in /var/www/123solar/scripts/123solar.php on line 457
PHP Notice:  Undefined offset: 10178 in /var/www/123solar/scripts/123solar.php on line 457
PHP Notice:  Undefined offset: 10178 in /var/www/123solar/scripts/123solar.php on line 458
PHP Notice:  Undefined offset: 10178 in /var/www/123solar/scripts/123solar.php on line 461
After setting the variable back to $cfgdir = "/var/www/123solar/config";, the errors deminished to

Code: Select all

PHP Notice:  Undefined offset: 10178 in /var/www/123solar/scripts/123solar.php on line 458
PHP Notice:  Undefined offset: 10178 in /var/www/123solar/scripts/123solar.php on line 461
Now I'm back to the beginning: PVOutput is set "yes", Error-lines again:

Code: Select all

PHP Notice:  Undefined offset: -1 in /var/www/123solar/scripts/123solar.php on line 405
PHP Warning:  file(): Filename cannot be empty in /var/www/123solar/scripts/123solar.php on line 406
I tried to follow your code in 123solar.php

Code: Select all

397	for ($i = 1; $i <= $NUMINV; $i++) {
398                        $sysid = (int) ${'SYSID' . $i};
399                        if (${'PVOUTPUT' . $i} && $memarray['awake'] && !${'SKIPMONITORING' . $invt_num}) {
400                            $dir    = dirname($SCRDIR) . "/data/invt$i/csv/";
401                            $output = array();
402                            $output = glob($dir . '*.csv');
403                            sort($output);
404                            $xdays      = count($output);
405                            $option     = $output[$xdays - 1];
406                            $lines      = file($option);

--> when $output is "-1" --> $xdays has to be "0" --> logical, cause the're no files in $dir.*csv, so count of these files is zero !

I'm back at my first thinking:
Somewhere the variables won't fit with SBFspot - so how can I read the "live"-values of the used variables, echo them in an "output-file", for example.
In the next step I would try to check one after another and file the wrong ones out...

123solar is way damned good logger and I'm not willing admit defeating ;)

Bye,
Michael

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

Re: 123solar with SBFspot - anybody got it working ??

Post by jeanmarc » Fri Mar 06, 2015 3:48 pm

Hi,
Thanks for not giving up ;)
I still believe it is a permission issue, make this scripts/test.php page then request it from your browser

Code: Select all

<?php
$SCRDIR = dirname(__FILE__);
$DATADIR                = dirname($SCRDIR) . "/data/invt1";

$stringData             = "hello\n\n";
file_put_contents($DATADIR . '/test.txt', $stringData);
?>
Does /data/invt1/test.txt say 'hello' ?
btw: The live values are stored in shmop.

emka
Posts: 16
Joined: Fri Feb 27, 2015 3:04 pm
Location: Amberg, Germany
Contact:

Re: 123solar with SBFspot - anybody got it working ??

Post by emka » Fri Mar 06, 2015 4:56 pm

Hi,
/data/invt1/test.txt says "hello" !
Changed datadir to

Code: Select all

$DATADIR                = dirname($SCRDIR) . "/data/invt1/csv";
/data/invt1/csv/test.txt also says "hello" !

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest