# xinyuan-lilygo/lilygo-modem-series architecture

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

- Interactive diagram: https://gitdiagram.com/xinyuan-lilygo/lilygo-modem-series
- Repository: https://github.com/xinyuan-lilygo/lilygo-modem-series

## Overview

This repository is a LilyGo modem-series support repository whose visible runtime content is largely a collection of embedded libraries. The documented use case is cellular-enabled ESP32/ESP32-S3 boards; TinyGSM supplies modem networking, with HTTP and MQTT client libraries available over a Client interface. The tree also contains radio, display, LED, and sensor libraries. The application examples and board-specific setup are not present in the supplied tree, so their orchestration cannot be traced here; edges below are limited to relationships shown by the README or source index/excerpts.

Main entry points: [`lib/TinyGSM/src/TinyGsmClientSIM7600.h`](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmClientSIM7600.h) (SIM7600 modem), [`lib/TinyGSM/src/TinyGsmClientSIM7672.h`](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmClientSIM7672.h) (SIM7672 modem), [`lib/RadioLib/src/protocols/BellModem/BellModem.cpp`](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/protocols/BellModem/BellModem.cpp) (Bell modem protocol), [`lib/ArduinoHttpClient/src/HttpClient.cpp`](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/ArduinoHttpClient/src/HttpClient.cpp) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cellular["Cellular networking"]
  node_tinygsm["TinyGSM modem clients<br/>[TinyGSM.h]"]
  node_sim7600["SIM7600 modem"]
  node_sim7672["SIM7672 modem"]
  node_gsmclient["Client interface<br/>[Client.h]"]
  node_mqtt76["A76xx MQTT support<br/>[TinyGsmMqttA76xx.h]"]
  node_https["Modem HTTPS support<br/>[TinyGsmHttpsComm.h]"]
end

subgraph group_protocols["Network protocols"]
  node_http["HTTP client<br/>[HttpClient.cpp]"]
  node_websocket["WebSocket client"]
  node_mqtt["MQTT client<br/>[PubSubClient.cpp]"]
end

subgraph group_radio["Radio communication"]
  node_radiolib["RadioLib module layer<br/>[Module.h]"]
  node_physical["Physical radio layer<br/>[PhysicalLayer.h]"]
  node_radiotypes["Radio types<br/>[TypeDef.h]"]
  node_bell["Bell modem protocol<br/>[BellModem.cpp]"]
  node_lorawan["LoRaWAN protocol<br/>[LoRaWAN.cpp]"]
  node_lora["Arduino LoRa<br/>[LoRa.cpp]"]
end

subgraph group_peripherals["Displays and sensors"]
  node_gfx["Graphics primitives<br/>[Adafruit_GFX.h]"]
  node_spitft["SPI display support"]
  node_ssd1306["SSD1306 display"]
  node_neopixel["NeoPixel LEDs"]
  node_sensorlib["Sensor drivers<br/>[SensorLib.h]"]
  node_ina219["INA219 sensor"]
end

node_boards(("LilyGo modem boards"))

node_boards -->|"uses cellular"| node_tinygsm
node_http -->|"uses transport"| node_gsmclient
node_mqtt -->|"uses transport"| node_gsmclient
node_websocket -->|"extends"| node_http
node_sim7600 -->|"includes support"| node_mqtt76
node_sim7600 -->|"includes support"| node_https
node_sim7672 -->|"includes support"| node_mqtt76
node_sim7672 -->|"includes support"| node_https
node_bell -->|"transmits through"| node_physical
node_radiolib -->|"imports definitions"| node_radiotypes
node_bell -->|"accesses module"| node_radiolib

click node_tinygsm "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGSM.h"
click node_sim7600 "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmClientSIM7600.h"
click node_sim7672 "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmClientSIM7672.h"
click node_gsmclient "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/ArduinoCompat/Client.h"
click node_http "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/ArduinoHttpClient/src/HttpClient.cpp"
click node_websocket "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/ArduinoHttpClient/src/WebSocketClient.cpp"
click node_mqtt "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/pubsubclient/src/PubSubClient.cpp"
click node_mqtt76 "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmMqttA76xx.h"
click node_https "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmHttpsComm.h"
click node_radiolib "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/Module.h"
click node_physical "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/protocols/PhysicalLayer/PhysicalLayer.h"
click node_radiotypes "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/TypeDef.h"
click node_bell "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/protocols/BellModem/BellModem.cpp"
click node_lorawan "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/protocols/LoRaWAN/LoRaWAN.cpp"
click node_lora "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/arduino-LoRa/src/LoRa.cpp"
click node_gfx "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20GFX%20Library/Adafruit_GFX.h"
click node_spitft "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20GFX%20Library/Adafruit_SPITFT.cpp"
click node_ssd1306 "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20SSD1306/Adafruit_SSD1306.cpp"
click node_neopixel "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20NeoPixel/Adafruit_NeoPixel.cpp"
click node_sensorlib "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/SensorLib/src/SensorLib.h"
click node_ina219 "https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20INA219/Adafruit_INA219.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_tinygsm,node_sim7600,node_sim7672,node_gsmclient,node_mqtt76,node_https toneBlue
class node_http,node_websocket,node_mqtt toneAmber
class node_radiolib,node_physical,node_radiotypes,node_bell,node_lorawan,node_lora toneMint
class node_gfx,node_spitft,node_ssd1306,node_neopixel,node_sensorlib,node_ina219 toneRose
class node_boards toneIndigo
```

## Components

### Cellular networking

- [TinyGSM modem clients](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGSM.h): `lib/TinyGSM/src/TinyGSM.h`
- [SIM7600 modem](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmClientSIM7600.h): `lib/TinyGSM/src/TinyGsmClientSIM7600.h`
- [SIM7672 modem](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmClientSIM7672.h): `lib/TinyGSM/src/TinyGsmClientSIM7672.h`
- [Client interface](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/ArduinoCompat/Client.h): `lib/TinyGSM/src/ArduinoCompat/Client.h`
- [A76xx MQTT support](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmMqttA76xx.h): `lib/TinyGSM/src/TinyGsmMqttA76xx.h`
- [Modem HTTPS support](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/TinyGSM/src/TinyGsmHttpsComm.h): `lib/TinyGSM/src/TinyGsmHttpsComm.h`

### Network protocols

- [HTTP client](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/ArduinoHttpClient/src/HttpClient.cpp): `lib/ArduinoHttpClient/src/HttpClient.cpp`
- [WebSocket client](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/ArduinoHttpClient/src/WebSocketClient.cpp): `lib/ArduinoHttpClient/src/WebSocketClient.cpp`
- [MQTT client](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/pubsubclient/src/PubSubClient.cpp): `lib/pubsubclient/src/PubSubClient.cpp`

### Radio communication

- [RadioLib module layer](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/Module.h): `lib/RadioLib/src/Module.h`
- [Physical radio layer](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/protocols/PhysicalLayer/PhysicalLayer.h): `lib/RadioLib/src/protocols/PhysicalLayer/PhysicalLayer.h`
- [Radio types](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/TypeDef.h): `lib/RadioLib/src/TypeDef.h`
- [Bell modem protocol](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/protocols/BellModem/BellModem.cpp): `lib/RadioLib/src/protocols/BellModem/BellModem.cpp`
- [LoRaWAN protocol](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/RadioLib/src/protocols/LoRaWAN/LoRaWAN.cpp): `lib/RadioLib/src/protocols/LoRaWAN/LoRaWAN.cpp`
- [Arduino LoRa](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/arduino-LoRa/src/LoRa.cpp): `lib/arduino-LoRa/src/LoRa.cpp`

### Displays and sensors

- [Graphics primitives](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20GFX%20Library/Adafruit_GFX.h): `lib/Adafruit GFX Library/Adafruit_GFX.h`
- [SPI display support](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20GFX%20Library/Adafruit_SPITFT.cpp): `lib/Adafruit GFX Library/Adafruit_SPITFT.cpp`
- [SSD1306 display](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20SSD1306/Adafruit_SSD1306.cpp): `lib/Adafruit SSD1306/Adafruit_SSD1306.cpp`
- [NeoPixel LEDs](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20NeoPixel/Adafruit_NeoPixel.cpp): `lib/Adafruit NeoPixel/Adafruit_NeoPixel.cpp`
- [Sensor drivers](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/SensorLib/src/SensorLib.h): `lib/SensorLib/src/SensorLib.h`
- [INA219 sensor](https://github.com/xinyuan-lilygo/lilygo-modem-series/blob/main/lib/Adafruit%20INA219/Adafruit_INA219.cpp): `lib/Adafruit INA219/Adafruit_INA219.cpp`

### Other components

- **LilyGo modem boards**

## Connections

- LilyGo modem boards → TinyGSM modem clients: uses cellular (evidence: `README.md`)
- HTTP client → Client interface: uses transport
- MQTT client → Client interface: uses transport
- WebSocket client → HTTP client: extends
- SIM7600 modem → A76xx MQTT support: includes support (evidence: `lib/TinyGSM/src/TinyGsmClientSIM7600.h`)
- SIM7600 modem → Modem HTTPS support: includes support (evidence: `lib/TinyGSM/src/TinyGsmClientSIM7600.h`)
- SIM7672 modem → A76xx MQTT support: includes support (evidence: `lib/TinyGSM/src/TinyGsmClientSIM7672.h`)
- SIM7672 modem → Modem HTTPS support: includes support (evidence: `lib/TinyGSM/src/TinyGsmClientSIM7672.h`)
- Bell modem protocol → Physical radio layer: transmits through (evidence: `lib/RadioLib/src/protocols/BellModem/BellModem.cpp`)
- RadioLib module layer → Radio types: imports definitions (evidence: `lib/RadioLib/src/Module.h`)
- Bell modem protocol → RadioLib module layer: accesses module (evidence: `lib/RadioLib/src/protocols/BellModem/BellModem.cpp`)
