diy solar

diy solar

Hacking the new Growatt WiFi-F modules

thank you @octal_ip for taking the time to create this. Also, thanks to @not-batman (#18) for the idea to use a pi. I used a pi 3b with the PL011 (https://www.abelectronics.co.uk/kb/article/1035/serial-port-setup-in-raspberry-pi-os).. Previously I had tried an FTL232 and a cheap 2102, neither could flash the esp07 successfully, but the pi had no issues.

Just a side note for anyone needing to use octal_ip firmware with an older version of influxdb (like w/ a 32bit os), comment out the line calling the influxdb client like this:
//InfluxDBClient InfluxDBclient(SECRET_INFLUXDB_URL, SECRET_INFLUXDB_ORG, SECRET_INFLUXDB_BUCKET, SECRET_INFLUXDB_TOKEN);
and replace it with this:

InfluxDBClient InfluxDBclient(SECRET_INFLUXDB_URL, SECRET_INFLUXDB_DB_NAME);
and add this to secrets.h
#define SECRET_INFLUXDB_DB_NAME "growatt"

Again, thanks to octal_ip for creating this. It is so nice to have my data flowing directly to my local server instead of the growatt servers.
 
Just wanted to add my appreciation and thanks for this thread, it has helped me enormously. I had been struggling to find clear data for the Modbus register mapping on our 2 Growatt SPF3000TL inverters. The register list near the top of this thread (p1) has been incredibly helpful.

I don't mean to veer off thread topic, but if anyone is interested in swapping notes, I'm writing ESP32 code to gather PV data from these inverters for local status display and also to send to MQTT, building on this ESP8266 code.
I'm finally able to get raw inverter data, and now working on parsing it.

Thanks again
Hi,

Please I am trying to implement same on a SPF3000TL too, please can you share your code?
 
No... that would be quite a different project. This one can write, though only to one register (inverter on/off). Reading a config and writing all values back would best be done through a different user interface.

Followup to this great info. Has anyone developed an android App around the nspanel pro to display the mqtt graphics that you are aware off?
seems like as more and more of these devices get released and the pricing model drops it may be another way to go :p
 
I use MQTT Dash to display all my data on Android devices.
I've also built a display around the ESP32-2432S032 to show all my system's data in one place. It sources the information for the Growatt and JK BMS via MQTT in realtime.

ESP32-2432S032-MQTT.jpg
 
Hi all, just sharing my recent experience working with a Growatt SPF 3500 ES and the included WiFi-F module. I have a few other solar systems already feeding their data into InfluxDB and Grafana, and wanted the new Growatt unit to do the same.

Otti’s project on GitHub provided some inspiration, however the newer generation Wifi-F module proved to be a challenge to interface with. I spent quite a while trying to communicate with the ESP8266 using a few different serial adaptors (Silicon Labs, FTDI and CH340), however all attempts were failing very quickly with various serial communication errors.

In the end I found that the SIPEX SP3232EE RS-232 transceiver on the rear of the PCB, which is also connected to the RX and TX pins of the ESP8266 was the culprit. As a workaround I tried interfacing with the SIPEX chip’s own RX and TX pins, however this didn’t work. The only solution I could find was to remove the chip from the board temporarily while I uploaded new firmware.

Once the SP3232 chip is removed, the ESP8266 is easy to work with. All the necessary pins (GND, TX, RX and GPIO-0) are broken out to a standard 0.1” through holes that a pin header can be soldered to. The chip can be placed in flash mode by shorting GPIO-0 to ground while it's reset.

I included OTA components in my firmware so any future updates could be done without a serial interface, then re-soldered the chip. From here everything worked perfectly.

Another note is that the board seems to be quite power hungry, I had it running from a good quality USB power bank, however it would reset itself during firmware updates. Powering it from a higher voltage source solved this issue. It has an onboard buck converter, so it's happy to accept well over 5v.

The end result was the Growatt reporting all its statistics into InfluxDB and Grafana, screenshots are attached. I’d be happy to upload my code to Github if anyone is interested.
I’ve also attached photos of the WiFi-F unit and each side of its PCB.


Edit 30/09/2022:
Code and updated instructions posted to GitHub. It's possible to upload the new firmware without cutting traces or removing the SP3232 chip by using a Silicon Labs CP2102 USB to UART adaptor. These are unique in that they have strong enough drivers to overcome the impedance of the SP3232 while it's in place.

I've forked octal_ip's repo and re-worked a lot of it with a focus on making the full configuration of the inverter modifiable remotely via MQTT. Currently all holding registers can be read and written. I could use help mapping the registers if anyone has already or wants to do that. There is a significant gap in what's documented in GrowattModBusProtocol.pdf and what the SPF 4-12K actually do.

I don't use InfluxDB so some of the pieces there may be broken.

It's here: https://github.com/ColtB45/ESP8266_Growatt_SPF_4000-12000T_DVM_Modbus-MQTT_Bridge for those who are interested.
 
Can you help?
See if you have that issue with my fork of the code.
You might try with '// #define verifyCerts' commented out initially so you don't have to define the certs while testing. Long-term I recommend you don't run it that way.

I've also noticed that if a lot of garbage (non-Modbus requests) has been sent out the serial, the Inverter will start not responding to 1 out of every 6 requests. The same was true when it was in a fault status.
That's remedied with a full shutdown of the inverter (PV, Battery, Util) and reboot. It only happened to me when doing development or when I had serial debugging enabled.
 
hello , I know it s 2 years gone but I still have this Problem,
I am 62 and started with Visual Studio Code and platform IO and Github just to get that SOC% into Homeassistant
and control the loads,
any help would be great!

Visual studio is hanging for ever after it urges me to commit!
what I try is to use:
on my both SPF5000es and Shine Wifi-F sticks (big white)
 
Interesting thread!
@octal_ip , you said at the beginning the shine isn't a usb device but communicates with the SPF inverters via rs232? Does it use growatt modbus protacal over the rs232 to query the inverter and do setup?
I want to make a simple embedded control to drop the charge current as the load increases when my generator is running as my load is quite variable, I'm not using the shine so would be quite happy to plug into the 'USB' port it uses.

I'm trying to use the rj45 socket with a rs485 interface but so far just get the same data out, my query changes nothing?

Cheers Geoff
 
Edit, don't worry too much, I have it talking via rs485 rj45 socket, I'll put some details on soon, ish! (Make sure you send hex from terminal 🙄)
 
Hello Guys,

I've read the posts forward and back, but i cannot find any details how to proceed with the flashing procedure.
Can someone help me out here ?
I would like to achieve one simple thing , to get mqtt data from my wifi-f to HomeAssistant ( Grid in , Solar Production ) nothing more.

Thank you,
 
Not sure if my latest pull was sucessful of not. but am troubleshooting my influx on a new system and dont need the MQTT data push.
I tried commenting out the fileds in secrets for the mqtt but then get an error on compile referring to the undefined strings.

what is the easiest way to disable the mqtt stuff pls
 
Hello Guys,

I've read the posts forward and back, but i cannot find any details how to proceed with the flashing procedure.
Can someone help me out here ?
I would like to achieve one simple thing , to get mqtt data from my wifi-f to HomeAssistant ( Grid in , Solar Production ) nothing more.

Thank you,
You need to import the code into PlatformIO, customise the values particular to your setup (most of which are in secrets.h and platformio.ini), then hit the upload button while the WiFi-F module is attached via RS232 and the ESP-07 is in serial bootloader mode (short the GPIO0 to GND while it's powered on).
This is the same process for compiling and uploading any Arduino/ESP8266 based project in PlatformIO, which is extensively documented in the PlatformIO/Espressif/Arduino documentation.
 
Last edited:
Not sure if my latest pull was sucessful of not. but am troubleshooting my influx on a new system and dont need the MQTT data push.
I tried commenting out the fileds in secrets for the mqtt but then get an error on compile referring to the undefined strings.

what is the easiest way to disable the mqtt stuff pls
Just remove #define MQTT from line 1 in main.cpp, this will disable all the MQTT functions.
 
Just remove #define MQTT from line 1 in main.cpp, this will disable all the MQTT functions.
Thats what I originally thought but I receive a heap of compile errors and then a compile failure, I had to comment out the MQTT_loop cal as well
 
Last edited:
Thats what I originally thought but I receive a heap of compile errors and then a compile failure, I had to comment out the MQTT_loop cal as well
Ah, thanks for pointing this out. I've fixed this issue in the code on GitHub so it will be properly disabled if the define is removed.
 
Another wish list, A script or addon for the mqtt population for home assistant to use the autodiscover of sensors.
I started manually entering in the payloads but am not familair enough with HA to know all the variables and icons :p
 
Back
Top