Page 19 of 21

Re: meterN 0.8

Posted: Mon Sep 25, 2017 7:15 pm
by Garluk
JM, I report a bug.

If you add a meter I receive this notice in event windows:

Code: Select all

PHP Notice:  Undefined offset: 10 in /var/www/metern/scripts/metern.php on line 228
This message is due to absence of the meter's column value in the first line of the today csv file.
You can easily fix this bug.
Just replace line 228 in metern/scripts/metern.php

Code: Select all

$val_first = trim($array[$i]);
with

Code: Select all

if ($i <= $NUMMETER) {
	$val_first = trim($array[$i]);
} else {
	$val_first = 0;
}
Thanks

Re: meterN 0.8

Posted: Mon Sep 25, 2017 8:25 pm
by jeanmarc
Thanks, i guess isset is more cute

Code: Select all

                    if (!$msgflag) {
                        $val_last  = null;
                        $val_first = null;
                        $array     = preg_split('/,/', $lines[1]);
                        if (isset($array[$i])) {
                            $val_first = trim($array[$i]);
                            settype($val_first, 'float');
                        }
                        $array = preg_split('/,/', $lines[$contalines - 1]);
                        if (isset($array[$i])) {
                            $val_last = trim($array[$i]);
                            settype($val_last, 'float');
                        }
                        
                        if (!empty($val_first) && !empty($val_last) && ${'TYPE' . $i} != 'Sensor') { // Meter
                            if ($val_first <= $val_last) {
                                $val_last -= $val_first;
                            } else { // counter pass over
                                $val_last += ${'PASSO' . $i} - $val_first;
                            }
                        }
                        ...

Re: meterN 0.8

Posted: Mon Sep 25, 2017 9:28 pm
by Garluk
Great!

Re: meterN 0.8

Posted: Fri Nov 24, 2017 7:40 pm
by TonyP62
Thanks Jean-Marc for the RpiNotify . It is a very good and great idea.

Re: meterN 0.8

Posted: Sun Dec 03, 2017 10:45 am
by jeanmarc
Hello,

It's been awhile ! meterN0.8.5 is out :

- You can set the graphics's height in layout configuration
- You also have to set a gauge min and max
- Some minors fixes
- Updated to Highcharts 6

This release will allow to test the one click update (if you come from 0.8.4)

Cheers

Re: meterN 0.8

Posted: Mon Dec 04, 2017 3:37 am
by NevD
I am on 0.8.4 tried update says did not complete....


ERROR: mv /var/www/metern/ /var/www/metern.20171204/

The update didn't complete as expected !

CURDIR: /var/www/metern
SRVDIR: /var/www
SELFDIR: /metern/admin

What do I need to check ???

Nev

Re: meterN 0.8

Posted: Mon Dec 04, 2017 3:55 am
by NevD
OK it did not create the dir needed to move files permissions were 755, changed to 777 and dir created and update completed, using 250px and a scale of -3600 to 15000...

All looks good

Nev

Re: meterN 0.8

Posted: Mon Dec 04, 2017 11:55 am
by flane
I upgraded from version 0.8.4 to 0.8.5.
Everything OK, no problem.
The one click update works very well. :D

Thanks JeanMarc, as always ..... a great job. :D

Re: meterN 0.8

Posted: Mon Dec 04, 2017 9:33 pm
by acfnews
NevD wrote: Mon Dec 04, 2017 3:55 am OK it did not create the dir needed to move files permissions were 755, changed to 777 and dir created and update completed, using 250px and a scale of -3600 to 15000...

All looks good

Nev
Nev,

I had the same issue, but settings the permissions towards 777 is a bit wide.
I fixed it by settings the main directory where 123solar and metern are to owner www-data (isof root:):

Code: Select all

root@raspberry_mk:/usr/share/nginx# ls -ald www/
drwxr-xr-x 9 www-data www-data 148 Dec  4 21:17 www/

Re: meterN 0.8

Posted: Tue Dec 05, 2017 6:59 am
by jeanmarc
Hi,
Did you put the archive on your web server's folder to extract (tar -xzvf metern*.tar.gz) or extract on a computer then copy the mN's folder ?