jantenhove / GoodWeLogger

ESP8266 based logger for GoodWe inverters. Can upload to pvoutput and publishes MQTT topics
GNU General Public License v3.0
98 stars 24 forks source link

GoodWe XS-serie UART RS-232 #28

Closed popoviciri closed 3 years ago

popoviciri commented 4 years ago

I've been trying for a couple of days to use this code with my small XS serie inverter. The wifi module uses a HF-LPB100 chip, which according to the user manual has a RS-232 UART interface. The USB3 pins are connected as show in the last column, here next to the standard USB3 configuration:

stdUSB Pin stdUSB Name stdUSB Direction stdUSB Color stdUSB Description Goodwe XS choice
1 VBUS red +5 V power GROUND
2 D- «—» white USB 2.0 Data - not used
3 D+ «—» green USB 2.0 Data + not used
4 GND black Ground +5 V power
5 StdA_SSRX- «— purple SuperSpeed receiver not used
6 StdA_SSRX+ «— orange SuperSpeed receiver UART Rx
7 GND_DRAIN ground Ground UART Tx
8 StdA_SSTX- —» blue SuperSpeed transmitter UART Rx
9 StdA_SSTX+ —» yellow SuperSpeed transmitter RESET

So it looks like a USB3.0 but has nothing to do with it! This is how I found the pins: image

The comparison with the standard USB connectors: image

One should not stick a standard USB device in there. Will likely break it since the standard V+ and GND are reversed. I did cut a USB cable and connected only the pins I'm interested in Rx and Tx to a ESP8266 Huzzah. I can also power the Huzzah from the reversed pins 1 and 4 and connects fine to my wifi and subsequently mqtt broker.

The serial monitor shows a bunch of these lines:

18:01:02.855 -> Sending discovery
18:01:02.855 -> Sending data to inverter(s).Sent data to inverter(s):
18:01:02.855 -> 0xAA 0x55 0xAB 0x7F 0x0 0x0 0x0 CRC high/low: 0x2 0x29 .
18:01:02.855 -> Parsing incoming data with length: 0x7 . 0xAA 0x55 0xAB 0x7F 0x0 0x0 0x0 0x2 0x29 .
18:01:02.855 -> CRC received: 0x2 0x29 , calculated CRC: 0x2 0x29 .
18:01:02.908 -> CRC match.
18:01:02.908 -> MQTT send status: 1

Obviously this is not right. Incoming data from the inverter is identical with sent packet. So, is it safe to assume that the XS series uses a different protocol than the one this application is based on? How's the data coming from the inverter supposed to look like? When sniffing the port I get only nonsense in the terminal view at all baudrates I can set. Sniffing the wifi module shows nothing in the terminal. I know this is supposed to be an issue tracker but the repo was found by multiple search engines in relation to the subject, so I post this here. Goes without saying that I do not encourage anyone to try this. I'm just looking for the obvious detail I'm missing. Thanks in advance for any feedback! Cheers!

popoviciri commented 3 years ago

Right! Thanks @ThinkPadNL for the info provided. This thread was fun to follow. Happy tweaking! Cheers!

HoyaTon123 commented 1 year ago

I have two GoodWe XS inverters, a XS2000 and a XS2500. Bought last month in NL. They also have this resistor and a description of the RS-485 pins in the manual. With the available modbus registers (which I found in this issue or at some of the related sources) I created a plugin for ESPEasy to read the values. It's working for a few days for me already. The plugin can be found here: letscontrolit/ESPEasyPluginPlayground#173 (it's not in ESPEasy yet, if someone wants a binary with the plugin integrated, let me know)

About the pinout: I used pin 3&7 for A and pin 6&8 for B. (The RS-485+ and RS-485- are a bit confusing in the manual). I removed the resistor, but it also worked with it.

Hi there, I just bought a XS-3000 but without RS-485, I realized it become a optional choose, but it was too late. But I would like to make sure it has a 485 pin just hidding inside the mother board? If so, I will open it up and try to connect it.