Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions services_raspberryPi/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## 📑 Services Documentation - Raspberry Pi

This document describes the services configured on the **Raspberry Pi** to automate and manage local processes.


## 📌 Overview
The services listed here were created to keep scripts and applications running automatically after system boot, ensuring that critical tasks run continuously.


## 🔧 Created Services

### 1. **Service**
- **Description:**
**autonomy-mqtt-cloud.service** → Publishes car autonomy data to the cloud via MQTT.

**autonomy-mqtt-local.service** → Calculates and publishes car autonomy data locally via MQTT.

**battery-mqtt-cloud.service** → Publishes battery status to the cloud via MQTT.

**can-manager.service** → Manages the CAN interface (activate, monitor, deactivate).

**github-runner.service** → Runs GitHub Actions self-hosted runner on the Raspberry Pi.

**speed-mqtt-cloud.service** → Publishes car speed data to the cloud via MQTT.

**speed-mqtt-local.service** → Publishes car speed data locally via MQTT.

**temperature-mqtt-cloud.service** → Publishes Raspberry Pi temperature data from local to the cloud via MQTT.
- **File location:**
`/etc/systemd/system`
- **Usage commands:**

```bash
# Start the service
sudo systemctl start service_name

# Stop the service
sudo systemctl stop service_name

# Restart the service
sudo systemctl restart service_name

# Check status
sudo systemctl status service_name
14 changes: 14 additions & 0 deletions services_raspberryPi/autonomy-mqtt-cloud.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Car Autonomy Publisher Cloud
After=network-online.target mosquitto.service autonomy-mqtt-local.service
Wants=network-online.target autonomy-mqtt-local.service

[Service]
Type=simple
ExecStart=/usr/local/bin/autonomy_mqtt_cloud
Restart=always
RestartSec=5
User=jetracer

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions services_raspberryPi/autonomy-mqtt-local.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Car Autonomy Calculator and Publisher
After=network-online.target mosquitto.service
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/autonomy_mqtt_local
Restart=always
RestartSec=5
User=jetracer

[Install]
WantedBy=multi-user.target
14 changes: 14 additions & 0 deletions services_raspberryPi/battery-mqtt-cloud.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Battery MQTT Cloud Publisher
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
ExecStart=/usr/local/bin/battery_mqtt_cloud
Restart=always
RestartSec=5
User=jetracer

[Install]
WantedBy=multi-user.target
12 changes: 12 additions & 0 deletions services_raspberryPi/can-manager.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=CAN Interface Manager (Activate, Monitor, Deactivate)
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/can_manager
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions services_raspberryPi/github-runner.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=GitHub Actions Self-Hosted Runner
After=network.target

[Service]
Type=simple
User=jetracer
WorkingDirectory=/home/jetracer/actions-runner
ExecStart=/home/jetracer/actions-runner/run.sh
Restart=always
RestartSec=10
Environment=RUNNER_ALLOW_RUNASROOT=1

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions services_raspberryPi/speed-mqtt-cloud.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Service to publish speed data to the cloud MQTT broker
BindsTo=speed-mqtt-local.service
Requires=speed-mqtt-local.service
After=network-online.target speed-mqtt-local.service
PartOf=speed-mqtt-local.service

[Service]
Type=simple
ExecStart=/usr/local/bin/speed_mqtt_cloud
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions services_raspberryPi/speed-mqtt-local.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=MQTT Speed Publisher
BindsTo=can-manager.service
Requires=can-manager.service mosquitto.service
After=network.target can-manager.service mosquitto.service
PartOf=can-manager.service

[Service]
Type=simple
ExecStart=/usr/local/bin/speed_mqtt_local
Restart=always
RestartSec=2

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions services_raspberryPi/temperature-mqtt-cloud.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Service to forward Raspberry Pi temperature from local to cloud MQTT broker
BindsTo=temperature-mqtt-local
Requires=temperature-mqtt-local
After=network-online.target temperature-mqtt-local
PartOf=temperature-mqtt-local

[Service]
Type=simple
ExecStart=/usr/local/bin/temperature_mqtt_cloud
Restart=always
RestartSec=5
User=jetracer

[Install]
WantedBy=multi-user.target
Loading