Jump to content

Success polling Pylon US2000B+ over RS485


Elbow
 Share

Recommended Posts

Hi,

I found some Python3 code at PhotovoltaikForum.com for accessing Pylon battery data using the RS485 port.

(Pretty sure it will work on RS232 console port too - but this code uses the native Pylon protocol rather than the pylon_dbg> commands.

I went to Communica and got a little RS232->RS485 adapter and its at least roughly working:

[email protected]:/home/steve/pylon485# python3 ./pyloncom.py
Get system parameter: VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x47, LENGTH: 0, len(INFO): 0, CHKSUM: 0x0000
Get system parameter reply: VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x00, LENGTH: 50, len(INFO): 25, CHKSUM: 0xF224
>  FLAG: 0b10001, UnitCellVoltage: 3.7, UnitCellLowVoltage 3.05, UnitCellUnderVoltage: 2.9
Get series number: VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x93, LENGTH: 2, len(INFO): 1, CHKSUM: 0x0000, Command: 2
Get series number reply: VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x00, LENGTH: 34, len(INFO): 17, CHKSUM: 0xF6C5
> Series Number: PPTBH02198838124
Conectiong to addr 2
Get charge info reply: 02d002b7980064ff06c0
VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x00, LENGTH: 20, len(INFO): 10, CHKSUM: 0xF94A
>  VoltageUpLimit: 53.25, VoltageDownLimit: 47.0, MaxChargeCurrent: 100.0, MaxDischargeCurrent: -250.0, Status: 192
Get analog reply: VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x00, LENGTH: 110, len(INFO): 55, CHKSUM: 0xE491
>  CellsCount: 15, TemperaturesCount: 5
>  TotalCurrent: -0.700, TotalVoltage: 50.830, RemainingCapacity: 49.500, P: -35.58
>  Quantity: 2, TotalCapacity: 50.0, Cycles: 0
>  CellVoltages: [3.387, 3.389, 3.388, 3.389, 3.39, 3.386, 3.388, 3.388, 3.389, 3.389, 3.389, 3.389, 3.39, 3.39, 3.389]
>  Temperatures: [28.0, 25.0, 25.0, 26.0, 26.0]

It looks like this code doesn't know how to handle two batteries - since it only gets the data from the one.  So time to go digging.

Having some fun here!   You gotta love the sharing culture (should that be teilenkultur since it was a German forum).

 

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...

Hi Elbow, thank you for making the pyloncom.py script available. I am having some funny values when using this script on my US3000C battery as follows:

Conecting to addr 2 
Get charge info reply, addr 2 : 02d002b3b00000fe8e40
VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x00, LENGTH: 20, len(INFO): 10, CHKSUM: 0xF950
>  VoltageUpLimit: 53.25, VoltageDownLimit: 46.0, MaxChargeCurrent: 0.0, MaxDischargeCurrent: -37.0, Status: 0x40
Get analog: VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x42, LENGTH: 2, len(INFO): 1, CHKSUM: 0x0000, Command: 2
Get analog reply, addr 2 : VER: 0x20, ADR: 0x02, CID1: 0x46, CID2: 0x00, LENGTH: 122, len(INFO): 61, CHKSUM: 0xE270
>  CellsCount: 15, TemperaturesCount: 5
>  TotalCurrent: 127.900A, TotalVoltage: 65.280V, RemainingCapacity: 0.001Ah, P: 8349.31
>  Quantity: 33, TotalCapacity: 4.097Ah, Cycles: 8464
>  CellVoltages: [3.466, 3.468, 3.468, 3.456, 3.465, 3.467, 3.467, 3.467, 3.456, 3.469, 3.465, 3.468, 3.467, 3.467, 3.465]
>  Temperatures: [21.3, 16.6, 16.4, 16.1, 18.9]
Send { "time":1628776109, "VoltageUpperLimit":53.25, "VoltageLowerLimit":46.0, "MaxChargeAmps":0.0, "MaxDischargeAmps":-37.0, "BatteryCycles":8464, "BatteryVoltage":65.28, "BatteryAmps":127.9, "BatteryWatts":8349.312, "BatterySOC":0.002, "RemainingAh":0.001, "RemainingWh":0, "MinutesToRun":9999, "CellMaxVoltage":3.65, "CellLowVoltage":3.05, "CellUnderVoltage":2.8, "cellVoltage0":3.466, "cellVoltage1":3.468, "cellVoltage2":3.468, "cellVoltage3":3.456, "cellVoltage4":3.465, "cellVoltage5":3.467, "cellVoltage6":3.467, "cellVoltage7":3.467, "cellVoltage8":3.456, "cellVoltage9":3.469, "cellVoltage10":3.465, "cellVoltage11":3.468, "cellVoltage12":3.467, "cellVoltage13":3.467, "cellVoltage14":3.465, "highestCellVoltage":3.469, "lowestCellVoltage":3.456, "cellImbalancePct":0.3, "temp0":21.3, "temp1":16.6, "temp2":16.4, "temp3":16.1, "temp4":18.9, "highestTemp":21.3, "lowestTemp":16.1 } to emon/pylonPPTCR03101168345
 

As you can see, the values for Totalcurrent, TotalVoltage, RemainingCapacity etc. seem to be incorrect, as well as the value for Cycles seems to remain the same.

I would assume that the response string being returned is not getting parsed correctly for these values to show up as they do. I have tried to use the RS485 protocol manual to make sense of it, but i just dont seem to be able to work out how the parsing gets done. Is there any more reading i can do to understand this or do you have some tips for me to follow to get this fixed please

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...