# esp-cpp/espp architecture

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

- Interactive diagram: https://gitdiagram.com/esp-cpp/espp
- Repository: https://github.com/esp-cpp/espp

## Overview

ESPP is a collection of reusable C++ components for ESP-IDF, plus a portable subset usable from desktop C++ and Python. The typical workflow is that an application selects components, calls their APIs to interact with hardware or protocols, and consumes resulting data or services. The tree shows board-support packages, peripheral drivers, communication and application services, and portable protocol and utility libraries; it does not establish a single repository-wide runtime pipeline. Edges below are limited to documented usage and sampled implementation details; many component-to-component relationships are therefore omitted.

Main entry points: [`components/esp-box`](https://github.com/esp-cpp/espp/tree/main/components/esp-box) (Board Packages), [`components/ota/python/espp_ota/cli.py`](https://github.com/esp-cpp/espp/blob/main/components/ota/python/espp_ota/cli.py) (OTA Host Tool), [`components/rtsp/src/rtsp_client.cpp`](https://github.com/esp-cpp/espp/blob/main/components/rtsp/src/rtsp_client.cpp) (RTSP Client), [`components/esp32-p4-eth`](https://github.com/esp-cpp/espp/tree/main/components/esp32-p4-eth) (ESP32-P4 Boards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_boards["Board Support"]
  node_boardpacks["Board Packages"]
  node_p4boards["ESP32-P4 Boards"]
  node_lilygo["LilyGo T5"]
end

subgraph group_hardware["Hardware Components"]
  node_drivers["Peripheral Drivers"]
  node_i2c["I2C"]
  node_adc["ADC"]
  node_motors["Motor Control"]
  node_controller["Controller Input"]
  node_display["Display Stack"]
end

subgraph group_services["Services and Protocols"]
  node_event["Event Manager<br/>[event_manager.cpp]"]
  node_ble["BLE Services"]
  node_ftp["FTP"]
  node_ota["OTA Service<br/>[ota_service.hpp]"]
  node_canopen["CANopen Client<br/>[canopen_client.hpp]"]
  node_otahost["OTA Host Tool<br/>[cli.py]"]
end

subgraph group_portable["Portable Libraries"]
  node_rtsp["RTSP Client<br/>[rtsp_client.cpp]"]
  node_rtps["RTPS<br/>[Domain.hpp]"]
  node_serialization["Serialization<br/>[cdr.hpp]"]
  node_streamcodec["Stream Codecs<br/>[cobs_stream.hpp]"]
  node_mathfilters["Math and Filters<br/>[kalman_filter.hpp]"]
  node_filesystem["File System<br/>[file_system.hpp]"]
  node_task["Task Runtime"]
end

node_developer(("Application Developer"))
node_rtspserver(("RTSP Server"))
node_canbus(("CAN Bus"))
node_espidf["ESP-IDF Hardware APIs"]
node_pythonuser(("Python User"))

node_developer -->|"selects components"| node_boardpacks
node_boardpacks -->|"access hardware"| node_espidf
node_p4boards -->|"access hardware"| node_espidf
node_lilygo -->|"access hardware"| node_espidf
node_drivers -->|"access peripherals"| node_espidf
node_controller -->|"reads GPIO"| node_espidf
node_event -->|"starts subscriber tasks"| node_task
node_ftp -->|"reads and writes"| node_filesystem
node_rtspserver -->|"serves stream to"| node_rtsp
node_rtsp -->|"requests stream"| node_rtspserver
node_canbus -->|"delivers frames"| node_canopen
node_pythonuser -->|"runs tool"| node_otahost
node_otahost -.->|"sends OTA data"| node_ota

click node_boardpacks "https://github.com/esp-cpp/espp/tree/main/components/esp-box"
click node_p4boards "https://github.com/esp-cpp/espp/tree/main/components/esp32-p4-eth"
click node_lilygo "https://github.com/esp-cpp/espp/tree/main/components/lilygo-t5-47"
click node_drivers "https://github.com/esp-cpp/espp/tree/main/components/ads1x15"
click node_i2c "https://github.com/esp-cpp/espp/tree/main/components/i2c"
click node_adc "https://github.com/esp-cpp/espp/tree/main/components/adc"
click node_motors "https://github.com/esp-cpp/espp/tree/main/components/motor_controller"
click node_controller "https://github.com/esp-cpp/espp/tree/main/components/controller"
click node_display "https://github.com/esp-cpp/espp/tree/main/components/display"
click node_event "https://github.com/esp-cpp/espp/blob/main/components/event_manager/src/event_manager.cpp"
click node_ble "https://github.com/esp-cpp/espp/tree/main/components/ble_gatt_server"
click node_ftp "https://github.com/esp-cpp/espp/blob/main/components/ftp/include/ftp_client_session.hpp"
click node_ota "https://github.com/esp-cpp/espp/blob/main/components/ota/include/ota_service.hpp"
click node_canopen "https://github.com/esp-cpp/espp/blob/main/components/canopen/include/canopen_client.hpp"
click node_rtsp "https://github.com/esp-cpp/espp/blob/main/components/rtsp/src/rtsp_client.cpp"
click node_rtps "https://github.com/esp-cpp/espp/blob/main/components/rtps/include/rtps/entities/Domain.hpp"
click node_serialization "https://github.com/esp-cpp/espp/blob/main/components/cdr/include/cdr.hpp"
click node_streamcodec "https://github.com/esp-cpp/espp/blob/main/components/cobs/include/cobs_stream.hpp"
click node_mathfilters "https://github.com/esp-cpp/espp/blob/main/components/filters/include/kalman_filter.hpp"
click node_filesystem "https://github.com/esp-cpp/espp/blob/main/components/file_system/include/file_system.hpp"
click node_task "https://github.com/esp-cpp/espp/tree/main/components/task"
click node_otahost "https://github.com/esp-cpp/espp/blob/main/components/ota/python/espp_ota/cli.py"

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_boardpacks,node_p4boards,node_lilygo,node_pythonuser toneBlue
class node_drivers,node_i2c,node_adc,node_motors,node_controller,node_display toneAmber
class node_event,node_ble,node_ftp,node_ota,node_canopen,node_otahost,node_rtspserver,node_espidf toneMint
class node_rtsp,node_rtps,node_serialization,node_streamcodec,node_mathfilters,node_filesystem,node_task toneRose
class node_developer,node_canbus toneIndigo
```

## Components

### Board Support

- [Board Packages](https://github.com/esp-cpp/espp/tree/main/components/esp-box): `components/esp-box`
- [ESP32-P4 Boards](https://github.com/esp-cpp/espp/tree/main/components/esp32-p4-eth): `components/esp32-p4-eth`
- [LilyGo T5](https://github.com/esp-cpp/espp/tree/main/components/lilygo-t5-47): `components/lilygo-t5-47`

### Hardware Components

- [Peripheral Drivers](https://github.com/esp-cpp/espp/tree/main/components/ads1x15): `components/ads1x15`
- [I2C](https://github.com/esp-cpp/espp/tree/main/components/i2c): `components/i2c`
- [ADC](https://github.com/esp-cpp/espp/tree/main/components/adc): `components/adc`
- [Motor Control](https://github.com/esp-cpp/espp/tree/main/components/motor_controller): `components/motor_controller`
- [Controller Input](https://github.com/esp-cpp/espp/tree/main/components/controller): `components/controller`
- [Display Stack](https://github.com/esp-cpp/espp/tree/main/components/display): `components/display`

### Services and Protocols

- [Event Manager](https://github.com/esp-cpp/espp/blob/main/components/event_manager/src/event_manager.cpp): `components/event_manager/src/event_manager.cpp`
- [BLE Services](https://github.com/esp-cpp/espp/tree/main/components/ble_gatt_server): `components/ble_gatt_server`
- [FTP](https://github.com/esp-cpp/espp/blob/main/components/ftp/include/ftp_client_session.hpp): `components/ftp/include/ftp_client_session.hpp`
- [OTA Service](https://github.com/esp-cpp/espp/blob/main/components/ota/include/ota_service.hpp): `components/ota/include/ota_service.hpp`
- [CANopen Client](https://github.com/esp-cpp/espp/blob/main/components/canopen/include/canopen_client.hpp): `components/canopen/include/canopen_client.hpp`
- [OTA Host Tool](https://github.com/esp-cpp/espp/blob/main/components/ota/python/espp_ota/cli.py): `components/ota/python/espp_ota/cli.py`

### Portable Libraries

- [RTSP Client](https://github.com/esp-cpp/espp/blob/main/components/rtsp/src/rtsp_client.cpp): `components/rtsp/src/rtsp_client.cpp`
- [RTPS](https://github.com/esp-cpp/espp/blob/main/components/rtps/include/rtps/entities/Domain.hpp): `components/rtps/include/rtps/entities/Domain.hpp`
- [Serialization](https://github.com/esp-cpp/espp/blob/main/components/cdr/include/cdr.hpp): `components/cdr/include/cdr.hpp`
- [Stream Codecs](https://github.com/esp-cpp/espp/blob/main/components/cobs/include/cobs_stream.hpp): `components/cobs/include/cobs_stream.hpp`
- [Math and Filters](https://github.com/esp-cpp/espp/blob/main/components/filters/include/kalman_filter.hpp): `components/filters/include/kalman_filter.hpp`
- [File System](https://github.com/esp-cpp/espp/blob/main/components/file_system/include/file_system.hpp): `components/file_system/include/file_system.hpp`
- [Task Runtime](https://github.com/esp-cpp/espp/tree/main/components/task): `components/task`

### Other components

- **Application Developer**
- **RTSP Server**
- **CAN Bus**
- **ESP-IDF Hardware APIs**
- **Python User**

## Connections

- Application Developer → Board Packages: selects components
- Board Packages → ESP-IDF Hardware APIs: access hardware
- ESP32-P4 Boards → ESP-IDF Hardware APIs: access hardware
- LilyGo T5 → ESP-IDF Hardware APIs: access hardware
- Peripheral Drivers → ESP-IDF Hardware APIs: access peripherals
- Controller Input → ESP-IDF Hardware APIs: reads GPIO
- Event Manager → Task Runtime: starts subscriber tasks
- FTP → File System: reads and writes
- RTSP Server → RTSP Client: serves stream to
- RTSP Client → RTSP Server: requests stream
- CAN Bus → CANopen Client: delivers frames
- Python User → OTA Host Tool: runs tool
- OTA Host Tool → OTA Service: sends OTA data
