# paulzhdanov/esp-fossi architecture

> Architecture diagram of the GitHub repository paulzhdanov/esp-fossi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paulzhdanov/esp-fossi
- Repository: https://github.com/paulzhdanov/esp-fossi

## Overview

Fossibot F2400 is ESP32 firmware that bridges a SYDPOWER-compatible power station’s BLE/MODBUS interface to an HTTP API. Its main flow connects to Wi-Fi, synchronizes time, polls the station, parses readings and serves them to clients; it also exposes output controls. The README documents monitoring, restart scheduling, UDP debug logging, LED status, and HAA/HomeKit integration. No source excerpts were provided, so component boundaries and relationships below are based on README documentation; the firmware is a single sketch.

Main entry points: [`fossibot.ino`](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino) (ESP32 firmware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_connectivity["Connectivity"]
  node_esp32["ESP32 firmware<br/>[fossibot.ino]"]
  node_wifi["Wi-Fi connection<br/>[fossibot.ino]"]
  node_ntp["NTP time sync<br/>[fossibot.ino]"]
end

subgraph group_station["Station data"]
  node_station["Power station"]
  node_ble["BLE connection<br/>[fossibot.ino]"]
  node_polling["MODBUS polling<br/>[fossibot.ino]"]
  node_parser["Response parsing<br/>[fossibot.ino]"]
  node_power["Power source detection<br/>[fossibot.ino]"]
end

subgraph group_api["API and control"]
  node_http["REST API<br/>[fossibot.ino]"]
  node_readings["Monitoring endpoints<br/>[fossibot.ino]"]
  node_controls["Output controls<br/>[fossibot.ino]"]
end

subgraph group_operations["Operations and integrations"]
  node_scheduler["Daily restart<br/>[fossibot.ino]"]
  node_udp["UDP debug logs<br/>[fossibot.ino]"]
  node_led["Status LED<br/>[fossibot.ino]"]
end

node_client(("HTTP client"))
node_haa["HAA device"]
node_homekit["Apple HomeKit"]

node_esp32 -->|"connects"| node_wifi
node_esp32 -->|"synchronizes time"| node_ntp
node_esp32 -->|"connects"| node_ble
node_ble -->|"communicates with"| node_station
node_polling -->|"queries registers"| node_station
node_esp32 -->|"schedules polling"| node_polling
node_polling -->|"passes response"| node_parser
node_parser -->|"supports detection"| node_power
node_esp32 -->|"serves"| node_http
node_http -->|"exposes"| node_readings
node_http -->|"exposes"| node_controls
node_client -->|"requests"| node_http
node_haa -->|"polls"| node_http
node_haa -->|"presents sensors"| node_homekit
node_esp32 -->|"runs"| node_scheduler
node_scheduler -->|"uses time"| node_ntp
node_esp32 -->|"broadcasts logs"| node_udp
node_esp32 -->|"indicates status"| node_led

click node_esp32 "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_wifi "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_ntp "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_ble "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_polling "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_parser "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_power "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_http "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_readings "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_controls "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_scheduler "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_udp "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"
click node_led "https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_esp32,node_wifi,node_ntp,node_client toneBlue
class node_station,node_ble,node_polling,node_parser,node_power toneAmber
class node_http,node_readings,node_controls toneMint
class node_scheduler,node_udp,node_led toneRose
class node_haa,node_homekit toneIndigo
```

## Components

### Connectivity

- [ESP32 firmware](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [Wi-Fi connection](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [NTP time sync](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`

### Station data

- **Power station**
- [BLE connection](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [MODBUS polling](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [Response parsing](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [Power source detection](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`

### API and control

- [REST API](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [Monitoring endpoints](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [Output controls](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`

### Operations and integrations

- [Daily restart](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [UDP debug logs](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`
- [Status LED](https://github.com/paulzhdanov/esp-fossi/blob/main/fossibot.ino): `fossibot.ino`

### Other components

- **HTTP client**
- **HAA device**
- **Apple HomeKit**

## Connections

- ESP32 firmware → Wi-Fi connection: connects (evidence: `README.md`)
- ESP32 firmware → NTP time sync: synchronizes time (evidence: `README.md`)
- ESP32 firmware → BLE connection: connects (evidence: `README.md`)
- BLE connection → Power station: communicates with (evidence: `README.md`)
- MODBUS polling → Power station: queries registers (evidence: `README.md`)
- ESP32 firmware → MODBUS polling: schedules polling (evidence: `README.md`)
- MODBUS polling → Response parsing: passes response (evidence: `README.md`)
- Response parsing → Power source detection: supports detection (evidence: `README.md`)
- ESP32 firmware → REST API: serves (evidence: `README.md`)
- REST API → Monitoring endpoints: exposes (evidence: `README.md`)
- REST API → Output controls: exposes (evidence: `README.md`)
- HTTP client → REST API: requests (evidence: `README.md`)
- HAA device → REST API: polls (evidence: `README.md`)
- HAA device → Apple HomeKit: presents sensors (evidence: `README.md`)
- ESP32 firmware → Daily restart: runs (evidence: `README.md`)
- Daily restart → NTP time sync: uses time (evidence: `README.md`)
- ESP32 firmware → UDP debug logs: broadcasts logs (evidence: `README.md`)
- ESP32 firmware → Status LED: indicates status (evidence: `README.md`)
