Raspberry Pi Software Package (RPi-Package)
📌 What is this for? (Quick Summary)​
In Simple Words:
This package contains all the software that runs physically inside the pod on a Raspberry Pi 5.Its job is to be the bridge between the pod's physical hardware and the cloud:
- It listens to the vehicle's internal sensor wires (the CAN bus).
- It packages up those sensor readings and sends them to AWS.
- It streams the camera video out to our cloud video server.
- If you are developing on a laptop without a physical pod, it has an emulator that generates realistic simulated sensor data for you.
1. Directory Structure (What Files Live Where?)​
RPi-Package/
├── go_server/ # The Go program listening on port 20006
│ └── main.go # Decodes CAN bytes and sends to InfluxDB & AWS IoT
├── emulator/ # The Python simulator
│ ├── src/
│ │ ├── run_trajectory.py # Replays a 600m / 60 km/h test run
│ │ └── web_server.py # Simple web UI on port 5001 to start test runs
│ └── telemetry.csv # Real recorded flight numbers (speed, volts, temps)
├── stream_service/ # The camera forwarder
│ └── app.py # Checks cameras & streams video to MediaMTX
├── tests/ # 23 automated tests (run with `pytest tests/`)
├── installer.sh # Sets up a brand new Raspberry Pi from scratch
└── updater.sh # Automatically pulls git updates every minute
2. The 4 Background Services on the Pi​
On Linux, background programs are managed by systemd. We have 4 services that start automatically when the Raspberry Pi boots up:
| Service Name | What It Runs | What It Does |
|---|---|---|
pod-gateway.service | go_server | Listens on port 20006 for sensor packets and uploads them to InfluxDB. |
pod-stream.service | stream_service/app.py | Sends the camera video to cam.tutr.tech:8554. |
pod-emulator.service | run_trajectory.py | Generates simulated sensor numbers if no real pod is attached. |
pod-web.service | web_server.py | Web control page on port 5001 so engineers can trigger test runs. |
Helpful Linux Commands:​
# Check if services are running:
sudo systemctl status pod-gateway pod-stream
# Restart the camera stream:
sudo systemctl restart pod-stream
# Read live logs from the camera service:
sudo journalctl -u pod-stream -f
3. How to Set Up a Fresh Raspberry Pi​
If you ever need to set up a replacement Raspberry Pi:
git clone https://github.com/TutrTech/RPi-Package.git ~/RPi-Package
cd ~/RPi-Package
chmod +x installer.sh updater.sh
./installer.sh
The installer compiles the Go server, sets up Python virtual environments, runs the 23-test test suite, and installs the systemd services automatically.