Warning
This repository is deprecated and maintenance is reduced to a minimum.
The recommended alternative is growatt2lorawan-v2 which provides a few more features and has a much cleaner architecture.
Furthermore, the underlying LoRaWAN libraries MCCI LoRaWAN LMIC library and MCCI Arduino LoRaWAN Library seem not to be maintained any longer.
Only if you are using the Helium Network, you will have to stick with growatt2lorawan, because Helium requires LoRaWAN v1.0.X while growatt2lorawan-v2 is based on RadioLib, which implements LoRaWAN v1.1.
LoRaWAN Node for Growatt Photovoltaic Inverter Modbus Data Interface
This project can be used if you want to monitor your PV Inverter in case it is out of reach of your WiFi access point (and a WiFi repeater would not help/is not wanted) and you are not able to cover the distance with an RS485 cable. Otherwise, the original Growatt ShineWiFi-S (serial) / ShineWiFi-X (USB), the customized otti/Growatt_ShineWiFi-S or nygma2004/growatt2mqtt can be used.
👷 Work in Progress! 👷
This is a "remix" of
- matthias-bs/BresserWeatherSensorTTN (or arduino_lorawan_esp32_example if you will) - for the LoRaWAN part
and
- nygma2004/growatt2mqtt - for the Growatt PV Inverter / Modbus part
- ESP32 (optionally with LiPo battery charger and battery)
- SX1276 (or compatible) LoRaWAN Radio Transceiver
- LoRaWAN Antenna
- optional: RS485 Transceiver - 3.3V compatible, half-duplex capable (e.g Waveshare 4777 module)
- optional: USB-to-TTL converter for Debugging (e.g. AZ Delivery HW-598)
-
USB Interface
The inverter's USB port operates like a USB serial port (UART) interface at 115200 bits/s. If the length of a standard USB cable is sufficient to connect the ESP32 to the inverter (and there are no compatibility issues with the ESP32 board's USB serial interface), this is the easiest variant, because no extra hardware is needed.
As pointed out in otti/Growatt_ShineWiFi-S, only CH340-based USB-Serial converters are compatible - converters with CP21XX and FTDI chips do not work!
-
COM Interface
The inverter's COM port provides an RS485 interface at 9600 bits/s. An RS485 tranceiver is required to connect it to the ESP32.
The desired interface is selected by pulling the GPIO pin INTERFACE_SEL
(defined in settings.h
) to 3.3V or GND, respectively:
Level | Modbus Interface Selection |
---|---|
low (GND) | USB Interface |
high (3.3V/open) | RS485 Interface |
The ESP32 development board can be powered from the inverter's USB port which only provides power if the inverter is active.
No sun - no power - no transmission! 😎
But: Some ESP32 boards have an integrated LiPo battery charger. You could power the board from a battery while there is no PV power (at least for a few hours).
- MCCI Arduino Development Kit ADK by MCCI
- MCCI LoRaWAN LMIC library by Thomas Telkamp and Matthijs Kooijman / Terry Moore, MCCI
- MCCI Arduino LoRaWAN Library by Terry Moore, MCCI
- Lora-Serialization by Joscha Feth
- ESP32Time by Felix Biego
- ModbusMaster by Doc Walker
See src/settings.h
GPIO define | Description |
---|---|
INTERFACE_SEL | Modbus Interface Selection (USB/RS485) |
GPIO define | Waveshare 4777 pin |
---|---|
MAX485_DE | RSE |
MAX485_RE_NEG | n.c. |
MAX485_RX | RO |
MAX485_TX | DI |
USB-to-TTL converter, e.g. AZ Delivery HW-598
GPIO define | USB to TTL Converter |
---|---|
DEBUG_TX | RXD |
DEBUG_RX | TXD / n.c. |
Arduino App: IoT MQTT Panel
You can either edit the provided JSON configuration file before importing it or import it as-is and make the required changes in IoT MQTT Panel. Don't forget to add the broker's certificate if using Secure MQTT! (in the App: Connections -> Edit Connections: Certificate path.)
Editing IoT_MQTT_Panel_Growatt2LoRaWAN.json
Change USERNAME and PASSWORD as needed:
[...]
"username":"USERNAME","password":"PASSWORD"
[...]