joba-1 / Joba_ESmart3

Complete control of eSmart3 MPPT solar charge controllers with ESP32 or ESP8266 via RS485
7 stars 2 forks source link

Wrong interpretation of Log Energy values #15

Closed altelch closed 1 year ago

altelch commented 1 year ago

Hi,

in the Read Log struct you defined the energy values as unit32_t but in the documentation it's a struct

typedef struct
{
Uint16 wHi16;
Uint16 wLow16;
}Uint32s;

So the returned values are short-swapped what explains my 65536Wh increments ;-)

Greetings, Heiko.

joba-1 commented 1 year ago

Hm, interesting. Same here. In my doc/ there is only "low words in front, high word after". Do you have a link to your documentation? Maybe there is more interesting stuff I haven't seen yet :)

Anyways, this will change shortly. I'd rather not change the API/structs and just switch the relevant words in the get/set functions. Hope it works out...

Thanks for the hint!

joba-1 commented 1 year ago

Log.dwRunTime seems to never change and I never looked at EngSave. Do you use them and see the same problem?

joba-1 commented 1 year ago

Energy values should be fine now. Published new version 4.1 on PlatformIO

altelch commented 1 year ago

Hi,

this is what I have: https://www.photovoltaikforum.com/core/attachment/79081-esmart3-mppt-solar-controller-communication-protocol-v14-pdf/

RunTime never changes. Noticed that, too. EngSave isn't used by me. So didn't notice. The wrong Log-Values caused interesting solar energy harvest today ;-)

Greetings and Thank you,

        Heiko.
altelch commented 1 year ago

Can confirm, is fixed.

joba-1 commented 1 year ago

ok its the same doc - I just forgot about the code snippets. Thanks for confirming - closing now