# furkangltkn/raspberry-pi-client architecture

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

- Interactive diagram: https://gitdiagram.com/furkangltkn/raspberry-pi-client
- Repository: https://github.com/furkangltkn/raspberry-pi-client

## Overview

This repository is a Raspberry Pi vehicle gateway: it reads serial telemetry from existing devices and BNO055 sensor data, then exchanges telemetry and commands with a TCP backend. On the vehicle side, commands and autonomous telemetry drive GPIO/VFD controls, while heartbeat loss and emergency state trigger safety stops. The README documents BNO055 calibration and configurable sampling/filter values. The excerpts show connection setup and safety behavior, but omit most command dispatch and sensor-reading code, so those internal links are not asserted.

Main entry points: [`raspberry.py`](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py) (IMU calibration), [`config.ini`](https://github.com/furkangltkn/raspberry-pi-client/blob/main/config.ini) (IMU settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Sensor acquisition"]
  node_serial["Serial telemetry<br/>[raspberry.py]"]
  node_bno["BNO055 input<br/>[raspberry.py]"]
  node_calibration["IMU calibration<br/>[raspberry.py]"]
  node_settings["IMU settings<br/>[config.ini]"]
end

subgraph group_network["Backend communication"]
  node_gateway["Gateway runtime<br/>[raspberry.py]"]
  node_tcp["TCP connection<br/>[raspberry.py]"]
  node_telemetry["Telemetry exchange<br/>[raspberry.py]"]
  node_commands["Command listener<br/>[raspberry.py]"]
end

subgraph group_control["Vehicle control"]
  node_autonomous["Autonomous telemetry<br/>[raspberry.py]"]
  node_safety["Safety interlocks<br/>[raspberry.py]"]
  node_gpio["GPIO and VFD control<br/>[raspberry.py]"]
end

node_sensors(("Vehicle sensors"))
node_backend(("Backend server"))

node_sensors -->|"serial data"| node_serial
node_sensors -->|"I2C data"| node_bno
node_settings -->|"configures"| node_calibration
node_bno -->|"calibrates"| node_calibration
node_serial -->|"sends readings"| node_telemetry
node_calibration -->|"sends readings"| node_telemetry
node_gateway -->|"connects"| node_tcp
node_telemetry -->|"sends telemetry"| node_backend
node_backend -->|"sends commands"| node_commands
node_commands -.->|"dispatches controls"| node_gpio
node_autonomous -->|"controls motion"| node_gpio
node_safety -->|"forces safety stop"| node_gpio
node_backend -->|"heartbeat status"| node_safety

click node_serial "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_bno "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_calibration "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_settings "https://github.com/furkangltkn/raspberry-pi-client/blob/main/config.ini"
click node_gateway "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_tcp "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_telemetry "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_commands "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_autonomous "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_safety "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py"
click node_gpio "https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.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_serial,node_bno,node_calibration,node_settings toneBlue
class node_gateway,node_tcp,node_telemetry,node_commands toneAmber
class node_autonomous,node_safety,node_gpio,node_backend toneMint
class node_sensors toneIndigo
```

## Components

### Sensor acquisition

- [Serial telemetry](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [BNO055 input](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [IMU calibration](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [IMU settings](https://github.com/furkangltkn/raspberry-pi-client/blob/main/config.ini): `config.ini`

### Backend communication

- [Gateway runtime](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [TCP connection](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [Telemetry exchange](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [Command listener](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`

### Vehicle control

- [Autonomous telemetry](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [Safety interlocks](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`
- [GPIO and VFD control](https://github.com/furkangltkn/raspberry-pi-client/blob/main/raspberry.py): `raspberry.py`

### Other components

- **Vehicle sensors**
- **Backend server**

## Connections

- Vehicle sensors → Serial telemetry: serial data (evidence: `README.md`)
- Vehicle sensors → BNO055 input: I2C data (evidence: `README.md`)
- IMU settings → IMU calibration: configures (evidence: `README.md`)
- BNO055 input → IMU calibration: calibrates (evidence: `README.md`)
- Serial telemetry → Telemetry exchange: sends readings (evidence: `README.md`)
- IMU calibration → Telemetry exchange: sends readings (evidence: `README.md`)
- Gateway runtime → TCP connection: connects (evidence: `raspberry.py`)
- Telemetry exchange → Backend server: sends telemetry (evidence: `README.md`)
- Backend server → Command listener: sends commands (evidence: `README.md`)
- Command listener → GPIO and VFD control: dispatches controls (evidence: `raspberry.py`)
- Autonomous telemetry → GPIO and VFD control: controls motion (evidence: `raspberry.py`)
- Safety interlocks → GPIO and VFD control: forces safety stop (evidence: `raspberry.py`)
- Backend server → Safety interlocks: heartbeat status (evidence: `raspberry.py`)
