diy solar

diy solar

Chargery rs232 interface

Craig

Watts are Watts!
Staff member
Moderator
Joined
Sep 20, 2019
Messages
2,924
Location
Hollister CA and off the grid in Idaho
So when I saw the Chargery I saw it had 2 phone jack style inputs that I thought 1 would be used for the rs232 connection. Now that I have i t i find out that rs232 uses com3 which is simply 2 wires. from what I can find rs232 needs at least 3 wires ground TX and RX. Is it safe to assume that the ground can come from the battery negative. also I can find no info at all on how to read the rs232 data.

Anybody have any ideas?
 
RS-232 Protocol stack info attached.
2 wires is all that is needed in such an install. Take an RJ45 Ethernet cable and chop one end off to get the wires and verify the wire to pin with a DVOM. There is no "packaged application" that I am aware of but there may be some. I am using an intermediary for RS to Ethernet (Modbus) as suggested to me, it is a USRIOT server I have a 410S but will have to get a N540 4 port model now.

For software I am using a Raspi with Node-Red, INfluxDB & Grafana. I've posed about that here in another thread, forget which.
Andreas Spiess got me started on that path with this video.

Hope that helps.
Steve
 

Attachments

  • bms24T_BMS16T_BMS8T_additional_protocol-RS232[1096].pdf
    153.6 KB · Views: 81
  • Like
Reactions: Dzl
Hello,

I try to parse the data from Chargery BMS RS-232 (COM3) interface and I am lost. I am using a "FTDI Adapter FT232RL USB" which seems to be working fine (loopback test, shorten TX/RX). However, the data from the COM3 interface just looks very strange, completely not parseable. Maybe, anyone have some tips and already an example how to understand the interface? - Thank you!

Bye
Tobi
 
Hello,

I try to parse the data from Chargery BMS RS-232 (COM3) interface and I am lost. I am using a "FTDI Adapter FT232RL USB" which seems to be working fine (loopback test, shorten TX/RX). However, the data from the COM3 interface just looks very strange, completely not parseable. Maybe, anyone have some tips and already an example how to understand the interface? - Thank you!
Did you ever figure out the Chargery interface? Will it work with modbus on a Pi? Im interested to gather the cell data. Thanks ...
 
Hello,

Did you ever figure out the Chargery interface? Will it work with modbus on a Pi? Im interested to gather the cell data. Thanks ...

Yes, I suceed and retrieve the data properly. I have put my source code to https://github.com/Tobi177/venus-chargerybms If you have any further questions, I will be happy to help you. First important thing is to invert tx mode. Additonally, check the new docs of the COM3 chargery interfasce, it was enhanced a lot.

Bye
Tobi
 
Hi Toby, I dont have a Victron Venus device, I want to connect my Pi via USB/Modbus directly to the Chargery com3 port. Did you ever get that working?
 
Hello,

I try to parse the data from Chargery BMS RS-232 (COM3) interface and I am lost. I am using a "FTDI Adapter FT232RL USB" which seems to be working fine (loopback test, shorten TX/RX). However, the data from the COM3 interface just looks very strange, completely not parseable. Maybe, anyone have some tips and already an example how to understand the interface? - Thank you!
Hi Tobi, on Raspian (or any Linux) pipe the data thro ‘od -x’
By default, its output in ASCII, but you want hexidecimal,
then the data looks like it does in the protocol document. ie
# cat /dev/ttyUSB0 | od -x

You will have to wait a few seconds for data as its heavily buffered. To fix that, you can temporarily disable buffering like this:

# cat /dev/ttyUSB0 | stdbuf -i0 -o0 -e0 od -x
0000000 2424 0f57 420e 0000 000c 01dd 641a 2466
0000020 5624 0e16 0d17 0d0f 0d0d 100d 1c0d 2f0d
0000040 b50d d764 2424 0f57 420e 0000 0014 01dd
0000060 641a 246e 5724 0e0f 0042 1900 dd00 1a01
0000100 7364 2424 1656 170e 100d 0d0d 0d0d 0d12
0000120 0d1a 0d32 64b4 68d8 3a3a 0d33 240a 5724
0000140 0e0f 0042 0c00 dd00 1a01 6664 2424 0f57
0000160 420e 0000 000f 01dd 641a 2469 5624 0e16
0000200 0d14 0d10 0d0d 0d10 0d12 0d1a 0d2e 64b4
0000220 24d0 5724 0e0f 0042 1700 dd00 1a01 7164
0000240 2424 0f57 420e 0000 0017 01dd 641a 6871
0000260 3a3a 0d33 240a 5624 0e16 0d14 0d10 0d0d
0000300 0d10 0d0f 0d1c 0d31 64b4 24d2 5724 0e0f
 
I'm having success reading the Chargery real-time data using a simple USB interface with just RX/TX ports on a Pi 4 running Raspian. I just connect to the /dev/ttyUSB0 interface at 115200 baud and collect the stats as a datastream. I parse it using some basic Linux tools and feed it to a python script. I'm just finishing up the last few bugs and I will post my code. No need for any expensive hardware. something like this.

Amazon.com: DSD TECH 2PCS USB to TTL Serial Adapter with CP2102 Chip Compatible with Windows 7,8,10,Linux,Mac OS X: Computers & Accessories
Buy DSD TECH 2PCS USB to TTL Serial Adapter with CP2102 Chip Compatible with Windows 7, 8, 10, Linux, Mac OS X: Serial Adapters - Amazon.com ✓ FREE DELIVERY possible on eligible purchases
www.amazon.com

To start with you can easily collect data on your Windows PC to verify it works before moving to your Pi, just connect the 2 wires TX/RX to the USB stick and plug it into your COM3 on the Chargery. Use the cable they supplied. Get the PC software here.
https://www.usriot.com/support/downloads/usr-tcp-test-testing-software.html

chargeryUSR.jpg



Then, when your cable is ready, plug it into your Pi and look for /dev/ttyUSB0 to appear

you can then read the datastream with standard tools. You can see the hex cell voltages right after Hex 2424 1656

[root@pi4] : /home/joe/Dev/Chargery) > cat /dev/ttyUSB0 | od -x

0000000 2424 1656 e80c fa0c f20c f50c f40c f60c
0000020 f80c ea0c 085f 2424 0f57 420e 0000 0014
0000040 00bd 5fe0 240e 5724 0e0f 0042 1400 bc00
0000060 e000 0d5f 2424 0f57 420e 0000 0014 00bc
0000100 5fe0 680d 3a3a 0d33 240a 5624 0c16 0ce7
0000120 0cfa 0cf2 0cf5 0cf5 0cf6 0cf8 5fec 240a
0000140 5724 0e0f 0042 1400 bd00 e000 0e5f 2424
0000160 0f57 420e 0000 0014 00bc 5fe0 240d 5624
0000200 0c16 0ce6 0cfb 0cf2 0cf5 0cf5 0cf6 0cf8
0000220 5fed 240b 5724 0e0f 0042 1400 bc00 e000
0000240 0d5f 2424 0f57 420e 0000 0014 00bc 5fe1
0000260 680e 3a3a 0d33 240a 5624 0c16 0ce8 0cf9
0000300 0cf3 0cf5 0cf5 0cf5 0cf8 5fea 2408 5724

Here is the beginning of my Python tool output to read it in realtime. I will then pipe it into Grafana to chart all cell voltages over a day. Should be interesting. I will post it when it ready.

[root@pi4]:/home/joe/Dev/Chargery) > cat data.hex | ./splitData.py | ./readData.py
Cell 0 : 3.304 volts
Cell 1 : 3.323 volts
Cell 2 : 3.315 volts
Cell 3 : 3.317 volts
Cell 4 : 3.317 volts
Cell 5 : 3.318 volts
Cell 6 : 3.321 volts
Cell 7 : 3.309 volts
SOC: 95 %
Checksum: 0f
Max Cell Voltage: 3.65 v
Current mode: Discharge
Current Amps: 0.0 A
 
@BarkingSpider This is great! How do you like the Chargery overall? I am narrowing down my BMS choices with my pending delivery of cells and have this one on theshort list. As for the setup you described above, do you have your supporting scripts publicly available? If I go the Chargery route I would love to setup something similar, already leveraging Grafana to chart out some house hold AC loads. Thanks!
 
The chargery is very solid, It has lots of features, but a rather dated interface. Still, its so much better than any other generic BMS without a display, meaning that you don't even know if they are working or not. Also, the ability to extract data from it is key for me. The RS232 cable is low cost and then you need a Raspberry Pi (4 or Zero works well) and your getting Grafana charts.

Get your Chargery units from Craig right here . https://diysolarforum.com/threads/chargery-bms-in-stock-in-the-usa.5235/

Another front runner is the ElectroDacus http://www.electrodacus.com/. I've yet to fully test it, but it looks promising.

I can provide all the code you need. I'm working on getting it uploaded to GitHub once I've fully tested it, but can give you beta code until then.

Here is another key piece of the pie I got working today. A solid backup power solution.

Joe.


@BarkingSpider This is great! How do you like the Chargery overall? I am narrowing down my BMS choices with my pending delivery of cells and have this one on theshort list. As for the setup you described above, do you have your supporting scripts publicly available? If I go the Chargery route I would love to setup something similar, already leveraging Grafana to chart out some house hold AC loads. Thanks!
 
The chargery is very solid, It has lots of features, but a rather dated interface. Still, its so much better than any other generic BMS without a display, meaning that you don't even know if they are working or not. Also, the ability to extract data from it is key for me. The RS232 cable is low cost and then you need a Raspberry Pi (4 or Zero works well) and your getting Grafana charts.

Get your Chargery units from Craig right here . https://diysolarforum.com/threads/chargery-bms-in-stock-in-the-usa.5235/

Another front runner is the ElectroDacus http://www.electrodacus.com/. I've yet to fully test it, but it looks promising.

I can provide all the code you need. I'm working on getting it uploaded to GitHub once I've fully tested it, but can give you beta code until then.

Here is another key piece of the pie I got working today. A solid backup power solution.

Joe.

@BarkingSpider Thanks for the info and will be sure to look you up if I go the Chargery route.
 
I don't have the Chargery BMS for sale, Craig is a moderator here on this forum. He has them for sale. Contact him directly. He got me 2 at a a very reasonable price and shipped them in a few days. He is in California.


@BarkingSpider Thanks for the info and will be sure to look you up if I go the Chargery route.
 
@
The chargery is very solid, It has lots of features, but a rather dated interface. Still, its so much better than any other generic BMS without a display, meaning that you don't even know if they are working or not. Also, the ability to extract data from it is key for me. The RS232 cable is low cost and then you need a Raspberry Pi (4 or Zero works well) and your getting Grafana charts.

Get your Chargery units from Craig right here . https://diysolarforum.com/threads/chargery-bms-in-stock-in-the-usa.5235/

Another front runner is the ElectroDacus http://www.electrodacus.com/. I've yet to fully test it, but it looks promising.

I can provide all the code you need. I'm working on getting it uploaded to GitHub once I've fully tested it, but can give you beta code until then.

Here is another key piece of the pie I got working today. A solid backup power solution.

Joe.
@BarkingSpider I just got my Chargery BMS hooked up and bought the DSD TECH 2PCS USB to TTL Serial Adapter you recommended from Amazon. Can you provide a link to your Beta Code you got working? Thanks so much. I'm a developer, so hopefully I can get it put on a Pi or an Arduino pretty easily.
 
Sure, i will post it on github and put a link here. It's written to work data in Prometheus/Grafana format, but it will be very easy to change to csv or something similar. Please post some feedback here when you try it out.
 
Here is the script for reading data from a Chargery BMS 8t and writing in a format for my Grafana reports. Read thru the code and make changes to match your system. It details to using /dev/ttyUSB0

 
Here is the script for reading data from a Chargery BMS 8t and writing in a format for my Grafana reports. Read thru the code and make changes to match your system. It details to using /dev/ttyUSB0

@BarkingSpider Thank you, I am getting a 404 error when I try to access the link you posted.
 
Back
Top