April 18, 20197 yr Hey guys, I switched to the Pylontech batteries and they are running fine, withnout any data communication between them and the inverter. Now, I'd like to readout the operational values from Pylons using a CAN or RS-485 and my PLC. I know that couple of you were able to achieve this, so can you help me with the start, please? What's working the best for you? RS-485 or CAN? Do you have the BUS terminators in your wiring? Are you terminating both ends of the BUS, or is there a built-in terminator in the batteries? What protocol/library did you use as a template for your code? It there anything to take a special care of? Any directions greatly appreciated! Thanks, Youda Edited April 18, 20197 yr by Youda
April 18, 20197 yr 5 hours ago, Youda said: Hey guys, I switched to the Pylontech batteries and they are running fine, withnout any data communication between them and the inverter. Now, I'd like to readout the operational values from Pylons using a CAN or RS-485 and my PLC. I know that couple of you were able to achieve this, so can you help me with the start, please? What's working the best for you? RS-485 or CAN? Do you have the BUS terminators in your wiring? Are you terminating both ends of the BUS, or is there a built-in terminator in the batteries? What protocol/library did you use as a template for your code? It there anything to take a special care of? Any directions greatly appreciated! Thanks, Youda Hi, I’m using RS485. I didn’t put terminators on but no doubt I should. I found a project on Github and modified it to publish to mqtt. If that makes sense to you i’m happy to share the code.
April 19, 20197 yr Author Hi @Elbow that would be great! I've checked both, the CAN and RS485 Pylon docs and they are quite messy (chinese-english mix, hexadecimal values transferred as ascii, etc...) therefore I'm pretty sure that I won't be able to write the procotol decoder from the scratch by myself. By the way, do you have a physical RS485 wire to the master battery only, or do you have a separate RS485 wire leading to every Pylon brick? Thanks!
April 19, 20197 yr 4 hours ago, Youda said: By the way, do you have a physical RS485 wire to the master battery only, or do you have a separate RS485 wire leading to every Pylon brick? One cable only. The batteries chain themselves. The one is at address 2, the other is at 3.
April 19, 20197 yr Author Looks good, I've been able to make a DB9 to RJ-11 cable and connect to the stack via BatteryView: Even the serial console looks promising: Looking at the available docs, it looks like the serial console will accept not only the text CLI, but also the same commands like RS485 interface. That will be great tool for debug, as I can connect laptop directly and try to send couple of commands and then examine the response codes. On the other hand, the protocol itself is terrible. SOI and EOI are fixed 1-byte characters 0x7E and 0x0D, while the other fields of the frame are ASCII characters that have to be grouped, then converted to the HEX and then converting again to DEC for display. And there are two recursive checksums! One 4bit checksum of 12bit LENID and then another 16bit checksum of the whole dataframe. What the hell is that!? A battery for the space shuttle?
April 20, 20197 yr Author Hi @Elbow I played with the batteries today, but had no luck: Connected to the RS485 port on the "master" battery and sent the command that is mentioned in the PDF as an example: HEX: 0x7E,0x32,0x30,0x30,0x31,0x34,0x36,0x34,0x32,0x45,0x30,0x30,0x32,0x30,0x31,0x46,0x44,0x33,0x35,0x0D ASCII: ~20024642E00202FD33 + 0x0D But the battery did not reply, not even a byte. How come that your battery is talking to you, while mine is silent? Is the RS485 port disabled by default and has to be enabled via some CLI command?
April 20, 20197 yr 2 hours ago, Youda said: Hi @Elbow I played with the batteries today, but had no luck: Connected to the RS485 port on the "master" battery and sent the command that is mentioned in the PDF as an example: HEX: 0x7E,0x32,0x30,0x30,0x31,0x34,0x36,0x34,0x32,0x45,0x30,0x30,0x32,0x30,0x31,0x46,0x44,0x33,0x35,0x0D ASCII: ~20024642E00202FD33 + 0x0D But the battery did not reply, not even a byte. How come that your battery is talking to you, while mine is silent? Is the RS485 port disabled by default and has to be enabled via some CLI command? Hi @Youda, I’ll PM you the program I’m using in the morning. You need to get the right baud rate (mine use 115200) and get the wires the right way round...
April 20, 20197 yr I note at least 3 discrepancies between the hex and ascii (e.g. ascii should end 35 not 33, depending on which one is correct). That would presumably cause a CRC error, but I would expect some sort of negative acknowledge rather than nothing. Edited April 20, 20197 yr by Coulomb More details
April 21, 20197 yr Author Hi @Coulomb you're right, I messed-up two different HEX a and ASCII commands! This one is correct for the RS485 interface, to query analog values: HEX: 7E 32 30 30 32 34 36 34 32 45 30 30 32 30 32 46 44 33 33 0D ASCII: ~20024642E00202FD33 +0x0D But, it's not working for me, the RS485 interface is silent, not replying. I've set the port to 115200, 8 bit, no parity. Also, the strange is, that there's a voltage around 2-3V between the RS485 A/B pins on the PLC, while A/B pins on the battery are without any voltage.
April 21, 20197 yr 7 hours ago, Youda said: Hi @Coulomb you're right, I messed-up two different HEX a and ASCII commands! This one is correct for the RS485 interface, to query analog values: HEX: 7E 32 30 30 32 34 36 34 32 45 30 30 32 30 32 46 44 33 33 0D ASCII: ~20024642E00202FD33 +0x0D But, it's not working for me, the RS485 interface is silent, not replying. I've set the port to 115200, 8 bit, no parity. Also, the strange is, that there's a voltage around 2-3V between the RS485 A/B pins on the PLC, while A/B pins on the battery are without any voltage. I used a cat5 ethernet cable. On the battery side the A/B pins are pins 7 and 8, the brown pair. What works for me is solid brown to the TX- pin on my adapter, striped brown to TX+. 115200 baud rate.
April 21, 20197 yr Author Yep. I used ethernet CAT5 cable too, since I'm keeping a box of Belden in my workshop In the US3000 manual, there's a nice pinout drawing included, so I crimped RS485 cable according to it. Excatly like @Elbow is saying: pin 6 GND pin 7 RS485 A pin 8 RS485 B Screenshot of the manual page included bellow. Anyway, I really had no luck talking to the batteries via RS485. Maybe that I'm missing terminator on one side of the bus, I don't know... So, I tried the RS232 serial console and RJ-11 port too. It was working, but still not really convinient for automatic parsing of the values. In the end, I connected Pylons to my PLC via CAN Bus and it worked like a charm. Pylons are broadcasting the most important values over CAN, so you don't have to actively "talk" to them. With just listening on the CAN interface I can now read SoC, SoH, Voltage, Amps and Temperature of the battery stack. The CAN protocol implementation in Pylons is not so rich as RS485 implementation is, but for me it's okay, as I don't really need to see individual cell's values in my home automation. (For this, I can still use the BatteryView.exe.) A complete manual with wiring of the other cables for Pylontech is here: https://solaradvice.co.za/wp-content/uploads/2018/12/US3000B-Plus-Product-Manual-20180717.pdf
April 21, 20197 yr Hi, Here is a quick zip file of the program I use to poll the batteries over RS485 and push the read numbers out to OpenEnergyMonitor's MQTT server. Maybe it will be helpful. I'm not the original author - I just modified to publish over MQTT using a JSON structure, and to scan for batteries. pylon485-elbow.zip
May 10, 20197 yr So to follow up on one of the OP questions, do we need to include termination resistors to get the RS485 connection to work? Or are they already in circuit in the battery? Thanks guys
May 11, 20197 yr I didn't use any termination. Elbow's program gives me output. The program does give me some funny values though on the uS3000s "BatterySOC":0.0, "RemainingAh":0.0, "RemainingWh":0, "MinutesToRun":9999. The other values seem OK. I'm not able to get the cable working with ICC though, the Pylon battery option is not select-able. Edited May 11, 20197 yr by 1Hallux ICC question
May 11, 20197 yr 1 hour ago, 1Hallux said: I didn't use any termination. Elbow's program gives me output. The program does give me some funny values though on the uS3000s "BatterySOC":0.0, "RemainingAh":0.0, "RemainingWh":0, "MinutesToRun":9999. The other values seem OK. I'm not able to get the cable working with ICC though, the Pylon battery option is not select-able. Hi, The "minutes to run" only works when the battery is discharging, otherwise it says 9999. The others should work, i’ll look at the code when i’m home tomorrow and maybe we can see which output is different and fix it.
May 12, 20197 yr ICC only supports RS232 communications. You'll need Manie or Riaan to configure ICC for the Pylontech battery RS232 comms. Mainly i think they specify the baud rate. They actually sell a dedicated lead that forces baud rate for the Pylon batteries... As a bypass on ICC though, connect your laptop up via rs232 to the pylontech (this sets the batteries baud rate to the right one) then unplug without disconnecting from battery view, then try rs232 comms to ICC... Should work.
May 12, 20197 yr 4 hours ago, TenaciousTech said: ICC only supports RS232 communications. You'll need Manie or Riaan to configure ICC for the Pylontech battery RS232 comms. Mainly i think they specify the baud rate. They actually sell a dedicated lead that forces baud rate for the Pylon batteries... As a bypass on ICC though, connect your laptop up via rs232 to the pylontech (this sets the batteries baud rate to the right one) then unplug without disconnecting from battery view, then try rs232 comms to ICC... Should work. Thanks. Will make up a cable - if I can find my serial to USB converter..
May 13, 20197 yr i'm just getting nothing out of my pylons over RS-485, even with your Pylon script. Have you guys found them temperamental with usb to rs285 adapters? I've tried 3 different units. No luck.
May 13, 20197 yr 9 hours ago, TenaciousTech said: i'm just getting nothing out of my pylons over RS-485, even with your Pylon script. Have you guys found them temperamental with usb to rs285 adapters? I've tried 3 different units. No luck. Hi, I had no trouble with my Pylon’s, but couldn’t come right with the Carlo Gavazzi ET112 until I got the Victron USB/RS485 adapter and then it was fine. Usually 115200 bps for the Pylon. You can try your A/B the other way around? RS485 adapters often have a FTDI chip in them and cheap ones have clones and they don’t always work, especially because the maker of the original FTDI put something in the windows driver that can “kill” the clone chips. Hope you can come right.
May 14, 20197 yr Thanks for that.. My RS485 adapter looks identical to the Victron cable. https://au.element14.com/ftdi/usb-rs485-we-1800-bt/cable-usb-rs485-serial-converter/dp/1740357?CMP=KNC-GAU-GEN-DSA-RLSA-CABAN&mckv=suW9qv96u_dc|pcrid|114865409088|pkw||pmt|b|slid||product||pgrid|18902993448|ptaid|aud-289888640566:dsa-82306211808|&gclid=CjwKCAjwq-TmBRBdEiwAaO1enwTQfXTsa26cgiRw5qbFjounQmNxisD2ssyN5S8PR_Wp7TkXE7C0XRoCyOsQAvD_BwE Are you using the terminator wires in parallel with A & B?
May 15, 20197 yr Is the following a typical response when pressing <enter> using the console/RS232 cable? ~200146060000FDAD ~200146060000FDAD ~200146060000FDAD ~200146060000FDAD ~200146060000FDAD
May 18, 20197 yr Author ~200146060000FDAD is Pylontech's RS485 response message format. Write help or debug if you want to play with the CLI.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.