EcoFlow API and Reverse Engineering Inverters: Telemetry, Protobuf and Logic Analyzer

Написано

в

⏱️ ~4 min read

EcoFlow API and Reverse Engineering of Inverters: Telemetry, Protobuf, and Logic Analyzer

Task

In conditions of frequent power outages (blackouts), it is important not only to monitor the charging station in real-time but also to collect telemetry data for analysis and programmatic load management. This allows automating recharging processes and energy distribution, which is especially relevant for critical infrastructure and household consumers.

Two Paths to EcoFlow

For integration with EcoFlow charging stations, there are two main approaches: using the official cloud API and local access through binary Protobuf telemetry. Let’s consider each of them.

Official Cloud API (REST + MQTT)

EcoFlow provides an official Cloud API that allows interaction with devices via REST and MQTT protocols. To ensure security, requests are signed using HMAC-SHA256.


GET /api/v1/devices HTTP/1.1
Host: api.ecoflow.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Date: Tue, 03 Oct 2023 12:34:56 GMT
x-ecoflow-signature: YOUR_SIGNATURE

Example of signature structure:


import hmac
import hashlib

def generate_signature(secret_key, date):
    message = f"{date}"
    signature = hmac.new(secret_key.encode(), message.encode(), hashlib.sha256).hexdigest()
    return signature

This method allows obtaining telemetry data and remotely managing devices, which is especially useful for monitoring multiple devices simultaneously.

Local Level Without Internet: Binary Protobuf Telemetry via UDP (Port 8554) / TCP

For local access to EcoFlow telemetry, a binary Protobuf protocol is used, transmitted over UDP or TCP on port 8554. This method allows integrating devices into local automation systems such as Home Assistant.


# Example configuration for hassio-ecoflow-cloud
[ecoflow]
host = "192.168.1.10"
port = 8554

Integration with Home Assistant allows using EcoFlow telemetry to automate home processes, such as lighting and heating control based on the station’s charge level.

«Using Protobuf for data transmission significantly reduces network load compared to text protocols.»

Reverse Engineering of Hybrid Inverter Boards (HMI ↔ BMS ↔ Power Board on EG8010 / STM32 / TI C2000)

Hybrid inverters, such as EcoFlow, use a complex architecture that includes HMI (Human-Machine Interface), BMS (Battery Management System), and power board. Reverse engineering these boards allows for a deeper understanding of their operation and optimization of performance.

Problem: Cyclic Disconnection of the Inverter When 220V is Supplied from the Grid

One common problem is the cyclic disconnection of the inverter when 220V is supplied from the grid. This can be caused by several factors, including incorrect operation of the AC detector and voltage drops in the logic part.

Debugging Method with Logic Analyzer (Saleae / PulseView)

A logic analyzer such as Saleae, combined with software like PulseView, is used for diagnosing problems. This approach allows detailed study of signals on various lines and identification of fault causes.

  • Check AC detector resistor dividers: Ensure that the resistor dividers are correctly set up and do not cause false triggers in the detection circuits.
  • Monitor voltage drops in the logic power bus (brownout): Monitoring the supply voltage of the logic part can reveal drops that lead to incorrect device operation.
  • Analyze BMS fault signal lines: Checking fault signals from BMS helps understand why the inverter disconnects. This may be related to exceeding allowable temperature or current values.

# Example command for PulseView
saleae --device=192.168.1.2 capture --protocol=pulseview --output-file=capture.saleae

This approach not only helps identify the causes of the problem but also optimizes overall device performance.

Conclusions and Safety Recommendations for Working with Power Electronics

Working with power electronics requires special attention to safety issues. Here are some key recommendations:

  • Use protective glasses and gloves when working with high-voltage components.
  • Ensure proper grounding of all devices and workstations.
  • Before starting work, make sure that all power sources are disconnected.
  • Use insulated tools to minimize the risk of electric shock.

«Safety when working with electronics is not a luxury but a necessity. Some mistakes can cost lives.»

By following these recommendations, you can avoid potentially dangerous situations and ensure safe work with power electronics.

More from the Lab
← Control Plane on DC-UPS + RTX 3090: Home AI Server Architecture for BlackoutsSecure LoRa Pager on ESP32: Text, Coordinates and Voice without Cellular Network →

Комментарии

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *