# theorigaux/projet-robot-lora architecture

> Architecture diagram of the GitHub repository theorigaux/projet-robot-lora, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/theorigaux/projet-robot-lora
- Repository: https://github.com/theorigaux/projet-robot-lora

## Overview

The repository’s runtime product is a LoRa-controlled robot with a web joystick and a Raspberry Pi serial bridge. The main path is browser input → PHP/SQLite state → Python bridge → transmitter → robot receiver, with distance reported back to the web UI. The README also documents autonomous obstacle avoidance and an OLED/physical-joystick transmitter interface. Project-management automation is represented as a separate capability; its external wiring is not established by the sampled source.

Main entry points: [`arduino/emetteur/TX.cpp`](https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/emetteur/TX.cpp) (LoRa transmitter), [`web/public/dir.db`](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/dir.db) (Command and distance state), [`web/public/index.html`](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/index.html) (Web interface), [`arduino/recepteur/RX.cpp`](https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/recepteur/RX.cpp) (Robot receiver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web control"]
  node_browser["Web interface<br/>[index.html]"]
  node_joystick_api["Joystick endpoint<br/>[update.php]"]
  node_mode_api["Mode endpoint<br/>[update_mode.php]"]
  node_distance_api["Distance endpoint<br/>[get_distance.php]"]
  node_state_db[("Command and distance state<br/>[dir.db]")]
end

subgraph group_bridge["Command bridge"]
  node_bridge_loop["Serial bridge loop"]
end

subgraph group_robot["LoRa robot"]
  node_tx["LoRa transmitter<br/>[TX.cpp]"]
  node_rx["Robot receiver<br/>[RX.cpp]"]
  node_ultrasonic["Ultrasonic ranging<br/>[RX.cpp]"]
  node_motor_control["Motor control<br/>[RX.cpp]"]
end

subgraph group_automation["Project automation"]
  node_project_manager["Issue and board automation<br/>[project_manager.py]"]
end

node_user(("Robot operator"))
node_serial_link["USB serial"]
node_joystick_input["Physical joystick"]
node_oled["Status OLED"]
node_radio_link["LoRa link"]
node_motors["Robot motors"]

node_user -->|"controls"| node_browser
node_browser -->|"sends joystick"| node_joystick_api
node_browser -->|"sets mode"| node_mode_api
node_browser -->|"polls distance"| node_distance_api
node_joystick_api -->|"writes coordinates"| node_state_db
node_mode_api -->|"writes mode"| node_state_db
node_bridge_loop -->|"reads commands"| node_state_db
node_bridge_loop -->|"writes distance"| node_state_db
node_distance_api -->|"reads distance"| node_state_db
node_bridge_loop -->|"sends commands"| node_serial_link
node_serial_link -->|"returns readings"| node_bridge_loop
node_serial_link -->|"serial commands"| node_tx
node_joystick_input -->|"provides axes"| node_tx
node_tx -->|"transmits controls"| node_radio_link
node_radio_link -->|"delivers controls"| node_rx
node_rx -->|"returns distance"| node_radio_link
node_radio_link -->|"delivers distance"| node_tx
node_tx -->|"displays status"| node_oled
node_rx -->|"measures distance"| node_ultrasonic
node_rx -->|"selects movement"| node_motor_control
node_motor_control -->|"drives motors"| node_motors

click node_browser "https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/index.html"
click node_joystick_api "https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/update.php"
click node_mode_api "https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/update_mode.php"
click node_distance_api "https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/get_distance.php"
click node_state_db "https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/dir.db"
click node_bridge_loop "https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/test-communication.py"
click node_tx "https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/emetteur/TX.cpp"
click node_rx "https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/recepteur/RX.cpp"
click node_ultrasonic "https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/recepteur/RX.cpp"
click node_motor_control "https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/recepteur/RX.cpp"
click node_project_manager "https://github.com/theorigaux/projet-robot-lora/blob/main/scripts/project_manager.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_browser,node_joystick_api,node_mode_api,node_distance_api,node_state_db toneBlue
class node_bridge_loop toneAmber
class node_tx,node_rx,node_ultrasonic,node_motor_control toneMint
class node_project_manager toneRose
class node_user,node_serial_link,node_joystick_input,node_oled,node_radio_link,node_motors toneIndigo
```

## Components

### Web control

- [Web interface](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/index.html): `web/public/index.html`
- [Joystick endpoint](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/update.php): `web/public/update.php`
- [Mode endpoint](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/update_mode.php): `web/public/update_mode.php`
- [Distance endpoint](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/get_distance.php): `web/public/get_distance.php`
- [Command and distance state](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/dir.db): `web/public/dir.db`

### Command bridge

- [Serial bridge loop](https://github.com/theorigaux/projet-robot-lora/blob/main/web/public/test-communication.py): `web/public/test-communication.py`

### LoRa robot

- [LoRa transmitter](https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/emetteur/TX.cpp): `arduino/emetteur/TX.cpp`
- [Robot receiver](https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/recepteur/RX.cpp): `arduino/recepteur/RX.cpp`
- [Ultrasonic ranging](https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/recepteur/RX.cpp): `arduino/recepteur/RX.cpp`
- [Motor control](https://github.com/theorigaux/projet-robot-lora/blob/main/arduino/recepteur/RX.cpp): `arduino/recepteur/RX.cpp`

### Project automation

- [Issue and board automation](https://github.com/theorigaux/projet-robot-lora/blob/main/scripts/project_manager.py): `scripts/project_manager.py`

### Other components

- **Robot operator**
- **USB serial**
- **Physical joystick**
- **Status OLED**
- **LoRa link**
- **Robot motors**

## Connections

- Robot operator → Web interface: controls (evidence: `README.md`)
- Web interface → Joystick endpoint: sends joystick (evidence: `web/public/update.php`)
- Web interface → Mode endpoint: sets mode (evidence: `web/public/update_mode.php`)
- Web interface → Distance endpoint: polls distance (evidence: `web/public/get_distance.php`)
- Joystick endpoint → Command and distance state: writes coordinates (evidence: `web/public/update.php`)
- Mode endpoint → Command and distance state: writes mode (evidence: `web/public/update_mode.php`)
- Serial bridge loop → Command and distance state: reads commands (evidence: `web/public/test-communication.py`)
- Serial bridge loop → Command and distance state: writes distance (evidence: `web/public/test-communication.py`)
- Distance endpoint → Command and distance state: reads distance (evidence: `web/public/get_distance.php`)
- Serial bridge loop → USB serial: sends commands (evidence: `web/public/test-communication.py`)
- USB serial → Serial bridge loop: returns readings (evidence: `web/public/test-communication.py`)
- USB serial → LoRa transmitter: serial commands (evidence: `arduino/emetteur/TX.cpp`)
- Physical joystick → LoRa transmitter: provides axes (evidence: `arduino/emetteur/TX.cpp`)
- LoRa transmitter → LoRa link: transmits controls (evidence: `arduino/emetteur/TX.cpp`)
- LoRa link → Robot receiver: delivers controls (evidence: `arduino/recepteur/RX.cpp`)
- Robot receiver → LoRa link: returns distance (evidence: `arduino/recepteur/RX.cpp`)
- LoRa link → LoRa transmitter: delivers distance (evidence: `arduino/emetteur/TX.cpp`)
- LoRa transmitter → Status OLED: displays status (evidence: `arduino/emetteur/TX.cpp`)
- Robot receiver → Ultrasonic ranging: measures distance (evidence: `arduino/recepteur/RX.cpp`)
- Robot receiver → Motor control: selects movement (evidence: `arduino/recepteur/RX.cpp`)
- Motor control → Robot motors: drives motors (evidence: `arduino/recepteur/RX.cpp`)
