Code Monkey home page Code Monkey logo

goodwelogger's People

Contributors

jantenhove avatar keesv avatar sircuri avatar thinkpadnl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goodwelogger's Issues

GW25K-DT not possible ?

Hi guys !
Tried to make a connection and pass it to MQTT , but only what i receive is S/N , all parameters are 0...
status online at begining is 1 ,but then is changing also to 0.
Here is some debug from telnet , hope you can give some advice:

EDIT:After service intervention this way of communication is not possible any more , but works standard Modbus reads starting from adress 768 there are data availble now...

RS485 communication

Hi.
I have a problem getting this to work, since the SS series inverter I work with is running serial data in via RJ45 connectors. Given the documentation, I believe it is running full duplex, hence this isn't gonna work.
However, I can get this to work with a Raspberry Pi in the Python fork of your script here.
That made me wonder, would it be possible to use a uart tll to USB board to communicate that way? I'm really not at home in the serial communication, but been working a lot with ESP32's.

Is this code tested on a "XS" series inverter?

Hai,

Just wondering if this code has been tested on a "XS" series inverter. My wifi connections of the XS keeps failing and I would like to use the RS485. Just wondering if the coding of the data is the same.

Greetings Matthijs

Time is requested over NTP every minute, overkill?

I was sniffing with tcpdump on my network, when i found out that the GoodWeLogger is requesting time over NTP every minute.

Proof:

me@EdgeRouterX:~$ sudo tcpdump dst port 123 -i switch0.6                                                                                                 
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on switch0.6, link-type EN10MB (Ethernet), capture size 262144 bytes
10:51:40.521114 IP 192.168.6.27.1337 > <redacted-for-privacy-of-server-owners>.ntp: NTPv4, Client, length 48
10:52:40.516794 IP 192.168.6.27.1337 > <redacted-for-privacy-of-server-owners>.ntp: NTPv4, Client, length 48
10:53:40.521509 IP 192.168.6.27.1337 > <redacted-for-privacy-of-server-owners>.ntp: NTPv4, Client, length 48
10:54:40.523239 IP 192.168.6.27.1337 > <redacted-for-privacy-of-server-owners>.ntp: NTPv4, Client, length 48
10:55:40.517112 IP 192.168.6.27.1337 > <redacted-for-privacy-of-server-owners>.ntp: NTPv4, Client, length 48

I know these IoT devices (ESP8266) are prone to timedrift because they have no realtime clock (RTC) but every minute seems like a bit overkill to me. Shouldn't once per hour also be enough?
For now i redirected the NTP-requests with a DNAT rule in my router (EdgerouterX) so that the router answers these queries (it offers NTP) instead of forwarding them to external NTP-servers.

P.S. The NTP-address isn't configurable right now from the Settings.h , maybe change that also when looking into this. It is now hardcoded in GoodWeLogger.ino line 24

GW25K-MT

Hello!
I am trying to use this code using ESP32. I have a doubt related to the pin conection of a MAX485 converter.
On the file settings.h I do not found the "transmit enable" pin for configuration (only RX and TX).
The MAX485 converter has the RE / DE pins to define the communication direction.
Could someone help with that?
Thank you!

Compiling error for debug.h

Hello,

While compiling for a wemos d1 pro, and other esp8266 there is an error;

'class RemoteDebug' has no member named 'isRunning'

MQTT data stays on latest value when inverter is offline

The MQTT data like vpv and vac stay on the latest value when the inverter goes offline.

It would be nice to show the real data and after a time-out the data will be zero.

Also the daily generated value should be reset at night for convenience.
Now it shows the data from the day before and resets when the inverter boots up.

PVOutput broken?

It looks like PVOutput is broken.

Last update I had was april 30th and never checked the data after that date. On that day I have updated the code with the version from april 23rd and after that it looks like the upload to PVOutput does not function anymore.

Now running on the latest version also does not upload data.
MQTT is working fine in the last version.

Setting up export limit?

Hello,

I want to set a export power limit by mqtt. Can anyone tell me how to do this?

Greetings Johannes

Set Modbus address

I am new to Arduino, please can you help?
My Goodwe inverter has the option to Set Modbus Address. By default it is set to 247. Please can you advise if this is correct? I noticed the code sends data to 0x7F which is 127 but 247 is 0xF7.

void GoodWeCommunicator::sendDiscovery() { //send out discovery for unregistered devices. if(debugMode) Serial.println("Sending discovery"); sendData(0x7F, 0x00, 0x00, 0x00, nullptr); }

No output from logger

I've got a GW-3600D-NS, hooked it up and no output to MQTT except for goodwe = online.

Ouput on the remote debug:

(D) Sending discovery
(D) Sending data to inverter(s).Sent data to inverter(s):
(D) 0xAA 0x55 0xAB 0x7F 0x0 0x0 0x0 CRC high/low: 0x2 0x29 .
(D) MQTT send status: 1
(D) Sending discovery
(D) Sending data to inverter(s).Sent data to inverter(s):
(D) 0xAA 0x55 0xAB 0x7F 0x0 0x0 0x0 CRC high/low: 0x2 0x29 .
(D) MQTT send status: 1

Any suggestions on how to resolve this? Or what I did wrong? Blinking pattern suggests WIFI Router Problem

Daylight saving time error in PVoutput posts

After the change in DST the posts to PVoutput keeps posting the old datetime.

For example: last weekend DST ended, correct datetime for me is UTC+1.
But PVoutput receives UTC+2, and thereby show the data in the live chart 1 hour in the future.
Screenshot taken at 11:30

pv_output_1130

Workaround probably is to reset the board, but you need to do this before/after power is generated, otherwise PVoutput wil receive multiple data for the same datetime

Analysis of original wifi-module to find powersource for ESP8266

I am investigating if it is possible to feed the ESP8266 and RS485-TTL-converter from the power that the inverter offers for the original wifi-module, instead of using an external USB-powersupply.

I carefully opened the original Goodwe wifi-module, it resembles a PCB ("190-00069-00") with a Rakwireless RAK41X module (P/N: 151-30028-00). According to a sticker on the module it uses RAK496.
RAK41X_Goodwe

With some Googling i found this interesting page which has pictures and wifi certification stuff about the chip, but also the datasheet of the chip (should the page go offline, i saved a copy of the datsheet here User-manual-2799522.pdf.

What i was interested in, is the voltage that the chip needs to work. It needs 3.3V according to the datasheet. On the PCB we see a TO-252 package, i suspect that this is a voltage regulator (haven't found datasheet yet). Following the traces to the white connector, i found out that power is supplied through pins 1 and 2. When measuring on the Goodwe while it is active, it supplies +5V on pin 1 and the GND is on pin 2.

I will investigate some more on the voltage converter, to find out if the Goodwe would be capable of powering our ESP8266's.

Some additional information: apparently the protocol that the wifi-module uses to talk with the inverter is SPI according to the datasheet. I think it uses pin 3, 4 and 5 for that. It is a bit unclear which pin does what. It looks like pin 4 is MISO but not sure. I will not investigate this further, as we already have working communications over RS485. I am just writing it down here, in case someone else could need it.

To be continued.

GoodWe XS-serie UART RS-232

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!

Getting E-Total [solved]

Hi

This works great on my GW10KN-DT to MQTT but I would also like to get the E-Total but so far not successful. Main trouble is your code is far too clever for me and I don't really understand it, but this is what I did so far:

set isDTseries to true so am getting all values correctly
added some new vars and mqtt topic lines, and I am getting new data...

in goodWeCommunicator.cpp starting about line 346

//TODO: Get the other values too
// inverter->temp = bytesToFloat(data + dtPtr, 10);   dtPtr += inverter->isDTSeries ? 34 : 26; //orig
//new other values below
inverter->temp = bytesToFloat(data + dtPtr, 10); dtPtr += 2;
dtPtr += 4;  //skip over error msg H & L
inverter->etoth = bytesToFloat(data + dtPtr, 10);    dtPtr += 2;
inverter->etotl = bytesToFloat(data + dtPtr, 10);    dtPtr += 2;
inverter->htoth = bytesToFloat(data + dtPtr, 10);    dtPtr += 2;
inverter->htotl = bytesToFloat(data + dtPtr, 10);    dtPtr += 2;
dtPtr += inverter->isDTSeries ? 20 : 12 ; //skip over next fault messages
//new other values above
inverter->eDay = bytesToFloat(data + dtPtr, 10);

I realise that h & l must be combined somehow into the vars eTotal and hTotal you already provided but I thought I would start by just replicating your code to see what I got but the resulting data makes no sense:
etoth = 0.0
etotl = 504.5
Inverter screen shows 7401.6 kWh

Help so I can get the proper values would be most welcome!

Regards

Richard

GW3000-SS

I have the inverter without wifi module so this project is perfect for me.
Thanks for making it possible.

I have some issues.
First I can't figure out witch of these wires of my inverter going to the "TTL to RS485" board.
Screen Shot 2020-12-26 at 15 29 14

Second
How should the LEDs on the TTL board blinks? My RX is steady and my TX flashes for every 10 seconds I think

Last:
Which pins are the right ones on the NodeMCU boards?
The label on the boards says D1 and D2 but I'm not sure.
NodeMCU-V3-2

Sorry for all the noob questions but I don't know where else to go.
Best regards
Soren

Powering the ESP8266

Hi @jantenhove ,

Firstly - great project - works brilliantly. Now have all my solar values going into home assistant which then get logged to grafana - so can do some nice visuals & do automations based on generation etc.

I have a question though - how do you power your esp8266? I tried connecting a usb cable to my GW3600D-NS's USB port and into the d1 mini but no juice appears from the USB port. How best to power it? Or should I be getting power through the uart?

Cheers!

Dan

Inverter Data to Serial Port

Build the GoodweLogger today and it basically run direct as expected. I'm not interested into posting the data on PVOutput, so I left all those items blank and data is visible as it should, in the serial monitor, with the necessary HEX codes of course. My question is how can I make the data readable in the serial port. Obviously I looked into the code, tried some things but mostly lead to not being able to get the data anymore. Is there a way to take the data from the handlingincoming data from the goodewelogger.cpp?

Looking forward to hear from you.

Crashes after running for 1-2 hours

At first it seem to work fine, however I noticed now that several times that it crashes. I'm using a NodeMCU v2: https://opencircuit.nl/Product/NodeMcu-v2-Lua-ESP-12E-WIFI-Development-Board and the board NodeMCU v1 (ESP-12E Module) and ESP8266 2.4.2. (Because it doesn't seem to compile on version > 2.4.2).

Do you maybe have any suggestions what could be causing this?
output2.log

12:38:23.923 -> CRC received: 0xA 0xFE , calculated CRC: 0xA 0xFE .
12:38:23.923 -> CRC match.
12:38:24.776 -> Sending data to inverter(s): 0xAA 0x55 0xAB 0x1 0x1 0x1 0x0 CRC high/low: 0x1 0xAD .
12:38:24.898 -> Parsing incoming data with length: 0x43 . 0xAA 0x55 0x1 0xAB 0x1 0x81 0x3C 0x9 0x48 0x8 0x17 0x0 0x3E 0x0 0x40 0x9 0x77 0x0 0x73 0x13 0x87 0xA 0x86 0x0 0x1 0x1 0x4C 0x0 0x0 0x0 0x0 0x0 0x0 0x18 0x39 0x0 0x0 0x4 0xC2 0x3 0xF2 0x0 0x0 0x0 0xC8 0x9 0x60 0xE 0x8F 0x0 0x14 0x0 0x27 0x1 0x3 0xF 0x3 0x24 0x1D 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0xA 0x36 .
12:38:24.898 -> CRC received: 0xA 0x36 , calculated CRC: 0xA 0x36 .
12:38:24.946 -> CRC match.
12:38:25.800 -> Sending data to inverter(s): 0xAA 0x55 0xAB 0x1 0x1 0x1 0x0 CRC high/low: 0x1 0xAD .
12:38:25.882 -> Parsing incoming data with length: 0x43 . 0xAA 0x55 0x1 0xAB 0x1 0x81 0x3C 0x9 0x38 0x7 0xFF 0x0 0x40 0x0 0x3F 0x9 0x76 0x0 0x73 0x13 0x87 0xA 0x8A 0x0 0x1 0x1 0x4D 0x0 0x0 0x0 0x0 0x0 0x0 0x18 0x39 0x0 0x0 0x4 0xC2 0x3 0xF2 0x0 0x0 0x0 0xC8 0x9 0x60 0xE 0x8E 0x0 0x14 0x0 0x27 0x1 0x3 0xF 0x3 0x24 0x1F 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0xB 0x13 .
12:38:25.923 -> CRC received: 0xB 0x13 , calculated CRC: 0xB 0x13 .
12:38:25.923 -> CRC match.
12:38:26.795 -> Sending data to inverter(s): 0xAA 0x55 0xAB 0x1 0x1 0x1 0x0 CRC high/low: 0x1 0xAD .
12:38:26.905 -> Parsing incoming data with length: 0x43 . 0xAA 0x55 0x1 0xAB 0x1 0x81 0x3C 0x9 0x5D 0x8 0x3 0x0 0x3E 0x0 0x41 0x9 0x78 0x0 0x73 0x13 0x86 0xA 0x8B 0x0 0x1 0x1 0x4D 0x0 0x0 0x0 0x0 0x0 0x0 0x18 0x39 0x0 0x0 0x4 0xC2 0x3 0xF2 0x0 0x0 0x0 0xC8 0x9 0x60 0xE 0x8A 0x0 0x14 0x0 0x27 0x1 0x3 0xF 0x3 0x24 0x21 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0xA 0x3D .
12:38:26.956 -> CRC received: 0xA 0x3D , calculated CRC: 0xA 0x3D .
12:38:26.956 -> CRC match.
12:38:27.826 -> Sending data to inverter(s): 
12:38:35.049 ->  ets Jan  8 2013,rst cause:4, boot mode:(3,7)
12:38:35.095 -> 
12:38:35.095 -> wdt reset
12:38:35.095 -> load 0x4010f000, len 1384, room 16 
12:38:35.095 -> tail 8
12:38:35.095 -> chksum 0x2d
12:38:35.095 -> csum 0x2d
12:38:35.095 -> vbb28d4a3
12:38:35.095 -> ~ld
12:38:35.197 -> Booting
12:38:35.249 -> Connecting to WIFI...

Another crash:

12:56:55.307 -> Parsing incoming data with length: 0x43 . 0xAA 0x55 0x1 0xAB 0x1 0x81 0x3C 0x9 0x79 0x8 0x70 0x0 0x45 0x0 0x43 0x9 0x7C 0x0 0x7E 0x13 0x88 0xB 0xBB 0x0 0x1 0x1 0x5E 0x0 0x0 0x0 0x0 0x0 0x0 0x18 0x41 0x0 0x0 0x4 0xC3 0x3 0xF2 0x0 0x0 0x0 0xC8 0x9 0x60 0xE 0x94 0x0 0x14 0x0 0x2F 0x1 0x3 0xF 0x3 0x37 0x0 0x0 0x0 0x0 0x0 0x0 0x8 0x0 0x0 0xB 0x2F .
12:56:55.307 -> CRC received: 0xB 0x2F , calculated CRC: 0xB 0x2F .
12:56:55.307 -> CRC match.
12:56:56.083 -> Sending discovery
12:56:56.083 -> Sending data to inverter(s): 0xAA 0x55 0xAB 0x7F 0x0 0x0 0x0 CRC high/low: 0x2 0x29 .
12:56:57.097 -> Sending data to inverter(s): 0xAA 0x55 0xAB 0x1 0x1 0x1 0x0 CRC high/low: 0x1 0xAD .
12:57:04.297 -> 
12:57:04.297 ->  ets Jan  8 2013,rst cause:4, boot mode:(3,7)
12:57:04.297 -> 
12:57:04.297 -> wdt reset
12:57:04.297 -> load 0x4010f000, len 1384, room 16 
12:57:04.297 -> tail 8
12:57:04.297 -> chksum 0x2d
12:57:04.297 -> csum 0x2d
12:57:04.297 -> vbb28d4a3
12:57:04.297 -> ~ld
12:57:05.318 -> Booting
12:57:05.318 -> Connecting to WIFI...
12:57:05.451 -> ....Ready
12:57:09.263 -> IP address: 

RS485 converter requires a h/l signal to switch between transmit and receive

I have the software poliing out and I have a LC-Electronics MAX485CSA TTL level RS-485 and RS-485 serial communication converter module connected but it has two pins that are et either high or low depending on whether in TX or RX mode.

Have you come across this before and can I add another data output to control the state into your code?
I have TLW1000NSU Goodwe inverter and Wifi doesnt work to portal, usb works to EZ Explorer but really want to get the local data into MQTT.

All help appreciated.

4pin header
    DI - Driver in (the transmitter pin)
    DE - Driver enable (enabled when this pin is HIGH)
    RE - Receiver enable (enabled when this pin is LOW)
    RO - Receiver out
4pin header
    VCC (+5VDC)
    B - Connect to pin B of the other 485 IC
    A - Connect to pin A of the other 485 IC
    GND (-)
Screw terminal block
    B - Connect to pin B of the other 485 IC
    A - Connect to pin A of the other 485 IC

image

CRC calculator

Does anyone know online CRC generator ? Till now i havn't found any siutable to that goodwe , Bytes AA 55 01 AB 00 81 00 on all of them not giving CRC 02 2C ...

Not an issue

Hello, not an issue but I wanted to get in touch and ask you a few questions about this logger via email.

Thanks!

GW8K-DT inverter

This is a very interesting project, thankt for all the information.
I own since last week a Goodwe GW8K-DT but the connections are completely different from what I see in this project.
and non of the manuals I found is completly concurrent with my hardware. On the front I have the 2 line LCD display with only ONE button. On the bottom I have this.
2021-01-23 17 14 51
In the USB port is a usb-wifi dongle which opens the route to the SEMS portal and my information is loaded there.
the other two COM connectors shoud ben RS485 but why is one of them bridged whith a jumper?

I'd rather not dig into the ESP route but I'd rather use a RS485 to Ethernet converter and run the programs on my Pi 4B.
does anyone has experiance with this route?

Error in SoftwareSerial during compiling

When compiling the latest master I get the following error for the SoftwareSerial dependency:

In file included from sketch\GoodWeCommunicator.h:3:0,

                 from sketch\GoodWeCommunicator.cpp:1:

C:\Users\X\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\SoftwareSerial\src/SoftwareSerial.h:113:2: error: 'ssize_t' does not name a type

  ssize_t m_swsInstsIdx = -1;

  ^

I am using the latest version of the Arduino IDE (1.8.10), as well as all dependent libraries mentioned in the README.

As you can see, the version of the SoftwareSerial library that is used is part of 2.5.2 of the esp8266 package. Compiling an older commit does work, for example, this fork.

Randomly stops sending data

Logger randomly stops sending data to mqtt and PVoutput.
Some days there are no problems at all, and some days its really bad .

  • mqtt broker gives error: Socket error on client GoodWeLogger-303e, disconnecting.
  • PVoutput shows dip: LINK

I tried to watch for errors in the debug output from the logger, but due to its randomness i didn't encounter any problems at the time.

The wifi signal strength inst the problem, the logger / inverter has a direct line of sight to the AP 6m away.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.