diy solar

diy solar

Hacking the new Growatt WiFi-F modules

Firstly, thanks for the development and this thread - exactly what I needed.

I would appreciate it if someone can provide a bit of assistance. I managed to flash the dongle, however, following the flash, the dongle has the green and red LEDs as solid with the blue led periodically flashing shortly. On my router it connected momentarily but then drops and stays disconnected. Any idea what this means?


------------------UPDATE-------------------------
It seems like it needs to be connected to the Inverter to enable it to connect to Wifi...
 

Attachments

  • Short video.zip
    12 MB · Views: 37
Last edited:
Firstly, thanks for the development and this thread - exactly what I needed.

I would appreciate it if someone can provide a bit of assistance. I managed to flash the dongle, however, following the flash, the dongle has the green and red LEDs as solid with the blue led periodically flashing shortly. On my router it connected momentarily but then drops and stays disconnected. Any idea what this means?


------------------UPDATE-------------------------
It seems like it needs to be connected to the Inverter to enable it to connect to Wifi...

i didn't have to have mine connected to the inverted. i did however have to power it via the usb a connection.
my computer would not see the ssid of the dongle but my phone did. as soon as it connected to my phone my primary network for local wifi were transferred over and it started working on my local wifi.
 
Hi

Did anyone get something like this working using the RJ45 - RS485 port. I would like to try using modbus with that port and keep the ShineWifi connected for now. I cant manage to get the inverter to send any info via the port. And when i do get info it is full of CRC errors
 
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.

Please can you tell me what exactly I am flashing to the Wifi stick as i see theres no .bin file within yout github files.
I am new to this stuff so please forgive me.

Also, when i pluged the wifi dongle into a usb power supply, it fried the converter - so i need to get another one...

I am using this website as a guide for flashing with a USB-UART adapter with the CP2102 Chip - https://remotexy.com/en/help/esp8266-firmware-update/

Much apprectiated

 
Please can you tell me what exactly I am flashing to the Wifi stick as i see theres no .bin file within yout github files.
...
I am using this website as a guide for flashing with a USB-UART adapter with the CP2102 Chip - https://remotexy.com/en/help/esp8266-firmware-update/
Forget everything you read on that website, none of it is relevant for compiling and uploading the firmware for these adapters.

At a high level you must:
  1. Download and install PlatformIO
  2. Create a new project for an ESP07 with the Arduino framework.
  3. Replace the contents of all the files in your PlatformIO project with the corresponding files from the GitHub repository.
  4. Update include/secrets.h to match the details of your Wi-Fi, InfluxDB and/or MQTT server.
  5. Update platformio.ini to match the COM port of your CP2102 adaptor.
  6. Connect your WiFi-F stick to a USB power source while shorting GPIO-0 to ground, and then connect your CP2102 adaptor to its TX/RX/GND pins.
  7. Use PlatformIO to compile and upload the new firmware to your WiFi-F stick.

Also, when i pluged the wifi dongle into a usb power supply, it fried the converter - so i need to get another one...
What converter?
While the WiFi-F stick uses a plysical USB plug, it's not an actual USB interface. It is, however, pin compatible with the USB standard for +5v power, so I'm not sure why anything might have been damaged by plugging it into a normal USB power supply.
 
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
 
Forget everything you read on that website, none of it is relevant for compiling and uploading the firmware for these adapters.

At a high level you must:
  1. Download and install PlatformIO
  2. Create a new project for an ESP07 with the Arduino framework.
  3. Replace the contents of all the files in your PlatformIO project with the corresponding files from the GitHub repository.
  4. Update include/secrets.h to match the details of your Wi-Fi, InfluxDB and/or MQTT server.
  5. Update platformio.ini to match the COM port of your CP2102 adaptor.
  6. Connect your WiFi-F stick to a USB power source while shorting GPIO-0 to ground, and then connect your CP2102 adaptor to its TX/RX/GND pins.
  7. Use PlatformIO to compile and upload the new firmware to your WiFi-F stick.


What converter?
While the WiFi-F stick uses a plysical USB plug, it's not an actual USB interface. It is, however, pin compatible with the USB standard for +5v power, so I'm not sure why anything might have been damaged by plugging it into a normal USB power supply.
This is the converter.

I've ordered that one again + this one: https://www.robofactory.co.za/ardui...to-ttl-uart-module-5pin-serial-converter.html

Can I do this all on a mac? Or do i need windows?

When i used that converter above, it seemed to power on the stick, so i think I was feeding power with power... hence the frying.
Thank you for your help & time. It's greatly appreciated
 
Last edited:
This is the converter.

I've ordered that one again + this one: https://www.robofactory.co.za/ardui...to-ttl-uart-module-5pin-serial-converter.html

Can I do this all on a mac? Or do i need windows?

When i used that converter above, it seemed to power on the stick, so i think I was feeding power with power... hence the frying.
Thank you for your help & time. It's greatly appreciated
Update:
#define SECRET_INFLUXDB "http://<IP address>:8086/write?db=<db name>&u=<username>&p=<password>"
#define SECRET_MQTT_SERVER "10.1.1.200"
#define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"

1. In your code, above, INFLUXDB - what ip address, db name, username & password am i putting there?
2. I will be using Home Assistant running the mqtt broker - assuming that the 'MQTT_SERVER' is the home assistant IP?
3. Inverter mode - am i creating a new topic within HA MQTT broker? (see attachment below).
4. Where do I put the Extra files within your github (Growatt-grofana, License, Mqtt.txt, platform.io)?
5. As in my screenshot below, what addons do i need to install to platfom.io to get rid of these errors?

Thank you
 

Attachments

  • Screenshot 2023-05-13 at 14.32.25.png
    Screenshot 2023-05-13 at 14.32.25.png
    90.4 KB · Views: 11
  • Screenshot 2023-05-13 at 14.36.35.png
    Screenshot 2023-05-13 at 14.36.35.png
    45.2 KB · Views: 12
Last edited:
Update:
#define SECRET_INFLUXDB "http://<IP address>:8086/write?db=<db name>&u=<username>&p=<password>"
#define SECRET_MQTT_SERVER "10.1.1.200"
#define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"

1. In your code, above, INFLUXDB - what ip address, db name, username & password am i putting there?
2. I will be using Home Assistant running the mqtt broker - assuming that the 'MQTT_SERVER' is the home assistant IP?
3. Inverter mode - am i creating a new topic within HA MQTT broker? (see attachment below).
4. Where do I put the Extra files within your github (Growatt-grofana, License, Mqtt.txt, platform.io)?
5. As in my screenshot below, what addons do i need to install to platfom.io to get rid of these errors?

Thank you & sorry for all the questions - I was only ever taught Delphi :(
 
Update:
#define SECRET_INFLUXDB "http://<IP address>:8086/write?db=<db name>&u=<username>&p=<password>"
#define SECRET_MQTT_SERVER "10.1.1.200"
#define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"

1. In your code, above, INFLUXDB - what ip address, db name, username & password am i putting there?
2. I will be using Home Assistant running the mqtt broker - assuming that the 'MQTT_SERVER' is the home assistant IP?
3. Inverter mode - am i creating a new topic within HA MQTT broker? (see attachment below).
4. Where do I put the Extra files within your github (Growatt-grofana, License, Mqtt.txt, platform.io)?
5. As in my screenshot below, what addons do i need to install to platfom.io to get rid of these errors?
6. To upload the skecth to the board, in VScode, do i just hit the upload button at the bottom left?

Thank you
 
This is the converter.

I've ordered that one again + this one: https://www.robofactory.co.za/ardui...to-ttl-uart-module-5pin-serial-converter.html
...
When i used that converter above, it seemed to power on the stick, so i think I was feeding power with power... hence the frying.
Best not to power the WiFi-F stick from your serial adapter as it probably can't provide enough current. Power the WiFi-F stick through a USB power source separately, and don't connect the +5v pin from the CP2102 serial adapter. I had a note on this in the instructions on the GitHub page.

Can I do this all on a mac? Or do i need windows?
I've not tested any of this on a Mac, but it should be a possible as long as the drivers for the CP2102 work.

Update:
#define SECRET_INFLUXDB "http://<IP address>:8086/write?db=<db name>&u=<username>&p=<password>"
#define SECRET_MQTT_SERVER "10.1.1.200"
#define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"

1. In your code, above, INFLUXDB - what ip address, db name, username & password am i putting there?
2. I will be using Home Assistant running the mqtt broker - assuming that the 'MQTT_SERVER' is the home assistant IP?
3. Inverter mode - am i creating a new topic within HA MQTT broker? (see attachment below).
4. Where do I put the Extra files within your github (Growatt-grofana, License, Mqtt.txt, platform.io)?
5. As in my screenshot below, what addons do i need to install to platfom.io to get rid of these errors?

Thank you

  1. It depends on your setup. It sounds like you're not using InfluxDB, so you can disable this completely by commenting our lines 2 and 3 in main.cpp, then the related defines in lines 3-7 of secrets.h will be ignored:
    //#define INFLUX_UDP
    //#define INFLUX_HTTP
  2. Yes, enter the details of your home assistant MQTT server.
  3. Again, it depends on your setup. Line 9 in secrets.h will define the topic name that all the inverter stats will be sent to. You should configure this to match where Home Assistant expects to find this information.
  4. These additional files are part of the GitHub documentation and aren't required for PlatformIO
  5. As long as platformio.ini is configured correctly, all the required libraries will be downloaded automatically when you first try to compile the project.

6. To upload the skecth to the board, in VScode, do i just hit the upload button at the bottom left?
Yes.
 
Best not to power the WiFi-F stick from your serial adapter as it probably can't provide enough current. Power the WiFi-F stick through a USB power source separately, and don't connect the +5v pin from the CP2102 serial adapter. I had a note on this in the instructions on the GitHub page.


I've not tested any of this on a Mac, but it should be a possible as long as the drivers for the CP2102 work.



  1. It depends on your setup. It sounds like you're not using InfluxDB, so you can disable this completely by commenting our lines 2 and 3 in main.cpp, then the related defines in lines 3-7 of secrets.h will be ignored:
    //#define INFLUX_UDP
    //#define INFLUX_HTTP
  2. Yes, enter the details of your home assistant MQTT server.
  3. Again, it depends on your setup. Line 9 in secrets.h will define the topic name that all the inverter stats will be sent to. You should configure this to match where Home Assistant expects to find this information.
  4. These additional files are part of the GitHub documentation and aren't required for PlatformIO
  5. As long as platformio.ini is configured correctly, all the required libraries will be downloaded automatically when you first try to compile the project.


Yes.
 
Last edited:
Update:
#define SECRET_INFLUXDB "http://<IP address>:8086/write?db=<db name>&u=<username>&p=<password>"
#define SECRET_MQTT_SERVER "10.1.1.200"
#define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"

1. In your code, above, INFLUXDB - what ip address, db name, username & password am i putting there?
2. I will be using Home Assistant running the mqtt broker - assuming that the 'MQTT_SERVER' is the home assistant IP?
3. Inverter mode - am i creating a new topic within HA MQTT broker? (see attachment below).
4. Where do I put the Extra files within your github (Growatt-grofana, License, Mqtt.txt, platform.io)?
5. As in my screenshot below, what addons do i need to install to platfom.io to get rid of these errors?

Thank you
Please help again :(
Compiles successfully, keep getting this error though

UPDATE: TX -> RXD on Converter & RX -> TXD on Converter
 

Attachments

  • Screenshot 2023-05-15 at 18.14.04.png
    Screenshot 2023-05-15 at 18.14.04.png
    449.1 KB · Views: 12
Last edited:
I managed to flash successfully. But for the life of me I can't get it to connect to my wifi, it flashes red then blue every couple of seconds with the green light dim on. It is a 2.4ghz network.
Please tell me what I might be doing wrong. I tried taking the'<>' out all the user defined items in secrets.h, still didn't work.
Thank you
 

Attachments

  • 2.png
    2.png
    542.9 KB · Views: 8
  • 1.png
    1.png
    500.4 KB · Views: 8
I managed to flash successfully. But for the life of me I can't get it to connect to my wifi, it flashes red then blue every couple of seconds with the green light dim on. It is a 2.4ghz network.
Please tell me what I might be doing wrong. I tried taking the'<>' out all the user defined items in secrets.h, still didn't work.
Thank you

Yep, it sounds like your stick is stuck in a reboot loop because it can't connect to your Wi-Fi.

You definitely don't need the <> characters in secrets.h, they're just placeholders. For example, if your SSID is wireless and your password is password123, the respective lines should look like this:

#define SECRET_SSID "wireless"
#define SECRET_PASS "password123"


Unrelated, but I gave a bit of wrong advice above:
Again, it depends on your setup. Line 9 in secrets.h will define the topic name that all the inverter stats will be sent to. You should configure this to match where Home Assistant expects to find this information.
The MQTT topic is actually defined on line 21 of main.cpp. You can change this to whatever suits you.
Line 9 of secrets.h is only for the inverter mode MQTT subscription which you won't use, so just leave it set to the default:
define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"
 
Last edited:
Yep, it sounds like your stick is stuck in a reboot loop because it can't connect to your Wi-Fi.

You definitely don't need the <> characters in secrets.h, they're just placeholders. For example, if your SSID is wireless and your password is password123, the respective lines should look like this:

#define SECRET_SSID "wireless"
#define SECRET_PASS "password123"


Unrelated, but I gave a bit of wrong advice above:

The MQTT topic is actually defined on line 21 of main.cpp. You can change this to whatever suits you.
Line 9 of secrets.h is only for the inverter mode MQTT subscription which you won't use, so just leave it set to the default:
define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"

Yep, it sounds like your stick is stuck in a reboot loop because it can't connect to your Wi-Fi.

You definitely don't need the <> characters in secrets.h, they're just placeholders. For example, if your SSID is wireless and your password is password123, the respective lines should look like this:

#define SECRET_SSID "wireless"
#define SECRET_PASS "password123"


Unrelated, but I gave a bit of wrong advice above:

The MQTT topic is actually defined on line 21 of main.cpp. You can change this to whatever suits you.
Line 9 of secrets.h is only for the inverter mode MQTT subscription which you won't use, so just leave it set to the default:
define SECRET_MQTT_INVERTERMODE_TOPIC "Inverter_Mode"
 
Last edited:
I still cant get it to connect

Here is my files
It looks like you've commented out line 31 in main.cpp by adding two slashes at the start of the line. This means all your settings in secrets.h won't be applied.
Remove the slashes at the start of the line (or copy/paste this whole block again from GitHub to fix up the commenting), recompile and try again.
 
It looks like you've commented out line 31 in main.cpp by adding two slashes at the start of the line. This means all your settings in secrets.h won't be applied.
Remove the slashes at the start of the line (or copy/paste this whole block again from GitHub to fix up the commenting), recompile and try again.
I hade it in like 15. But I did what you said, replaced the code from your GitHub code and still nothing?
Just the odd red and blue flashing light
 
I hade it in like 15. But I did what you said, replaced the code from your GitHub code and still nothing?
Just the odd red and blue flashing light
What channel is your WiFi running on? These ESP chips don't support channels above 11 by default. Try 1 or 6.
Are you also using WPA2 encryption?
 
It
What channel is your WiFi running on? These ESP chips don't support channels above 11 by default. Try 1 or 6.
Are you also using WPA2 encryption?
I’m running a Tenda Nova mesh system.

I’m getting new APs later today. Will try with that.

But I’m starting to think that maybe the Wi-Fi part of the chip is faulty? Would an esp32 board work with your code?

Are you in South Africa?
 
Back
Top