ESP8266 firmware that converts Modbus RTU (from Growatt inverter) to Modbus TCP for home automation integration.
This firmware turns a ShineWiFi-X stick into a Modbus TCP gateway, enabling home automation systems like Homey, Home Assistant, or OpenHAB to read real-time data from Growatt solar inverters.
Key Features:
- π Modbus RTU Master (reads from Growatt inverter via USB/Serial)
- π Modbus TCP Server (serves data over WiFi network)
- β‘ Low latency - optimized for ESP8266 performance
- π Protocol 1.20 support (TL-X series inverters)
- π§ Serial setup menu (button + USB terminal for WiFi and Modbus settings)
- ShineWiFi-X stick (ESP8266 ESP-07S based)
- 1MB flash, 80MHz CPU
- USB-to-Serial (CH340) interface
- Growatt Inverter with Modbus support
- Tested with: 600TL-X (115200 baud, protocol v1.20)
- Should work with: TL-X, TL3-X, MIC series
The gateway reads and publishes the following registers via Modbus TCP:
- Inverter status
- DC input power, voltage, current (PV1, PV2)
- AC output power (total + per phase)
- Grid voltage, current, frequency
- Temperature
- Energy produced today (kWh)
- Total energy produced (kWh)
- PlatformIO (IDE or CLI)
- USB cable for flashing
-
Clone the repository
git clone https://github.com/jochemkroon/GrowattModbusTCP.git cd GrowattModbusTCP -
Configure WiFi credentials
WiFi and Modbus settings are configured via the serial setup menu (no code edit required).
-
Build and upload
# Using PlatformIO CLI pio run -e ModbusTCP-Gateway --target upload # Or use VSCode PlatformIO extension # Click "Upload" in the PlatformIO toolbar
-
Connect to inverter
- Disconnect ShineWiFi-X from computer
- Plug into Growatt inverter USB port
- The stick will connect to WiFi and start serving Modbus TCP
Use this flow to configure WiFi and network settings:
- Connect the ShineWiFi-X stick to USB.
- Open a serial monitor at
115200baud. - Reset/power-cycle the stick.
- During boot, when you see
Checking button..., hold the hardware button for 5 seconds. - Wait for
CONFIG MODE ACTIVATED!and the menu. - Use menu options:
1set WiFi SSID2set WiFi password3toggle static IP on/off4,5,6set IP, gateway, subnet7,8,9set Modbus ID, baud, TCP portSsave and restartRrestore defaults and restartXexit without saving
After restart, the gateway boots with the saved settings.
Default configuration in code:
#define DEFAULT_MODBUS_RTU_SLAVE_ID 1
#define DEFAULT_MODBUS_RTU_BAUD 115200#define DEFAULT_MODBUS_TCP_PORT 502#define READ_INTERVAL 30 // seconds- Install "SolarEdge + Growatt TCP modbus" app
- Add device with these settings:
- IP Address: 192.168.1.100 (your static IP)
- Port: 502
- Modbus ID: 1
- Poll Interval: 30-60 seconds
| Register | Data Point | Type | Multiplier | Unit |
|---|---|---|---|---|
| 0 | Inverter Status | 16-bit | 1 | - |
| 1-2 | DC Power Total | 32-bit | 0.1 | W |
| 3 | PV1 Voltage | 16-bit | 0.1 | V |
| 5-6 | PV1 Power | 32-bit | 0.1 | W |
| 35-36 | AC Power Total | 32-bit | 0.1 | W |
| 37 | Grid Frequency | 16-bit | 0.01 | Hz |
| 38 | AC Voltage L1 | 16-bit | 0.1 | V |
| 40-41 | AC Power L1 | 32-bit | 0.1 | W |
| 53-54 | Energy Today | 32-bit | 0.1 | kWh |
| 55-56 | Energy Total | 32-bit | 0.1 | kWh |
- Green (GPIO0): Inverter communication OK
- Red (GPIO2): Communication error
- Blue (GPIO16): WiFi activity
- RAM: ~30KB (36.8% of 80KB)
- Flash: ~320KB (33.4% of 958KB)
- Static IP recommended for reliability
- Modbus TCP uses standard port 502
- WiFi reconnect on connection loss
Based on Growatt Modbus Protocol v1.20 for TL-X series inverters.
- Enter setup mode via button + serial menu and verify SSID/password
- If static IP is enabled, verify IP/gateway/subnet values
- Use
Rin the serial menu to restore defaults and reconfigure
- Verify inverter Modbus settings (slave ID, baud rate)
- Check USB connection (try different cable)
- Monitor serial output during boot
- Verify Homey is configured for register 35-36 (AC Power)
- Check if inverter is actively producing (daylight, grid connected)
- Test with manual Modbus TCP client tool
Growatt_ShineWiFi-X-master/
βββ SRC/
β βββ GrowattModbusTCP.ino # Main firmware
βββ platformio.ini # PlatformIO config
βββ README.md
- ModbusMaster v2.0.1 - Modbus RTU client
- modbus-esp8266 v4.1.0 - Modbus TCP server
MIT License.
- Based on Growatt_ShineWiFi-X hardware documentation
- Growatt Modbus protocol definitions (v1.20, v1.24, v3.05)
For issues specific to this Modbus TCP gateway, please open an issue on GitHub.
For general Growatt inverter questions, consult the official Growatt documentation.