OklahomaGreyBeard / eversolar-monitor

Automatically exported from code.google.com/p/eversolar-monitor
0 stars 0 forks source link

Output seems incorrect #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Installed per instructions

What is the expected output? What do you see instead?
Look for "CR750" on pvoutput.org.

SQLite database dump, fields seem wrong -
EL50000101420020|2014-08-04 
17:45:43|2503|9.75|6553.5|122.5|8.1|0.0|0.0|0.06|5000.0|2216.0|0|5.0|5.0|5.0
EL50000101420020|2014-08-04 
17:45:55|2519|9.75|6553.5|120.0|8.1|0.0|0.0|0.06|5002.0|2216.0|0|5.0|5.0|5.0
EL50000101420020|2014-08-04 
17:46:06|2511|9.75|6553.5|117.1|8.0|0.0|0.0|0.06|4999.0|2216.0|0|5.0|5.0|5.0
EL50000101420020|2014-08-04 
17:46:19|0|9.75|6553.5|113.9|7.9|0.0|0.0|0.0|0.0|2216.0|0|5.0|5.0|5.0
EL50000101420020|2014-08-04 
17:46:30|0|9.75|6553.5|110.9|8.9|0.0|0.0|0.0|0.0|2216.0|0|5.0|5.0|5.0
EL50000101420020|2014-08-04 
17:46:41|0|9.75|6553.5|108.0|9.3|0.0|0.0|0.0|0.0|2216.0|0|4.7|4.7|4.7

What version of the product are you using? On what operating system?
Centos 6.
Latest version of eversolar.pl from Google Code

Please provide any additional information below.
Eversolar protocol doc does not seem to match the perl code

Original issue reported on code.google.com by phill.gl...@bigpond.com on 4 Aug 2014 at 9:56

GoogleCodeExporter commented 8 years ago
This may be related to the sum of inverters issue also reported.

The code has 
my $e_total = $data[$DATA_BYTES{'E_TOTAL'}]/10;

So the returned number is 65535... that is the maximum number you can get with 
16 bits. I think it is safe to assume, that we run into that limitation either 
due to the protocol running out of space or some bug in the perl script. 

Can you try and enable logging and see if you can provide me with a package to 
look at?

My inverters are currently about a year from crossing that performance 
treshold, and testing is restricted to weekends due to the northern 
placement/work hours, so any help would be appreciated.

Henrik

Original comment by henrik.m...@gmail.com on 19 Nov 2014 at 6:06

GoogleCodeExporter commented 8 years ago
Ok, I found the issue in the documentation from Eversolar.. I think!

We read out the strings of the inverters with this code snippet
f($config->options_strings == 1) {
    %DATA_BYTES = (
        "TEMP"        => 0,
        "E_TODAY"     => 1,
        "VPV"         => 2,
        "IPV"         => 3,
        "IAC"         => 4,
        "VAC"         => 5,
        "FREQUENCY"   => 6,
        "PAC"         => 7,
        "IMPEDANCE"   => 8,
        "NA_1"        => 9,
        "E_TOTAL"     => 10,
        "NA_2"        => 11,
        "HOURS_UP"    => 12,
        "OP_MODE"     => 13
    );
} elsif($config->options_strings == 2) {
    %DATA_BYTES = (    
        "TEMP"          => 0,
        "E_TODAY"       => 1,
        "VPV"           => 2,
        "VPV2"          => 3,
        "IPV"           => 4,
        "IPV2"          => 5,
        "IAC"           => 6,
        "VAC"           => 7,
        "FREQUENCY"     => 8,
        "PAC"           => 9,
        "NA_0"          => 10,
        "NA_1"          => 11,
        "E_TOTAL"       => 12,
        "NA_2"          => 13,
        "HOURS_UP"      => 14,
        "OP_MODE"       => 15
    );

All data is read as two byte sections, so we need to find both the E-Total H 
byteset and the E-Total L byteset

I am a bit lost, as the 0x11, 0x02 read query in section 3.2.1 in the protocol 
documentation specifies this order : Temperature, Vpv1, Vpv2, but our read 
takes E_today as second item... But the documentation has the lower and upper 
double bytes of total production as neighbours so it should be simple to dig 
out.

We need to look at the bitstream returned from your inverter - what inverter is 
it / how many strings? NA_1 or NA_2 in the response will probably contain the 
missing bit of produced power, so we should modify this part of the code for 
debugging purposes:

   my $e_today_kwh = $data[$DATA_BYTES{'E_TODAY'}]/100;
            my $e_today_wh = $e_today_kwh * 1000;
            my $e_total = $data[$DATA_BYTES{'E_TOTAL'}]/10;

Add the following lines:
 print "NA1 $data[$DATA_BYTES{'NA_1'}] \n"
 print "NA2 $data[$DATA_BYTES{'NA_2'}] \n"

Let me know what you get from this. I live so far north, that I still have no 
sunlight outside working hours, so the above is not tested here yet. I expect 
to get a nice couple of zeros, and you should get a '1' as NA1 or NA2

Henrik

Original comment by henrik.m...@gmail.com on 21 Jan 2015 at 7:55

GoogleCodeExporter commented 8 years ago
Issue 7 has been merged into this issue.

Original comment by henrik.m...@gmail.com on 22 Jan 2015 at 7:45

GoogleCodeExporter commented 8 years ago
I had to add a semi colon to the end of those extra lines ;)

Here's the output (The first inverter to link up is the one with > 6553.5 kWh 
on it i.e the 2102.3 should be 8655.8 kWh)

I hope it helps, Steve.

2015-01-23 09:57:33: Severity 3, No response to 'offline query' request - no 
offline inverters
sending packet to inverter...
aa 55 01 00 00 10 11 02 00 01 23
received packet from inverter:
aa 55 00 10 01 00 11 82 2c 01 5d 00 48 0b db 00 0a
00 0b 09 b5 13 84 01 11 ff ff 00 01 52 1f 00 00 3b
b3 00 01 00 00 00 00 ff ff 00 00 00 00 00 00 00 00
00 00 0a 34
NA1 1
NA2 0
2015-01-23 09:57:35: Severity 3, 8881500A11200910 output: 273 W, Total: 2102.3 
kWh, Today: 0.72 kWh
sending packet to inverter...
aa 55 01 00 00 11 11 02 00 01 24
received packet from inverter:
aa 55 00 11 01 00 11 82 2c 01 5c 00 44 0b 5e 00 09
00 09 09 b8 13 80 00 ee ff ff 00 00 87 c7 00 00 18
a6 00 01 00 00 00 00 ff ff 00 00 00 00 00 00 00 00
00 00 0b 37
NA1 0
NA2 0
2015-01-23 09:57:37: Severity 3, B881500A12980009 output: 238 W, Total: 3475.9 
kWh, Today: 0.68 kWh

Original comment by wot...@gmail.com on 22 Jan 2015 at 11:03

GoogleCodeExporter commented 8 years ago
It looks like we found the culprit. I'll try having this confirmed, but it'll 
take some time. If your outputs are consistent, then you can add 
6553,5*$data[$DATA_BYTES{'NA_1'}] to the line 

my $e_total = $data[$DATA_BYTES{'E_TOTAL'}]/10

Sorry about the missing semicolons

Henrik

Original comment by henrik.m...@gmail.com on 23 Jan 2015 at 5:01

GoogleCodeExporter commented 8 years ago
Hi Henrik,

What will the end result of the line look like once altered?

Thanks,

Steve.

Original comment by wot...@gmail.com on 23 Jan 2015 at 5:13

GoogleCodeExporter commented 8 years ago
That'll be

my $e_total = $data[$DATA_BYTES{'E_TOTAL'}]/10 
+$data[$DATA_BYTES{'NA_1'}]*65535/10;

Henrik

Original comment by henrik.m...@gmail.com on 23 Jan 2015 at 5:24

GoogleCodeExporter commented 8 years ago
There is a similar bug in total hours, we'll probably get the high bits from 
NA_2

Henrik

Original comment by henrik.m...@gmail.com on 23 Jan 2015 at 5:26

GoogleCodeExporter commented 8 years ago
Thanks again.

Looks good. It'll be a while before I get to 65532 hours though :)

ID string   1 1500E1.00 TL1500 AS Ever-Solar 8881500A112009103600 V 00009-05    
Serial number   8881500A11200910    
Total uptime    15290 hours 
Total energy    8663.2kwh   
Operation mode  1   
Inverter temperature    42.6C   
Updated 2015-01-23 16:31:28 
Connect time    2015-01-23 16:30:58

Original comment by wot...@gmail.com on 23 Jan 2015 at 5:34

GoogleCodeExporter commented 8 years ago
Updated eversolar.pl with code and comments

Original comment by henrik.m...@gmail.com on 31 Jan 2015 at 12:20