meterN 0.8

Talks about metering
jeanmarc
Posts: 1767
Joined: Thu Aug 29, 2013 7:16 am

Re: meterN 0.8

Post by jeanmarc » Wed Dec 09, 2015 7:43 am

I will work on it

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

Re: meterN 0.8

Post by thedrake » Thu Dec 10, 2015 11:00 pm

Hi jeanmarc,
sorry for bothering you again... :?

Am I wrong if I still see a small glitch in bootmn.php regarding metern.err file path? :?:

Code: Select all

  $SCRDIR = dirname(__FILE__);

  $output = exec('pkill -f metern.php> /dev/null 2>&1 &'); //make sure there is only one instance
  usleep(500000);

  $now    = date($DATEFORMAT . ' H:i:s');
  $stringData = "$now\tStarting meterN on boot\n\n";

  if ($DEBUG) {
-     $myFile = dirname($SCRDIR) . '/metern.err';
+     $myFile = dirname($SCRDIR) . '/data/metern.err';
      file_put_contents($myFile, $stringData, FILE_APPEND);
-     $output = exec('php metern.php >> metern.err 2>&1 &');
+     $output = exec('php metern.php >> ../data/metern.err 2>&1 &');
  } else {
      $output = exec('php metern.php > /dev/null 2>&1 &');
  }
/drk

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

Re: meterN 0.8

Post by jeanmarc » Fri Dec 11, 2015 7:17 am

Hi drake,
No worry ;) Yes i've correct that.

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

Todays readings

Post by thedrake » Sun Dec 20, 2015 12:00 am

Hi jeanmarc,
there is a glitch in code for today readings in file programs/programreadings.php.

Line 77 says:

Code: Select all

$met        = substr($meter, 0, 1);
But it should be something like:

Code: Select all

$met        = substr($meter, 0);
If not, every meternum > 9 will get readings from meternum=1 (if max metnum <=19). ;) :D

/drk

P.S.: Will we be able to hide meter graphs in homepage without dismissing them, in next version? :)

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

Re: meterN 0.8

Post by jeanmarc » Sun Dec 20, 2015 4:23 pm

Hi,
Thanks. Yes, it is done. I am off for few days, i want to update the code for Highcharts 4.2 before making a new release.

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

Re: meterN 0.8

Post by jeanmarc » Wed Jan 06, 2016 10:00 am

Hello,

meterN0.8.2 is out.

- Main page: Set graph to 0 to hide
- Updted js libs and code for php 7
- Few bugs corrected

Bye

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

Re: meterN 0.8

Post by sovking » Thu Jan 07, 2016 12:47 pm

Minor bug in still in 0.8.2
In scripts/metern.php around line 174:

Code: Select all

                         // Reports
                         if (${'REPORT' . $i} == 'daily') { // Daily
-                            $month = (int) substr($csvdate1, 0, 2);
-                            $day   = (int) substr($csvdate1, 2, 2);
+                            $month = (int) substr($csvdate1, 4, 2);
+                            $day   = (int) substr($csvdate1, 6, 2);
                             $adate = date($DATEFORMAT, mktime(0, 0, 0, $month, $day, $year));
This bug happen only when you activate daily reports.

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

meters reading small improvement

Post by thedrake » Thu Jan 14, 2016 11:49 am

Hi Jeanmarc,

what about a placeholder for meter command string to pass current meter ID? It should be simpler/cleaner to call parametric scripts for meter readings (hopely less error prone).

E.g.:

Old stile energy Command

Code: Select all

egrep "^12_IE\(" /run/shm/metern-energy.txt
Proposed new stile energy Command

Code: Select all

readmyelectrmeter %ID energy
/drk

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

Re: meterN 0.8

Post by jeanmarc » Thu Jan 14, 2016 1:09 pm

Hi Drk,
Can't you make a simple script that does the egrep job ? ;)
Personally, i don't use a daemon anymore and i make a request for each pooling (eg sdm120cdrk -a1 -b9600 -2 -m -i /dev/sdm). I didn't notice any slowdown, it avoid getting wrong values and if there is a problem, it won't retrieve outdated values ..

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

Re: meterN 0.8

Post by thedrake » Thu Jan 14, 2016 1:38 pm

jeanmarc wrote:Hi Drk,
Can't you make a simple script that does the egrep job ? ;)
Personally, i don't use a daemon anymore and i make a request for each pooling (eg sdm120cdrk -a1 -b9600 -2 -m -i /dev/sdm). I didn't notice any slowdown, it avoid getting wrong values and if there is a problem, it won't retrieve outdated values ..
Yes! A simple script with egrep i's what I want to do, but I would like to write a parametric script for reading "sdm120c like" meter. It's always the same egrep line with only ID changing and ID is tied with meter config ID field anyway. ;) A simple script will help less expert people to have less problems during install/config.

About direct reading, you know, I modified sdm120c exactly for reading directly values and I know it works for sure! ... 8-)

My thoughts were that metern was intended for it (direct reading), but I then changed my mind about reading meters in sequence because I would like readings from them to be done (almost) at the same time. If you have different meters on different 485 lines is quite possible, if you have a single line for more meters, a small delay will be induced by lock queue. (see here for the script I'm using now if you like italian ;) ).

About ID parameter placeholder, I think it's not a bad idea, but you already know that we would live without it too... ;)

/drk

Locked

Who is online

Users browsing this forum: No registered users and 1 guest