diy solar

diy solar

How to connect 3 inverters and 3 Heltec/JK BMSes to a PC/Raspberry Pi?

Luk88

New Member
Joined
Apr 5, 2024
Messages
239
Location
Poland
As in the subject. Supposedly all my inverters (Deye Sun-3k-g, EASUN SMH-ii 7k, MPP 4.2 kw hybrid inverter) as well as all my Heltec black(rebadged JK) BMSes support RS-485 (modbus?).

There are various open source projects that talk to these devices when connected point to point (between a computer and a device).

My question here is, can they all be put on a single rs-485 bus? Or do I need 6 rs-485 interfaces to talk to them all at the same time?

This is supposed to be used by a small pc (or a raspberry pi) with custom logic to switch settings on inverters (source priority, charging/dc cutoff voltages, max charging amps) depending on time of day/year and various other things. Essentially I'm trying to build a fully automated off-grid-with-grid-support and on-grid elements system.
 
It should be possible to connect them all to the same RS485 bus as long as they have different bus addresses.

Or you could get an RS485/modbus adaptor that will connect them to your local LAN or wifi and access them by IP address.
 
RS485 works on a master/slave basis. Your Raspberry Pi as Master can talk to 247 slaves so 6 is no issue at all.

There is a but, as RS485 is a fairly open system so being able to set ID's so all the items on the RS485 daisy chain can be uniquely identified is a must.

Then you need software that knows the register map for each type of device on the daisy chain. That may mean two programs , one for the Deye and another for the JK.

I use node-red as a convenient hub to pull all the data in and then use it to perform tasks. These tasks could include writing to a JK register based on data coming from the Deye.

First node-red is where I take non compatible SMANet data into an MQTT server and convert to RS485 for a data logger, second is one I use to switch on extra loads as the SI 5048 starts to ramp down PV production as the battery is close to be in full.
 

Attachments

  • Screenshot (6).png
    Screenshot (6).png
    427 KB · Views: 1
  • Screenshot (9).png
    Screenshot (9).png
    365.5 KB · Views: 1
It should be possible to connect them all to the same RS485 bus as long as they have different bus addresses.
RS485 works on a master/slave basis. Your Raspberry Pi as Master can talk to 247 slaves so 6 is no issue at all.
Thanks. What I can't figure out is if the device addresses will clash? Do these devices even support changing an address? (there is no such function in the firmware, nor any dip switches I found).

There is a but, as RS485 is a fairly open system so being able to set ID's so all the items on the RS485 daisy chain can be uniquely identified is a must.
There is some sort of "auto addressing", but do these devices use it?

Then you need software that knows the register map for each type of device on the daisy chain. That may mean two programs , one for the Deye and another for the JK.
Thanks, that is next stage. Once I figure out how to talk to all of them at the same time :)

Thankfully there seem to be open source projects for all these devices (worst case scenario I'll be sniffing traffic between these "send all my data, my GPS location, my WiFi passwords to China, and let me pay for it" dongles and the inverters.
Or you could get an RS485/modbus adaptor that will connect them to your local LAN or wifi and access them by IP address.
The PC/RPi will be right next to them on the same wall, also it will be controlling SSRs and reading voltages/currents so there is no need to add LAN etc.
 
I have none of your kit so can't tell you if or how to set the ID but the manuals should have that info. Some are set using the kits own screen, some via dip switches which then limits the number of ID's.
 
I have none of your kit so can't tell you if or how to set the ID but the manuals should have that info. Some are set using the kits own screen, some via dip switches which then limits the number of ID's.
None of the (inverter) manuals have even a sentence about it.

I don't even know if they use rs-485 for inverter control (at least regarding g the deye and 7k easun as both have just rx, tx marked on the pinout).


The easun has rs-485 port to plug bms into, but there is no indication it can be used for anything else.

However, both use the "give up all your data" dongles connected through the tx/rx and I believe cables are sold to connect them to the pc using it (I may have received a pc cable with a serial port for it).
 
Solax are the same, no details in the installation manual, so I emailed support and asked for the RS485 register map which they supplied. Did not need to ask about ID as that was set on the LCD screen as was the ability to turn RS485 on. So ask Deye support or google for Deye RS485 register map.
 
I don't even know if they use rs-485 for inverter control (at least regarding g the deye and 7k easun as both have just rx, tx marked on the pinout).
Typically RS485 is labelled as A/B or +/-, and RS232 is labelled as Tx/Rx, so you first need to figure out what you have.
 
The easun has rs-485 port to plug bms into, but there is no indication it can be used for anything else.
If it’s a port on the inverter that wants to talk to batteries it’s almost certainly going to be the bus master, so your solution would have to eavesdrop on the inverter->BMS communication and hope the data you are looking for is in there.

Alternatively you could do a man-in-the-middle connection but that’s a lot more work and fraught with peril if you get something wrong.
 
Back
Top