I recently had the privilege (and pain) of being able to experiment and install a PylonTech US3000 battery pack.
In typical Chinese-product fashion (Xiaomi and DJI excluded) the manuals and technical documentation for both of these devices is muddled, missing and often plain incorrect.
I’ve learnt a few things through trial and error and for my own good and the good of others I’m going to make a note of them below:
The US3000 has several ports on the front, including:
- an RJ11 (or RJ12) “Console” port – this is an RS232 port (NOT a TTL port and thus it won’t work directly with a Raspberry Pi). The port expects a string of characters at 1200 baud at which point it transitions to 115200. The port is for debugging and maintenance and appears to be a rich data source. This port’s protocol is partially documented here.
I have 4 of the Pylontech US2000B batteries in operation and the manufacturer is skimpy with issuing the protocol for reading out the batteries.
As of now, no information on this is available on the Internet or in the manuals.
The manufacturer keeps a low profile.
So here are the instructions on how to get the information out of the batteries.
I need the data from the batteries because the voltages that can be set on my PIP4048MS inverter are too imprecise for the memory and also unusable due to the flat characteristic curve.
That’s why I’ve now written a program to switch the PIP to mains operation at the 23% threshold.
The battery can be read out via the console port.
Up to 8 batteries in series can be addressed.
First the console has to be activated.
To do this, switch the terminal program to 1200, 8, N, 1.
Then send the following hex string to the battery:
Data: 7E 32 30 30 31 34 36 38 32 43 30 30 34 38 35 32 30 46 43 43 33 0D
Now switch to 115200,8, N, 1 ..
Data: Send 0D 0A.
The pylon> prompt appears, which enables commands to be entered.
First command e.g.
help \ n (\ n = line feed character 0A)
shows some help
pwr \ n
Power Volt Curr Tempr Tlow Thigh Vlow Vhigh Base.St Volt.St Curr.St Temp.St Coulomb Time BVSt BTSt
1 49884 4310 28000 25000 26000 3322 3327 Batch Normal Normal Normal 31% 2017 – 07 – 09 14:56: 37 Normal Normal
2 49832 4472 28000 25000 25000 3321 3323 Batch Normal Normal Normal 31% 2017 – 07 – 09 14:56: 36 Normal Normal
3 49842 4318 28000 25000 25000 3322 3324 Batch Normal Normal Normal 30% 2017 – 07 – 09 14:56: 36 Normal Normal
4 49858 4111 27000 23000 23000 3322 3325 Batch Normal Normal Normal 30% 2017 – 07 – 09 14:56: 36 Normal Normal
5 – —— Absent – ——
6 – —— Absent – ——
7 – —— Absent – ——
8 – —— Absent – ——
Command completed successfully
The numbers are given as fixed point numbers and usually have to be divided by 1000.
There are many routines available in Admin Mode, and we do not recommend using them.
Up to the chip level to test individual chips on the board.
getpwr 1 \ n
getpwr 8 \ n
the cell voltages, among other things, can be read out.
The batteries log a lot.
For example, an event history can be read out.
The state of health can be read out with the command soh \ n.
- An RJ45 port marked “CAN”. This port is… for CANbus. Unfortunately this appears to be the lightest in terms of data exposed on this unit.
- an RJ45 port marked “RS485”. This port seems to carry two sets of RS485 pins – they are duplicated/wired to the same end device.
The cable pin mapping that worked for the inverter in “PYL” mode was: Pins 7 and 8 on the battery (RS485 port) to pins 3 and 5 on the inverter’s “Li-Ion” port. The Axpert inverter expects a baud of 9600 – and to affect this you must set the first dip switch (on the left of the RJ45 ports) to high and power cycle the battery. All other switches on the block should be low. The Axpert inverter will indicate successful comms with the battery after only a few seconds of the connection electrically being made. It will indicate successful comms by continuously blinking the battery icon in the power flow graph. If it fails to communicate with the battery it will do weird things and flash “61” on the top line of the display.
In operation the Axpert Inverter queries the battery near-continuously. This isn’t great because it means you can’t query the battery using the same interface from another machine (ala a Raspberry Pi). It’s one or the other. The inverter detects the loss of comms with the battery within 6 seconds after physically disconnecting the data cable.
- Two more RJ45 ports, labeled “Link 0” and “Link 1”. These ports appear to also carry RS485, but it is not the same bus the one available on the “RS485” labeled port. Once again, this is crap.
To turn on the battery, start by switching the power switch to on. This activates the data connections and management functionality of the battery but doesn’t connect the battery to the terminals. To actually energise the terminals, press and hold the “SW” red button for somewhere around 0.5 seconds. Some lights will light up and the terminals will be active.
Without any interaction from the inverter (charging current) none of the lights will be active. With charging the run light will flash and the SoC LEDs will be lit.
The Axpert inverter seems to charge the battery up until around 86%, at which point is regularly cycles between charging and discharging the battery (changing state roughly every 30 to 60 seconds).
The above is with a modest (~800w) solar array.
A conveneient Python JSON-dumping MQTT application is available here. It’s called “Python-elbow” and I have no idea who wrote it. You’ll need to install paho-mqtt and pyserial to use it (
pip3 install pyserial paho-mqtt. This application communicates with the inverter via the RS485 port. It won’t work while the port is being used by the Axpert Inverter due to insufficient available transmission time.
Also, an Afrikaans (or Dutch?) GitHub repository containing various documentation related to the various protocols supported by the PylonTech BMS: https://github.com/Interster/PylonTechBattery – a cached zip is available below: