Code Monkey home page Code Monkey logo

Comments (9)

hrford avatar hrford commented on July 22, 2024 1
  1. :)
  2. No worries, not confused, just learned you had a different view! So the values (2-byte unsigned int, mutliplied by 100) can represent 0.00 to 655.36 (Some epever kit goes above 655W!). If we were to read back 2000.00W (x100=0x30D40), then H would contain 0x0003 and L would contain 0x0D40. There is no endianess to speak of as that's handled by minimalmodbus. We should just mutliply H by 0x10000, add it to L and divide by any scaling factor (e.g. 100 for power). Unless you mean endianess in that the L register comes before the H register?
  3. Awesome.
  4. 0x3005 is rated current. I used 0x3105 for measured current.

from epevermodbus.

hrford avatar hrford commented on July 22, 2024 1

I just read the docs at https://minimalmodbus.readthedocs.io/en/stable/apiminimalmodbus.html#minimalmodbus.Instrument.read_long, I didn't see that minimalmodus handles multi-register values! Amazing library.

from epevermodbus.

rosswarren avatar rosswarren commented on July 22, 2024 1

Makes sense for that one to be a separate issue yeah!

from epevermodbus.

hrford avatar hrford commented on July 22, 2024 1

ok, I've coded points 1 to 3, just need the sun to be here to start testing it tomorrow. Expect a PR by Monday :D #promises

from epevermodbus.

rosswarren avatar rosswarren commented on July 22, 2024

Hey, thanks for raising the issue.

  1. this was a mistake, good spot.
  2. After reading your comment, I think I had misinterpreted the documentation. I had thought that H and L meant high and low as in a minimum and maximum value received. But actually perhaps it is high and low bits of a single value. In which case we can use the function read_long from minimalmodbus to read a single value across both registers. It would make a lot more sense that way.
    In which case it makes no sense for the library to calculate the power based on voltage and current. Sorry about the confusion there.
  3. We will need to fix the H/L registers here to read as single values. Then it would be great to have the battery power call available.
  4. 0x3005 is rated current, so this is just informational about the max current it can support rather than a real time data value.

I am happy to work on these fixes in a couple of days or otherwise would also be grateful for any PRs.

Just as an example (would need to test further) I think this code

    def get_solar_power_l(self):
        """PV array input power L"""
        return self.retriable_read_register(0x3102, 2, 4)

    def get_solar_power_h(self):
        """PV array input power H"""
        return self.retriable_read_register(0x3103, 2, 4)

would be replaced by something like:

  def get_solar_power(self):
    """PV array input power"""
    return self.retriable_read_long(0x3102, 4, False, minimalmodbus.BYTEORDER_BIG) / 100

I'm not sure about the byte order due to the L and H

from epevermodbus.

rosswarren avatar rosswarren commented on July 22, 2024

Yeah I meant the ordering of the L and H register! But hopefully it "just works" with the read_long method 👍

I see no mention of 0x3105 in the documentation that I have (see attached). Happy to use the register you mention though if it works.

ControllerProtocolV2.3.pdf

from epevermodbus.

hrford avatar hrford commented on July 22, 2024

I'll find the manual I used, but it would be nice to understand why there might be two. It might be a legacy reason before they moved them into a space where they could have two registers? No idea yet...

I've just about coded the read_long into a retryable function...

Do you want this issue split out into the separate issues? I combined them for discussion :)

from epevermodbus.

hrford avatar hrford commented on July 22, 2024

https://www.developpez.net/forums/attachments/p196506d1451307310/systemes/autres-systemes/automation/probleme-com-modbus-pl7-pro/controllerprotocolv2.3.pdf/ V2.3 (2015) shows:

  • an example real-time battery voltage at 0x3104 but then doesn't define it again in any table
  • measured battery power at 0x3106 (32 bits)
  • 0x311A is measured battery voltage
  • 0x311B (32-bits) is measured battery current

Also note:

  • an erroneous entry for rated voltage at 0x311D, it defines it as power in degrees C! (It's actually rated voltage)

Then there's V1.1 of the document at http://www.solarpoweredhome.co.uk/1733_modbus_protocol.pdf which shows all the blocks together:

  • 0x3100 PV voltage (16b), current (16b), power(32b)
  • 0x3104 Battery voltage (16b), current (16b), power(32b)
  • 0x310C Load voltage (16b), current (16b), power(32b)

So, I'm assuming some of these registers are legacy register which have replacement registers, and some aren't replaced but then aren't mentioned in future versions.

from epevermodbus.

hrford avatar hrford commented on July 22, 2024

This ticket can be closed

from epevermodbus.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.