Code Monkey home page Code Monkey logo

Comments (6)

rosswarren avatar rosswarren commented on July 3, 2024

Thanks for reporting! The docs that I have for the modbus protocol make no mention of a 4th type. Could you please let me know which charge controller you have? On my Charge controller I must set "USER" battery type for a LiFePO4 battery you maybe have a newer model.

from epevermodbus.

AlexAltea avatar AlexAltea commented on July 3, 2024

I have an Epever Tracer2210AN.

On my Charge controller I must set "USER" battery type for a LiFePO4 battery you maybe have a newer model.

Right, it surprised me that most tutorials I found online said that LiFePO users should use the "USER" type when my device had clear support LiFePO4 and LiFePO8.

from epevermodbus.

AlexAltea avatar AlexAltea commented on July 3, 2024

I've decompiled the official controller software from https://www.epever.com/support/softwares/

And there's three variants of the protocol, each with support for different battery types:

    public static readonly string[] BatteryType = new string[6]
    {
      nameof (LiBattery),
      "LeadAcid(MF)",
      nameof (GelBattery),
      "LeadAcid(Liquid)",
      "LiFePO4",
      "Li-NiCoMn"
    };
    public static readonly string[] BatteryType3 = new string[11]
    {
      nameof (User),
      "LeadAcid(MF)",
      nameof (GelBattery),
      "LeadAcid(Liquid)",
      "LeadAcid(MF)User",
      nameof (GelBatteryUser),
      "LeadAcid(Liquid)User",
      nameof (LiIronBatteryNum4),
      nameof (LiThreeBatteryNum3),
      nameof (LiIronBatteryNum8),
      nameof (LiThreeBatteryNum6)
    };
    public static readonly string[] BatteryType1 = new string[4]
    {
      nameof (User),
      "LeadAcid(MF)",
      nameof (GelBattery),
      "LeadAcid(Liquid)"
    };

From searching Google it seems: LeadAcid(MF) is Sealed and LeadAcid(Liquid) is Flooded.

Also, in BatteryType, the type User appears as LiBattery (value 0). This is evidenced by the following code:

public bool IsUserType => this.batteryType == 0;

So all together:

BatteryType

Field Name Index
User 0
Sealed 1
GelBattery 2
Flooded 3
LiFePO4 4
Li-NiCoMn 5

BatteryType3

Field Name Index
User 0
Sealed 1
GelBattery 2
Flooded 3
SealedUser 4
GelBatteryUser 5
FloodedUser 6
LiIronBatteryNum4 7
LiThreeBatteryNum3 8
LiIronBatteryNum8 9
LiThreeBatteryNum6 10

BatteryType1

Field Name Index
User 0
Sealed 1
GelBattery 2
Flooded 3

from epevermodbus.

rosswarren avatar rosswarren commented on July 3, 2024

Wow, that's great investigation! So I guess we can easily cover the case for the two shorter variants. But the one with 11 entries might be an issue as the value for 4 and 5 would conflict. We will need a way to differentiate when we are dealing with BatteryType3. Any ideas? Or was there anything in the code that might indicate when BatteryType3 might be in use?

from epevermodbus.

AlexAltea avatar AlexAltea commented on July 3, 2024

Ok, the Android app seems to be even more useful since it's sources are JavaScript which is "just minified", rather than compiled. Here's the releavant formatted file: app-service.clean.zip

It seems that the following lines are common to all devices:

this.battery_type_list = [{
	id: 0,
	val: this.$t("message.batterySetting.battery_opt.customize"),
	type: 0
}, {
	id: 1,
	val: this.$t("message.batterySetting.battery_opt.AGM"),
	type: 1
}, {
	id: 2,
	val: this.$t("message.batterySetting.battery_opt.GEL"),
	type: 2
}, {
	id: 3,
	val: this.$t("message.batterySetting.battery_opt.FLD"),
	type: 3
}

which matches your list.

But there's for some models, this list is expanded:

image

Followed by: this.battery_type_list.length < 5 && (this.battery_type_list = this.battery_type_list.concat($));

from epevermodbus.

AlexAltea avatar AlexAltea commented on July 3, 2024

Sorry I don't have an "easy" answer to your question. It seems their protocol is just a mess, and many fields are device-dependent for IDs >= 4.

from epevermodbus.

Related Issues (18)

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.