Foxess Inverter Modbus

Hi,
have been trying out all kinds of things over the last few days. All kinds of configurations, pins, different ESP boards, different RS485 to TTL boards.
I’m not using the esphome modbus component, but instead just using the UART debugger.

But there is absolutely nothing. At this point I’m really thinking the COM-port of the inverter is broken, or it just isn’t sending any data. Is there a way to find out if there is any communication directly on the A/B lines? Unfortunately I don’t have an osciloscope.

Oh man! You are not going to believe this!
Turns out the inverter goes in some kind of deep sleep over night (when there is no PV generation).
Even the Comms are disabled during this time. I’ve been testing all the time in the late evenings. Tried it out yesterday during the day and it worked instantly. It probably was working the entire time!


I want to thank @nikito7 for the very helpfull suggestions, which without those I would probably have given up a while ago. I learned a lot of RS485/Modbus basics through your help. So thanks, man!

Now i’ll start working on parsing the data and get it passed to some sensors.
At the end I’ll do a summary writeup, so that people in futere won’t have to go through this entire (chaotic) thread, where I make a lot of silly mistakes :laughing: .

2 Likes

@assembly , did you manage to come-up with something working via ESPHome or so?

Yeah, i’m currently working on it. Making good progress!
I will post here as soon as i’m finished!
Probably later this week.

I’ve done something similar with my Delta Solivia inverter, where I’m also just sniffing existing packages between my Solivia Gateway and the inverter.

I made an ESPHome modbus custom component for this.
You could take a peek at my solution if you wan’t some input :slight_smile:

Regards
Henning

1 Like

Hi Henning.

Thanks for your input!
That’s the exact same way I’ve gone about doing it. I found it by accident in another thread on this forum. And why reinvent the wheel :grinning:

I’ve got it working so far, just have to map all the values to esphome sensors. The foxess inverter is giving out some not needed datastreams, which I will have to filter out as well. But that should be easy.

You’re welcome :slightly_smiling_face:
Just no need for you to be banging your head and try to reinvent the wheel - again.
I did that, for quite a few days, until I managed to put together a working solution :wink:

Yep. I also search for a specific 6 bytes response in the uart buffer and delete first byte if there’s not a match and loop. When there’s a match, i wait until buffer is filled and parses the package.

I have currently solved this with Elfin-EW11 within Node-RED…
I understand that this is probably not the most rational way, but it works…

Function node, for example, for generate power: return { payload: msg.payload.readInt16BE(11)/1000 }; // 11 is the buffer byte number offset

TCP in node:
image

Switch node for filtering messages:
image

Entity node:

Could someone perhaps explain to me how I have to set up the EW11 or what I have to set there?

I’ve got everything setup and working via ESPHome.
I uploaded the code including a description how to setup on github.

1 Like

2 Likes

@assembly , thanks for your work.
however, I’m trying to setup it and failing. Basically, the difference with your setup is that I power it from USB and don’t connect 12V/GND from inverter, so not using buck converter. The led on rs485 adapter is always on and not getting any data. I’ve tried to comment out custom component and leave debug only, nothing comes in. P.s. inverter is running :slight_smile: Any hint would help.

Thanks!

Hi Giedrius,

have you tried swapping RX and TX? This can be done in the YAML, no need to change any wires around.
I think (but i’m not sure) it is necesary that your circuit and the inverter have a common ground. So even if you power your circuit by an external USB power supply, you should still connect the pin 5 from the inverter to the ground of your circuit. If you have a buck converter lying around i would just try powering it from the 12V from the inverter. In my oppinion that’s the neatest solution. :wink:

Are you using the same rs485 adapter as in my opening post? If so, it’s normal that the led is on all the time. This module doesn’t have any visual confirmation that data is being send.

@assembly Amazing! Works like charm on T series G3 with esp8266 and software serial on pins 4 and 5, dc-dc power from invertor’s 12V. So nice instructions to build hardware, did not even need to dig for install manual. Thank you very much! :+1: Finally can live without foxess cloud!

Great! Thanks for confirming it also works on ESP8266!

Thanks for hint. Unfortunately, that didn’t help. I’ve tried ESP32, ESP8266 (Wemos D1) and swapping multiple MAX485 adapters and even ESPs, no signal. Tried swapping RX/TX, cables, etc… even added logic level converter and powered adapter with 5V. What I didn’t try yet is to replace usb adapter/cable. Don’t have buck converter laying around to try. Even asked FoxEss to update firmware. I need to try finding adapter maybe from different batch or different model. otherwise I’m out of ideas

I have the same problem.
If I enable the UART debug output on the esp I get nothing. It seems like the inverter is not sending any data

What have you tried sofar?
I would start with swapping tx and rx. I personally always get them mixed up :slight_smile:

What’s the model of your inverter?
When was it installed?

Debug has to be enabled on two places in the yaml:

logger:
  #level: VERBOSE
  #baud_rate: 0

and:

uart:
  id: uart_bus
  tx_pin: 16
  rx_pin: 17
  baud_rate: 9600
  #debug:

It’s T10-G3, it was installed like few weeks ago. Maybe you can think of some parameter in inverter to make it work (I’ve got installer account)?