Skip to content

matthias-bs/growatt2radio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

growatt2radio

CI GitHub release License: MIT

Point-to-point transmission of PV inverter data via 868 MHz radio signal to MQTT client with WiFi interface.

  • Transmitter: Connection to PV inverter via Modbus interface (USB or RS-485)
  • Radio transmission via 868 MHz ISM band; FSK modulation; max. range: ~150 m
  • Revceiver: MQTT client with WiFi interface
growatt2radio_architecture

growatt2lorawan-v2 worked totally fine for quite a while, but now my LoRaWAN node cannot communicate with any public gateway (The Things Network or Helium Network) any more from its present location. Presumably a new building and/or its scaffolding within line-of-sight between node and TTN gateway are blocking the radio signal path. This project is a workaround by using point-to-point transmission.

The implementation is based on a few existing projects.

Contents

Hardware Requirements

  • ESP32 (optionally with LiPo battery charger and battery)
  • SX1276 or SX1262 (or compatible) LoRaWAN Radio Transceiver
  • 868 MHz Antenna
  • Transmitter
    • 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)

Hardware Example (Transmitter)

firebeetle_esp32+cover_lora

  • DFR0478 - FireBeetle ESP32 IoT Microcontroller
  • TEL0125 - LoRa Radio 868MHz - FireBeetle Covers
  • 868 MHz Antenna

Inverter Modbus Interface Options

  1. 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!

  2. 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.

Modbus Interface Select Input

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

Power Supply

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).

Pinning Configuration

See src/growatt_cfg.h

Modbus Interface Selection

GPIO define Description
INTERFACE_SEL Modbus Interface Selection (USB/RS485)

Modbus via RS485 Interface

GPIO define Waveshare 4777 pin
MAX485_DE RSE
MAX485_RE_NEG n.c.
MAX485_RX RO
MAX485_TX DI

Debug Interface in case of using Modbus via USB Interface (optional)

USB-to-TTL converter, e.g. AZ Delivery HW-598

GPIO define USB to TTL Converter
DEBUG_TX RXD
DEBUG_RX TXD / n.c.

Library Dependencies

Software Build Configuration

MQTT Integration

IoT MQTT Panel Example

Arduino App: IoT MQTT Panel

growatt2radio_iot_mqtt_panel

You can either edit the provided IoT MQTT Panel 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 scripts/iot_mqtt_panel_growatt2radio.json

Change CONNECTIONNAME, YOURMQTTBROKER, USERNAME and PASSWORD as needed:

[...]
"connectionName": "CONNECTIONNAME",
"host": "YOURMQTTBROKER",
[...]
"username":"USERNAME","password":"PASSWORD"
[...]

Datacake Integration

See Datacake MQTT Integration Documentation.

scripts/datacake_uplink_decoder.js is an example payload decoder. Change device_id and the MQTT topic variables as required.

With Datacake, you can get data reports as CSV files at regular intervals.

Home Assistant Integration

See scripts/home_assistant_configuration.yaml

growatt2radio_home_assistant

Concept draft

Transmitter

Receiver

Legal

This project is in no way affiliated with, authorized, maintained, sponsored or endorsed by Growatt or any of its affiliates or subsidiaries.

About

868 MHz (FSK) radio transmission of PV inverter Modbus interface data to MQTT client (WiFi)

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks