Getting data from inverters via an RS485 connection

Any chance you would share the protocol that Ginlong sent you please?

hi @lepton, working on a Ginlong inverter at the moment and I managed to get the modbus manual below. I am working with a Solis_RAI-3K and just trying to work out which point/connectors I need for the modbus connection!

Any luck?

Iā€™ve been trying to work out how I can get data off my ginlong wifi data logging stick (solis inverter) for a few days and itā€™s a gigantic pain in the behind.

Iā€™ve proxied the connection to their servers and still the device just randomly stops working. Rebooting it, it will work briefly but then will crap out again after a minute or two.

I am happy to get my hands dirty with a DIY solution but I donā€™t know what connector it uses to wire in my own RS485 in with a pi (and even then, who knows if I can get that working).

I am so frustrated that itā€™s impossible to build any kind of smart house. I canā€™t even pull usage out of my smart meter because itā€™s all locked down despite many attempts. Iā€™m just sitting here blind.

Just a thought, if it is a 2.4MHz device, then I have experienced in the past issues with ISP provided, and independently bought Wi-Fi APs just not playing nicely, especially dual band APs.

Quite a while ago I bought one of these (from China so cheaper), replaced the the software with a clean version of OpenWrt (it comes with a modified version) and now connect most of my 2.4MHz devices to it. It is completely rock solid. GL.iNet GL-MT300N-V2

Personally I think it is due to Wi-Fi authentication, but Iā€™ve not been able to prove it. All I could see, was the devices continually connecting and disconnecting. The new AP solved it.

@borpin Thanks for the advice. Iā€™m using an openwrt derived router, the actual connection is pretty solid, itā€™ll connect and it wonā€™t lose the connection, itā€™ll just stop sending data after a bit. You can still send messages to it but it just ignores them. Once you restart it it wakes up for a bit. Soooo annoying.

1 Like

hi @NibblyPig

I have been able to get all the data from Solis using Modbus through HA as below as part of our development of a home energy management unit. Happy to share the HA configs with anyone.

Works well, is rock solid and I can send the data to EmonCMS as well for aggregation and API access.

The part marked in red is me now trying to get full control over the inverter for community power/VPP applications. E.g. set the charge and discharge rate and times. The manufacture says its possible, I am going to next try Node-Red to see if having more control over the function code helps.

If anyone on this forum has experience with Modbus and can help me get full control over inverter, let me know.

2 Likes

Hi @boydo that looks super interesting, Iā€™m afraid itā€™s gone over my head a bit though. When you say Modbus and HA what are you referring to? Are you plugging in your own device to the inverter?

I have a pi that I could use for this but I donā€™t know how to connect it up to the port. Any advice you have is welcome as Iā€™ve sunk a lot of hours into this so far without any results!

Thanks @NibblyPig, my setup is using a Pi along with a USB to RS485 adaptor for the hardware and the opensource project Home Assistant loaded onto the microSD card. If you google those you should be able to pick them up and once you have Home Assistant running and I help with the config.

Alternatively I can supply one pre-configured for WIFI networking which includes the RS485 cable which connects directly into the specific Solis COM port. My details can be found at yougenerate.co.uk.

2 Likes

That sounds great!

I couldnā€™t figure out what type of connector it uses or I would have tried to build one myself. If you know, or you can supply a cable, that would be a great start. Iā€™m after the raw data, so the HA software which looks cool might be a bit overkill just to pipe it into a server/database, but I have an old pi somewhere Iā€™ve never really used that might be suitable. Iā€™m a windows dev so a bit noddy when it comes to linux, although I think somewhere I have an old stick PC so I could plug into that and write some software to talk to it, but then the other problem is understanding the communication protocolā€¦ I got the wifi stick to chinese server one figured out but I imagine it is nothing like the one it talks to the inverter with!

Happy to supply a cable, email me your details richard at yougenerate co uk.

Simon,

The cable/connector is an Exceedcon

EC04681-2014-BF

It is almost impossible to find in small quantities online.

Depending on what you want to achieve and how much effort you want to go to

  1. Leave what you have in place - posting up to the Internet on the Solis/Ginlong portal - this happens every 6 minutes.

  2. You can then run a query against the online database - extract all the details you want and then put them into a local database for further manipulation - this will give you a maximum resolution of 6 minutes. The online portal is a rebadged one from SolarMan/Igen - the Rest API is now freely available.

  3. I have a docker image that i pulled down from the Internet that does this for me and then outputs MQTT to play around with

  4. If you want to get more into the weeds - you can disassemble the Wireless Dongle - it just pops open

In there is a 4 pin connector that you can then seperate the processing board (which is a just a rebadged ESP8285) and you can either replace that board completely and just patch into the 4 wires (+ve, -ve, RS485 A+B) - or you can make a daughter board/splicer to sit in the middle - essentially the ESP8285 duaghter board is just talking to the inverter using Modbus - so you can sit your own device in the middle and send your own Modbus commands to the inverter - this gives you the best of both worlds - the online portal still whilst you get going and then local querying and control.

My plan was to use another ESP8266 unit and interface into modbus - however one of the other users i have been in touch with has already done this using a Rpi Zero and gotten the whole thing to fit back into the wireless shell - so it looks like new

Craig

@boydo Is that all live data obtained via the modbus? I have a LAN and a wifi stick and been trying, unsuccessfully to obtain local data. Would you mind sharing how you pulled all of that?

@craigcurtin do you have any details on how to piggyback the pi zero on top of the wifi/lan stick, this is the idea solution if you are able to keep using the Solis apps and also obtain live data locally into home assistant

Iā€™ve got everything plugged in now, but the inverter only gives me a message of \x00

Iā€™ve tried a couple of online python scripts that supposedly will work. Iā€™m not sure what the problem is, whether itā€™s a physical connection issue or I am doing it wrongā€¦

Could anyone advise?

Hi @sd_dracula welcome to the forums! Yes the data I am pulling into Home Assistant is live data. The setup is pi > USB to RS485 adaptor > inverter COM port.
More info on the Home Assistant config can be found at Solis Inverter Modbus integration - Configuration - Home Assistant Community (home-assistant.io)

@craigcurtin you found the socket, nice one. Any suggestions on where to buy, even in bulk? Could then make them available to others.

Do you know of anyone who managed to get full control over the Solis e.g. force charge/discharge over Modbus?

Yes you need to get a RS485 to TTL adapter - solder it to the two incoming RS485 lines on the back of the board and solder from the +ve and -ve to the appropriate pins on the RPi - then take the output from the RS485 TTL adapter into appropriate pins on the Pi Zero.

I have a basic Python sketch that was provided to me by someone else which i will check - alternatively you could load Node Red on the PI and do it all through NR

Craig

Richard,

I drilled down through Aliexpress at the time and got to the vendor - but they wanted a minimum order of 1000.

No i do not know anyone who has a hybrid Solis inverter.

However i have been told the Modbus map is the same so you should be able to control it through Modbus with no issues

Craig

Thanks Craig, will check out Aliexpress. I am running the AC RAI-3K-G5 v2 and everyone including the manufacture tells me is possible to force charge/discharge but I have not found anyone whos done it :slight_smile:

Going to try NR next.

RS485 to TTL adapter

This one works well and the price is low:

image

https://www.ebay.com/itm/TTL-to-RS485-Converter-Module-Hardware-Auto-Control-for-Arduino-AVR-3-3k3WIXIHLU-/294173815691?hash=item447e20338b

Does anyone know what I might be able to send to the rs485 device on my pi to get my inverter to do something? All it does is return \x00. Iā€™ve tried the modbus libraries, and tried sending data directly although Iā€™m not completely certain exactly what data Iā€™m supposed to send.

Itā€™s rather frustrating to say the least.