123solar 1.6.7

Talks about solar stuff
Locked
jeanmarc
Posts: 1917
Joined: Thu Aug 29, 2013 7:16 am

123solar 1.6.7

Post by jeanmarc » Thu Aug 27, 2015 5:11 pm

Hello,

123solar 1.6.7 is out, on a rainy summer day. Here's the change log :

- Production is rewrited to allow a 3 deepth drilldown (Years/Months/Days)
- Merged all mono/multi inverter(s) code
- Multi inverter production is now stacked on front page
- Revoke the "feeding" code
- Updated JS lib

Overhall, the code is much clean and simple
Cheers

sovking
Posts: 80
Joined: Fri Feb 27, 2015 12:02 am

Re: 123solar 1.6.7

Post by sovking » Fri Aug 28, 2015 1:02 am

Just installed and using: found the following errors:

1) in detailed.php at line 497 the action link to the old script name:

Code: Select all

<FORM method='POST' action='indexdetailed.php' name='chooseDateForm' id='chooseDateForm' action='#>'
should be:

Code: Select all

<FORM method='POST' action='detailed.php' name='chooseDateForm' id='chooseDateForm' action='#'>
Similar errors are in the FORM of the following files: comparison.php, production.php.

2) in production.php at line 225 the line:

Code: Select all

if ($cnt > 1) {
I think should be replaced with

Code: Select all

if ($cnt > 0) {
to take into account who has only one year of production, else it will return no data.

3) the montly production does not show anymore the expected production, I really miss it :(

4) A minor flaw, when you look at daily history production, howering over columns it show a box containing daily production, efficency and "click for details", but there is nothing to click and no other details available.. so you can remove "click for details" or point it to the corrisponding daily details offered by detailed.php, at the same manner offered by index.php in the right bottom of the page (here should be present click for details hovering the last XY days columns).

Thanks for your work!!

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

Re: 123solar 1.6.7

Post by jeanmarc » Fri Aug 28, 2015 6:02 am

Hi sovking,
Thanks indeed for your remarks. I've rename the indexes pages on the last minute, i've repack the 1.6.7..
3) It's the comparison job. You can still use the old indexproduction ;)
4) Ok

sovking
Posts: 80
Joined: Fri Feb 27, 2015 12:02 am

Re: 123solar 1.6.7

Post by sovking » Fri Aug 28, 2015 4:12 pm

Thanks!
I think that when you repack, even for minor glitches, you should increase minor version number (1.6.7 to 1.6.7.1) to warning users that some fixes/changement is present. Otherwise someone could stick with the previuos downloaded versions and wondering about these errors.

acfnews
Posts: 35
Joined: Mon Jan 05, 2015 6:58 pm

Re: 123solar 1.6.7

Post by acfnews » Fri Aug 28, 2015 9:33 pm

Jean-Marc,

1)
During the upgrade process i stumbled upon some typo’s on the FAQ website.
Maybe you want to replace the word ‘repertories’ into 'directories’, it on multiple places in the website...
ie: http://www.123solar.org/help.html

2)
For some reason my 1.6.6 solarlog seems to have a gap in the data shown in the period of version 1.6.6 (production tab), it seems the files in the production folder did have wrong permissions (root) since i upgraded 10 May :

root@raspberrypi:/usr/share/nginx/www/123solar_backup/data/invt1/production# ls -al
total 33
drwxr-xr-x 2 www-data www-data 1024 May 11 22:11 .
drwxr-xr-x 7 www-data www-data 1024 May 11 22:10 ..
-rw-r--r-- 1 root root 4470 May 11 22:11 energy2010.csv
-rw-r--r-- 1 root root 5446 May 11 22:11 energy2011.csv
-rw-r--r-- 1 root root 5413 May 11 22:11 energy2012.csv
-rw-r--r-- 1 root root 5265 May 11 22:11 energy2013.csv
-rw-r--r-- 1 root root 5406 May 11 22:11 energy2014.csv
-rw-r--r-- 1 root root 2034 May 11 22:11 energy2015.csv
root@raspberrypi:/usr/share/nginx/www/123solar_backup/data/invt1/production# tail energy2015.csv
==> energy2015.csv <==
20150501,8.119
20150502,8.322
20150503,2.163
20150504,6.584
20150505,6.973
20150506,5.363
20150507,8.374
20150508,5.728
20150509,4.554
20150510,7.53
root@raspberrypi:/usr/share/nginx/www/123solar_backup/data/invt1/production#




After correcting the permissions, is there a way to have the old data re-read by 123solar, and fill the gaps in the energy2015 file ?



Many thanks for the new version and your work !

ron

acfnews
Posts: 35
Joined: Mon Jan 05, 2015 6:58 pm

Re: 123solar 1.6.7

Post by acfnews » Fri Aug 28, 2015 11:40 pm

JeanMarc,

I fixed my missing data, by gathering the old measures from the daily files and inserting them in the energy2015.csv file.
It took me some time to get it correct, below example for 1 month:

Code: Select all

cd /usr/share/nginx/www/123solar/data/invt1/csv

for file in 201505*.csv
do
 echo -n $file,
 tac $file | 
 awk 'NR==1{print}{last = this; this = $0} END {print last}' | 
 awk -F"," {'print $NF'} | 
 awk 'NR==1{s=$1;next}{s-=$1}END{print s}' 
done >> /usr/share/nginx/www/123solar/data/invt1/production/energy2015.csv
And finally a replace of the words ' .csv' in energy2015.csv with ':%s/\.csv//'

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

Re: 123solar 1.6.7

Post by jeanmarc » Sat Aug 29, 2015 7:18 am

Hi Ron,
1) Corrected. Repertories sound like Directories in french ;)
2) Your script import production from daily csv ? It is neat :)

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

Re: 123solar 1.6.7

Post by jeanmarc » Mon Aug 31, 2015 8:12 pm

Hi,
I release the 1.6.7.1, some minor update :

- Gauges don't go off boundary
- Main gauge in multi
- Multi-inverter day graph feeding bug corrected
- Day graph: One scatter point if latest value is the higher
..

Bye

thedrake
Posts: 52
Joined: Fri Aug 21, 2015 12:43 pm

Re: 123solar 1.6.7

Post by thedrake » Fri Sep 04, 2015 11:52 pm

Hi Jeanmark,

I suggest to modify protocols scripts reading from inverters for a really tmp de.err location. They actually stress quite a lot microSD of RPI continuously writing temporary de.err file in data directory if debug is on. They should only copy de.err if a communication error is catched.

Here how I modified my 1.6.6.3 version scripts/protocols/aurora.php. :mrgreen:

Diff

Code: Select all

--- aurora.old.php      2015-06-16 13:53:28.000000000 +0200
+++ aurora.new.php      2015-09-04 14:07:21.307419478 +0200
@@ -5,16 +5,18 @@
 // For Aurora http://www.curtronics.com/Solar
 $CMD_RETURN = ''; // Always initialize the return string, it should always be named $CMD_RETURN to allow 'Communication Error' test

+$TEMPDIR = '/tmp';     // Do not stress datadir for tmp files
+
 if (!${'PHASE' . $invt_num}) { // Monophased
     if ($DEBUG) {
-        $CMD_POOLING = "aurora -b -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e ${'PORT'.$invt_num} 2> $DATADIR/errors/de.err";
+        $CMD_POOLING = "aurora -b -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e ${'PORT'.$invt_num} 2> $TEMPDIR/de.err";
     } else {
         $CMD_POOLING = "aurora -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e ${'PORT'.$invt_num}";
     }
     $ok = 21;
 } else { // Triphased
     if ($DEBUG) {
-        $CMD_POOLING = "aurora -b -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e -3 ${'PORT'.$invt_num} 2> $DATADIR/errors/de.err";
+        $CMD_POOLING = "aurora -b -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e -3 ${'PORT'.$invt_num} 2> $TEMPDIR/de.err";
     } else {
         $CMD_POOLING = "aurora -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e -3 ${'PORT'.$invt_num}";
     }
@@ -109,7 +111,7 @@
     $RET = 'NOK';
     if ($DEBUG) {
         $time = date('Ymd-H:i:s');
-        exec('cp ' . $DATADIR . '/errors/de.err ' . $DATADIR . '/errors/de' . $time . '.err');
+        exec('cp ' . $TEMPDIR . '/de.err ' . $DATADIR . '/errors/de' . $time . '.err');
     }
 }
 ?>
scripts/protocols/aurora.php

Code: Select all

<?php
if (!defined('checkaccess')) {
    die('Direct access not permitted');
}
// For Aurora http://www.curtronics.com/Solar
$CMD_RETURN = ''; // Always initialize the return string, it should always be named $CMD_RETURN to allow 'Communication Error' test

$TEMPDIR = '/tmp';	// Do not stress datadir for tmp files

if (!${'PHASE' . $invt_num}) { // Monophased
    if ($DEBUG) {
        $CMD_POOLING = "aurora -b -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e ${'PORT'.$invt_num} 2> $TEMPDIR/de.err";
    } else {
        $CMD_POOLING = "aurora -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e ${'PORT'.$invt_num}";
    }
    $ok = 21;
} else { // Triphased
    if ($DEBUG) {
        $CMD_POOLING = "aurora -b -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e -3 ${'PORT'.$invt_num} 2> $TEMPDIR/de.err";
    } else {
        $CMD_POOLING = "aurora -a ${'ADR'.$invt_num} -c -T ${'COMOPTION'.$invt_num} -d0 -e -3 ${'PORT'.$invt_num}";
    }
    $ok = 31;
}
$dataarray = array();

$CMD_RETURN = exec($CMD_POOLING);
$dataarray  = preg_split('/[[:space:]]+/', $CMD_RETURN);

if (!isset($dataarray[$ok])) {
    $dataarray[$ok] = 'NOK';
}

if ($dataarray[$ok] == 'OK') {
    $SDTE = $dataarray[0];
    $I1V  = $dataarray[1];
    settype($I1V, 'float');
    $I1A = $dataarray[2];
    settype($I1A, 'float');
    $I1P = $dataarray[3];
    settype($I1P, 'float');
    $I2V = $dataarray[4];
    settype($I2V, 'float');
    $I2A = $dataarray[5];
    settype($I2A, 'float');
    $I2P = $dataarray[6];
    settype($I2P, 'float');
    $FRQ = $dataarray[10];
    settype($FRQ, 'float');
    $EFF = $dataarray[11];
    settype($EFF, 'float');
    $INVT = $dataarray[12];
    settype($INVT, 'float');
    $BOOT = $dataarray[13];
    settype($BOOT, 'float');
    $KWHT = $dataarray[19];
    settype($KWHT, 'float');
    
    if (!${'PHASE' . $invt_num}) {
        $G1V = $dataarray[7];
        settype($G1V, 'float');
        $G1A = $dataarray[8];
        settype($G1A, 'float');
        $G1P = $dataarray[9];
        settype($G1P, 'float');
        $I3V = null;
        $I3A = null;
        $I3P = null;
        $I4V = null;
        $I4A = null;
        $I4P = null;
        $G2V = null;
        $G2A = null;
        $G2P = null;
        $G3V = null;
        $G3A = null;
        $G3P = null;
    } else {
        $I3V = null;
        $I3A = null;
        $I3P = null;
        $I4V = null;
        $I4A = null;
        $I4P = null;
        $G1V = $dataarray[22];
        settype($G1V, 'float');
        $G1A = $dataarray[25];
        settype($G1A, 'float');
        $G1P = round(($G1V * $G1A), 3);
        settype($G1P, 'float');
        $G2V = $dataarray[23];
        settype($G2V, 'float');
        $G2A = $dataarray[26];
        settype($G2A, 'float');
        $G2P = round(($G2V * $G2A), 3);
        settype($G2P, 'float');
        $G3V = $dataarray[24];
        settype($G3V, 'float');
        $G3A = $dataarray[27];
        settype($G3A, 'float');
        $G3P = round(($G3V * $G3A), 3);
        settype($G3P, 'float');
    }
    
    if ($FRQ > 0) { // Avoid null values at early startup
        $RET = 'OK';
    } else {
        $RET = 'NOK';
    }
} else {
    $RET = 'NOK';
    if ($DEBUG) {
        $time = date('Ymd-H:i:s');
        exec('cp ' . $TEMPDIR . '/de.err ' . $DATADIR . '/errors/de' . $time . '.err');
    }
}
?>

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

Re: 123solar 1.6.7

Post by jeanmarc » Sat Sep 05, 2015 4:35 am

Hello,
Good idea, (as long as /tmp is a ramdisk) i have change it. Thanks

Locked

Who is online

Users browsing this forum: No registered users and 4 guests