# swoboda1337/sx127x-esphome architecture

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

- Interactive diagram: https://gitdiagram.com/swoboda1337/sx127x-esphome
- Repository: https://github.com/swoboda1337/sx127x-esphome

## Overview

This deprecated ESPHome component configures SX1276/77/78/79 radios and exposes LoRa or FSK/OOK packet transmission and reception. The main workflow is ESPHome configuration into radio setup, then packet TX/RX through the radio; received packets are dispatched to listeners and the on-packet trigger. An optional packet-transport adapter bridges ESPHome packet transport to the radio. The excerpts establish these paths, but omit some implementation details, so the graph avoids claims about their internal mechanics.

Main entry points: [`components/sx127x/sx127x.cpp`](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x.cpp) (SX127x driver), [`components/sx127x/packet_transport/sx127x_transport.cpp`](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/packet_transport/sx127x_transport.cpp) (Packet transport adapter), [`components/sx127x/packet_transport/__init__.py`](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/packet_transport/__init__.py) (Transport config), [`components/sx127x/__init__.py`](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/__init__.py) (Component config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["ESPHome integration"]
  node_config_py["Component config<br/>[__init__.py]"]
end

subgraph group_radio["Radio runtime"]
  node_radio_cpp["SX127x driver<br/>[sx127x.cpp]"]
  node_radio_header["Driver API<br/>[sx127x.h]"]
  node_registers["Register definitions<br/>[sx127x_reg.h]"]
  node_packet_trigger["Packet trigger<br/>[sx127x.h]"]
end

subgraph group_adapters["Actions and transport"]
  node_actions["Automation actions<br/>[automation.h]"]
  node_transport_config["Transport config<br/>[__init__.py]"]
  node_transport["Packet transport adapter"]
end

node_user(("ESPHome user"))
node_spi["SPI bus"]
node_hardware["SX127x radio"]
node_packet_transport["ESPHome packet transport"]

node_user -->|"provides config"| node_config_py
node_config_py -->|"configures"| node_radio_cpp
node_radio_cpp -->|"uses definitions"| node_registers
node_radio_cpp -->|"reads and writes"| node_spi
node_spi -->|"transfers registers"| node_hardware
node_actions -->|"invokes radio"| node_radio_cpp
node_radio_cpp -->|"transmits packets"| node_hardware
node_hardware -->|"signals received data"| node_radio_cpp
node_radio_cpp -->|"triggers packet"| node_packet_trigger
node_transport_config -->|"configures"| node_transport
node_transport_config -->|"sets parent"| node_radio_cpp
node_transport -->|"transmits packets"| node_radio_cpp
node_radio_cpp -->|"dispatches packets"| node_transport
node_transport -->|"processes packets"| node_packet_transport

click node_config_py "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/__init__.py"
click node_radio_cpp "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x.cpp"
click node_radio_header "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x.h"
click node_registers "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x_reg.h"
click node_actions "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/automation.h"
click node_packet_trigger "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x.h"
click node_transport_config "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/packet_transport/__init__.py"
click node_transport "https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/packet_transport/sx127x_transport.cpp"

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_config_py,node_user toneBlue
class node_radio_cpp,node_radio_header,node_registers,node_packet_trigger toneAmber
class node_actions,node_transport_config,node_transport toneMint
class node_spi,node_hardware,node_packet_transport toneIndigo
```

## Components

### ESPHome integration

- [Component config](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/__init__.py): `components/sx127x/__init__.py`

### Radio runtime

- [SX127x driver](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x.cpp): `components/sx127x/sx127x.cpp`
- [Driver API](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x.h): `components/sx127x/sx127x.h`
- [Register definitions](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x_reg.h): `components/sx127x/sx127x_reg.h`
- [Packet trigger](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/sx127x.h): `components/sx127x/sx127x.h`

### Actions and transport

- [Automation actions](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/automation.h): `components/sx127x/automation.h`
- [Transport config](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/packet_transport/__init__.py): `components/sx127x/packet_transport/__init__.py`
- [Packet transport adapter](https://github.com/swoboda1337/sx127x-esphome/blob/main/components/sx127x/packet_transport/sx127x_transport.cpp): `components/sx127x/packet_transport/sx127x_transport.cpp`

### Other components

- **ESPHome user**
- **SPI bus**
- **SX127x radio**
- **ESPHome packet transport**

## Connections

- ESPHome user → Component config: provides config
- Component config → SX127x driver: configures
- SX127x driver → Register definitions: uses definitions
- SX127x driver → SPI bus: reads and writes
- SPI bus → SX127x radio: transfers registers
- Automation actions → SX127x driver: invokes radio
- SX127x driver → SX127x radio: transmits packets
- SX127x radio → SX127x driver: signals received data
- SX127x driver → Packet trigger: triggers packet
- Transport config → Packet transport adapter: configures
- Transport config → SX127x driver: sets parent
- Packet transport adapter → SX127x driver: transmits packets
- SX127x driver → Packet transport adapter: dispatches packets
- Packet transport adapter → ESPHome packet transport: processes packets
