Firmware - stweil/OpenInverterGateway GitHub Wiki

Build firmware for ShineWifiX

# Prepare virtual Python environment and install platformio.
python3 -m venv venv
source venv/bin/activate
pip install -U pip setuptools wheel platformio

# Copy the default configuration. Optionally adjust the configuration.
cp SRC/ShineWiFi-ModBus/Config.h.example SRC/ShineWiFi-ModBus/Config.h

# Run build for ShineWifiX using platformio.
pio run -e ShineWifiX

The newly built firmware is in .pio/build/ShineWifiX/firmware.bin.

First results

After flashing the downloaded firmware, connect to the access point which is opened by the stick. Then open http://esp-b4321f/ with your web browser.

Read registers

Read holding registers

Read all holding registers

for reg in $(seq 0 345) $(seq 532 554) $(seq 600 612); do
  curl -d reg=$reg -d val= -d type=16b -d operation=R -d registerType=H http://esp-b4321f.lan/postCommunicationModbus_p
  echo
  sleep 1
done

Read inverter module power

curl -d reg=121 -d val= -d type=16b -d operation=R -d registerType=H http://esp-b4321f.lan/postCommunicationModbus_p

The value is 6 for MIC600, 7 for MIC750, 10 for MIC1000, 15 for MIC1500 and 20 for MIC2000.

Read input registers

1st group

for reg in $(seq 0 124); do
  curl -d reg=$reg -d val= -d type=16b -d operation=R -d registerType=I http://esp-b4321f.lan/postCommunicationModbus_p
  echo
  sleep 1
done

2nd group

for reg in $(seq 125 249); do
  curl -d reg=$reg -d val= -d type=16b -d operation=R -d registerType=I http://esp-b4321f.lan/postCommunicationModbus_p
  echo
  sleep 1
done

Write registers

Write holding register

Switch inverter off

curl -d reg=0 -d val=0 -d type=16b -d operation=W -d registerType=H http://esp-b4321f.lan/postCommunicationModbus_p

Switch inverter on

curl -d reg=0 -d val=1 -d type=16b -d operation=W -d registerType=H http://esp-b4321f.lan/postCommunicationModbus_p

Upgrade firmware "over the air" (OTA)

pio run -e ShineWifiX -t upload --upload-port esp-b4321f.lan

See also additional details.