Tomcat42 / pylontech-python

Functions to communicate to Pylontech Batteries using RS-485 serial communication
MIT License
11 stars 7 forks source link

Issues with US5000 battery #11

Open lslrt opened 1 year ago

lslrt commented 1 year ago

Hi,

I'm using this module (pylontech==0.1.3) with my US5000 battery, I have a single battery connected. I've noticed two bugs:

  1. When initializing I must set manualBattcoutLimit to 1 otherwise, I've got 3 times " Pylontech RX exception ()" then it fails to create the object when I initialize with the example given in the README.md file : PylontechStack("/dev/ttyUSB0",baud=115200,manualBattcountLimit=5)
  2. SystemParameter seems to be wrongly decoded:
    'SystemParameter': {'ADR': 2,
                     'ChargeLowerLimitCurrent': 1817.9,
                     'ChargeLowerLimitTemperature': -195.3,
                     'ChargeUpperLimitTemperature': -681.4,
                     'DischargeLowerLimitCurrent': 1842.8,
                     'DischargeLowerLimitTemperature': -195.3,
                     'DischargeUpperLimitTemperature': -476.6,
                     'ID': 70,
                     'LENGTH': 50,
                     'LowerLimitOfTotalVoltage': 61.619,
                     'PAYLOAD': b'100E420BEA0AF00D030A4703E8D2F0B3B0A7F80D030A'
                                b'47FC18',
                     'RTN': 0,
                     'UnderVoltageOfTotalVoltage': 45.223,
                     'UnitCellHighVoltageThreshold': -5.622,
                     'UnitCellLowVoltageThreshold': 16.907,
                     'UnitCellVoltage': 4.11,
                     'UpperLimitOfTotalVoltage': 59.602,
                     'VER': 32}}

    Using another python module https://github.com/Frankkkkk/python-pylontech, the same frame seems to be more correctly decoded:

    b'~20024600B032100E420BEA0AF00D030A4703E8D2F0B3B0A7F80D030A47FC18F27F\r'
    Container(
    CellHighVoltageLimit=3.65
    CellLowVoltageLimit=3.05
    CellUnderVoltageLimit=2.8
    ChargeHighTemperatureLimit=60.0
    ChargeLowTemperatureLimit=-10.0
    ChargeCurrentLimit=10.0
    ModuleHighVoltageLimit=54.0
    ModuleLowVoltageLimit=46.0
    ModuleUnderVoltageLimit=43.0
    DischargeHighTemperatureLimit=60.0
    DischargeLowTemperatureLimit=-10.0
    DischargeCurrentLimit=-10.0
    )

    Regards

digitalbanana commented 1 year ago

hi @lslrt - i have a US5000 and cannot get either of the modules to work - this one give no output at all and the other from Frankkkkk gives me no output - would love to get this working but am a bit stuck....

i have a USB to RS485 converter with A/B connected to Pins 7/8 of an RJ45 plug and cannot get any response from the battery, would love to know if you have any luck?

digitalbanana commented 1 year ago

okay i found out this is because it looks like the RS485 port wont work when its connected to the inverter - i disconnected the inverter and was able to interact with the battery via the RS485 port

lslrt commented 1 year ago

Hi, Glad you figured it out by yourself. I was about to post you some picture of my setup to help you to double check your wiring. On the manual it is stated that three cables on the rs485 connector must be 'null', I'm not sure what null means... Now you say it, I think I've read something about the fact that there is no data on the rs485 cable when it is connected to the inverted, I'll check the manual when I got some times. Regards

Le jeu. 7 sept. 2023, 21:41, Dave Lowe @.***> a écrit :

okay i found out this is because it looks like the RS485 port wont work when its connected to the inverter - i disconnected the inverter and was able to interact with the battery via the RS485 port

— Reply to this email directly, view it on GitHub https://github.com/Tomcat42/pylontech-python/issues/11#issuecomment-1710679724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMCEDU6D2VUSQI5YK2ELZ5LXZIPPRANCNFSM6AAAAAAXGCXAXU . You are receiving this because you were mentioned.Message ID: @.***>

Tomcat42 commented 1 year ago

just a short info on RS-485: The cable ends have to be terminated by resistors. If the inverter and the battery have them, your RS-485 Adapter may add an additional Resistor. just measure it: it will be ~120 Ohm or some MOhm depending on the Trminator active or passive.

On Thu, 2023-09-07 at 13:23 -0700, Léo Sartre wrote:

Hi, Glad you figured it out by yourself. I was about to post you some picture of my setup to help you to double check your wiring. On the manual it is stated that three cables on the rs485 connector must be 'null', I'm not sure what null means... Now you say it, I think I've read something about the fact that there is no data on the rs485 cable when it is connected to the inverted, I'll check the manual when I got some times. Regards

Le jeu. 7 sept. 2023, 21:41, Dave Lowe @.***> a écrit :

okay i found out this is because it looks like the RS485 port wont work when its connected to the inverter - i disconnected the inverter and was able to interact with the battery via the RS485 port

— Reply to this email directly, view it on GitHub https://github.com/Tomcat42/pylontech- python/issues/11#issuecomment-1710679724, or unsubscribe https://github.com/notifications/unsubscribe- auth/AMCEDU6D2VUSQI5YK2ELZ5LXZIPPRANCNFSM6AAAAAAXGCXAXU . You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: <Tomcat42/pylontech- @.***>