rklogger problem in the Version : 123Solar 1.6.5.3.2

others protocols
xsherlock
Posts: 7
Joined: Wed May 21, 2014 10:31 am

rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by xsherlock » Wed May 21, 2014 3:30 pm

Hi,
I have almost everything up and probably some minor glitch is stoping me from getting the logger to work correctly.

First of if I select rklogger as the protocol script 123solar will not start properly crashing on the rklogger_checks.php

21/05/2014 16:04:50 Starting 123Solar
PHP Parse error: syntax error, unexpected '$PPEAKOTD' (T_VARIABLE) in /var/www/123solar/scripts/protocols/rklogger_checks.php on line 8

I looked into the file and it is dead simple, but since I dont have php skils i can't fix it.
Empting the file makes 123solar start but still i do not get the results and the index page is stuck on 01/01/1970 for some reason. In the debug field however I can see that rkloger does run periodicaly since live memory does have proper values that change periodicaly.


Live Memory (#524)
Array ( [SDTE1] => 1400682527 [I1V1] => 514.5 [I1A1] => 0.757 [I1P1] => 394 [I2V1] => 0 [I2A1] => 0 [I2P1] => 0 [I3V1] => [I3A1] => [I3P1] => [I4V1] => [I4A1] => [I4P1] => [G1V1] => 231 [G1A1] => 0.822 [G1P1] => 384 [G2V1] => [G2A1] => [G2P1] => [G3V1] => [G3A1] => [G3P1] => [FRQ1] => 49.996 [EFF1] => 0 [INVT1] => 129 [BOOT1] => 125 [SSR1] => [KWHT1] => 21548 )

xsherlock
Posts: 7
Joined: Wed May 21, 2014 10:31 am

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by xsherlock » Wed May 21, 2014 3:55 pm

ok solved the problem with rklogger_checks.php there is lacking ; in the line 7 !!!!!!!!!!!!!

Still that does not explain why my main index page is stuck on the 01/01/1970 !!!
While the DB is populating as I can see proper graphs in the details page.

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

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by jeanmarc » Wed May 21, 2014 5:16 pm

Thanks for the notification, i corrected line 7.
Check your computer date and timezone.

xsherlock
Posts: 7
Joined: Wed May 21, 2014 10:31 am

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by xsherlock » Wed May 21, 2014 5:44 pm

Date is fine, and the main page started after a while, i think that was after i did run by hand :
/usr/bin/curl http://localhost/123solar/scripts/boot123s.php
not sure about that.

Now It works and i have today on the main page but the total produced amount of energy is insane (650 kwh and rising every couple of minutes by 15 -20 kwh ) also the main graph is maxed out

Update: they are actually 1000x to big !!! but just on the front page, there must be an error in the rklogger.php, but where?


I checked the CSV and the values recorded are fine. Where is production up to now daily taken from?
On the details page all the parameters recorded today are fine.

Update
!!!!!!!!!!!!!!!!!!!!Solved!!!!!!!!!!!!!!!!!
There is a small glitch in the rklogger.php to be fixed.

you need to divide the $KWHT by 1000 as at least in my setup (Danfos TLX) it is returned as integer, similar to the Frequency.

$KWHT = shell_exec("rklogger 1c 4 2 4a 8");
settype($KWHT, 'float');
$KWHT /= 1000;

ginorosi
Posts: 29
Joined: Sun Jun 22, 2014 10:47 pm

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by ginorosi » Sun Jun 22, 2014 10:55 pm

Hello,

after one months of try , I can not run reading a different protocol on a 1.6.5.4 .
I have one Pogoplug E02 at plant , with two Danfoss TLX (3phase) Archlinux and a version 1.5.4.1 with protocol rklogger (Danfoss) and works fine ,
on a Rasp install 1.6.5.4 with Aurora PVI 3.0 and works fine....
I have another Pogoplug where I wanted to install the 1.6.5.4 , works all (convert the data from 1.5 to 1.6 ) i see all data registered with old version , but not working the reading of inverter, attach the protocol working danfoss.php (for monophase 1.5.4.1) and not working danfoss3.php (for 3phase 1.6.5.4) ;
The USB 485 converter work , if i start rklogger "11 1 X XX XX" from terminal the reading is ok ,
if i create a file demo.php (and config the protocol with demo.php) where setting : $I1V = 350.1 , $I1A = 5.5 , etc and at end setting RET = 'OK' ;
the logger working with the value ....

I surrender , not know anymore what to do.

bye thank's

sorry for english , but i'm italian.

this my danfoss.php

Code: Select all

<?php
// ./home/rklogger is a command line program for reading the parameters out of Danfoss inverters.
// http://www.petig.eu/./home/rklogger/
// With the help of Gino Rosi

//$CMD_POOLING = "rklogger 11 $ADR ";

//$COMPOPTION is 11 anyhow

$SDTE = date('Ymd H:i:s');

$a = exec("rklogger 11 $ADR 2 28 8"); 
$I1V = $a/10;

$a = exec("rklogger 11 $ADR 2 2d 8");
$I1A = $a/1000;

$a = exec("rklogger 11 $ADR 2 32 8");
$I1P = $a;

$a = exec("rklogger 11 $ADR 2 29 8");
$I2V = $a/10;

$a = exec("rklogger 11 $ADR 2 2e 8");
$I2A = $a/1000;

$a = exec("rklogger 11 $ADR 2 33 8");
$I2P = $I2V*$I2A;

$a = exec("rklogger 11 $ADR 2 3d 8");
$GV = $a/10;

$a = exec("rklogger 11 $ADR 2 3f 8");
$GA = $a/1000;

$a = exec("rklogger 11 $ADR 2 46 8");
$GP = $a;

$a = exec("rklogger 11 $ADR 2 50 8");
$FRQ = $a/1000;

$EFF = ($GP*100/($I1P+$I2P));

$a = exec("rklogger 11 $ADR 2 53 8");
$INVT = $a;

$a = exec("rklogger 11 $ADR 2 54 8");
$BOOT = $a;

$a = exec("rklogger 11 $ADR 1 2 8");
$KWHT = $a/1000;

$RET = 'OK';

$CMD_INFO = "rklogger 11 $ADR 2 4 8";
$CMD_STATE = exec("rklogger 11 $ADR 0a 2 8");
$CMD_ALARM = exec("rklogger 11 $ADR 0a 28 8");

?>
this the danfoss3.php

Code: Select all

<?php

// ./home/rklogger is a command line program for reading the parameters out of Danfoss inverters.
// http://www.petig.eu/./home/rklogger/
// With the help of Gino Rosi


$SDTE = date('Ymd H:i:s');

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 28 8"); 
$I1V = $a/10;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 2d 8");
$I1A = $a/1000;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 32 8");
$I1P = $a;

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 29 8");
$I2V = $a/10;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 2e 8");
$I2A = $a/1000;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 33 8");
$I2P = $a;

$I3V = null;
$I3A = null;
$I3P = null;
$I4V = null;
$I4A = null;
$I4P = null;

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 3c 8");
$G1V = $a/10;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 3d 8");
$G2V = $a/10;
$c = exec("rklogger 11 ${'ADR'.$invt_num} 2 3e 8");
$G3V = $a/10;

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 3f 8");
$G1A = $a/1000;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 40 8");
$G2A = $a/1000;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 41 8");
$G3A = $a/1000;

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 42 8");
$G1P = $a/1000;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 43 8");
$G2P = $a/1000;
$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 44 8");
$G3P = $a/1000;

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 50 8");
$FRQ = $a/1000;

$EFF = round((($G1P+$G2P+$G3P)/($I1P+$I2P)),3);

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 53 8");
$INVT = $a;

$a = exec("rklogger 11 ${'ADR'.$invt_num} 2 54 8");
$BOOT = $a;

$a = exec("rklogger 11 ${'ADR'.$invt_num} 1 2 8");
$KWHT = $a/1000;

$RET = 'OK';

$CMD_INFO = "rklogger 11 ${'ADR'.$invt_num} 2 4 8";
$CMD_STATE = exec("rklogger 11 ${'ADR'.$invt_num} 0a 2 8");
$CMD_ALARM = exec("rklogger 11 ${'ADR'.$invt_num} 0a 28 8");

?>

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

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by jeanmarc » Mon Jun 23, 2014 8:37 am

Hi Gino,

There have been lots of change since 1.5.x, the main changes for protocols is the triphased support.

You can now see each phase values that's : GxV, GxA and GxP.
See the aurora.php example, if the inverter only support monophased !${'PHASE'.$invt_num} variable, your file need to return G1V, G1A and G1P. On the other hand, if it support triphased it must return up to G3V, G3A, G3P.
There is also support for up to 4 strings (DC) that's I1V, I1A, I1P to I4V, I4A, I4P. It's the ${'STRING'.$invt_num} variable.

The protocol file should be separated in 3: rklogger.php, the main pooling. rklogger_checks.php, that one will be call each x minutes for the Alarms/Warnings and other check things.
And finaly rklogger_startup.php, it is call once a day to sync and to (re)generate the info file.

Now, you need to adapt your rklogger files according to this prerequisites. If you're stuck, enable debug mode. Then start/stop 123s and check what return the errors log. (very informative !)
Also, you may try the 'Test communication' button in administration. Mind that 123s now run as www user, it must have access to your com app and your com port.

Good luck

ginorosi
Posts: 29
Joined: Sun Jun 22, 2014 10:47 pm

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by ginorosi » Mon Jun 23, 2014 1:15 pm

What should return from xxxx_startup?

my danfoss3_startup is this :
<?php
// Info file
$CMD_INFO = "rklogger 11 1 2 4 8";

?>
and return 127 the respond on TLX

If launch Test communication is wait one minute and no return .

But the file danfoss3.php I listing , it's' correct ?

thank's ciao

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

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by jeanmarc » Mon Jun 23, 2014 1:36 pm

_startup should list two commands :

Code: Select all

// Generate the Info text file on daily start-up
$CMD_INFO = "whatever command";
// Sync command on daily start-up
$CMD_SYNC ="whatever command";
Your danfoss3.php seem correct, even though i am not sure of what it output ;)
You may first try it from command line and echo some values. eg add at the end of danfoss3.php

Code: Select all

...
$RET = 'OK';
echo "Total counter $KWHT";
Then in terminal type php danfoss3.php, it should echo Total counter xxx

Now, if all values are ok and your script don't return error. Check it's permission (644) as it will be launched as http user also for rklogger app (a+x), then use the "Test communication" button to see if it's ok.

I find odd that you request rklogger for each values, that's should be really slow ! Check aurora or sma_get, they request once the com app to retrieve all values in a round.

ginorosi
Posts: 29
Joined: Sun Jun 22, 2014 10:47 pm

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by ginorosi » Mon Jun 23, 2014 1:56 pm

Comlynx is slow ( if memories I am the author of danfoss.php ) , with the one phase the time of reading is 6 7 seconds , in 3 phase I think 10" , about 0,2 - 0,3" at command ,

My test :
if , in danfoss3.php replace $ADR(invt_num) with 1 (my address of inverter nr. 1) and launch php danfoss3.php return no error .
If launch direct php 123solar.php no return error , and reading the energy and graph of 5' on web logger and file csv is updated , but all variables inverter is 0 ....

this very trouble for me , is one mounth of test but nothing....

After try again to see permits and launch test comunication and other test to recommendations.

But the rklogger_startup.php of xsherlock where is ?

bye

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

Re: rklogger problem in the Version : 123Solar 1.6.5.3.2

Post by jeanmarc » Mon Jun 23, 2014 2:40 pm

I am not sure i get it :roll: If you use the "Test communication" button all values are null ?
123solar isn't supposed to be launched from the terminal anymore. If you do so, you may encounter some permissions issues in csv !

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests