Radio Gaga is a telemetry and remote control system designed for managing electric scooters. The application provides comprehensive remote monitoring and control capabilities by interfacing with Redis for state management and MQTT for communication.
- Real-time telemetry monitoring with adaptive reporting intervals
- Comprehensive vehicle state tracking
- Remote control capabilities via MQTT commands
- TLS encryption support for MQTT communication
- Redis-based state management
- Configurable command parameters
- Support for development and production environments
- Development tools: Shell and Redis command execution support (development environment only)
- MQTT Client: Manages communication with the MQTT broker
- Redis Backend: Stores and retrieves vehicle state information
- Configuration Management: YAML-based configuration system
ping
: Health check commandget_state
: Retrieve current vehicle telemetryupdate
: Update telemetry clientlock
: Lock the scooterunlock
: Unlock the scooterblinkers
: Control turn signals (left/right/both/off)honk
: Activate horn with configurable durationopen_seatbox
: Open the seat boxlocate
: Help locate scooter (flashes lights and honks twice in rapid succession)alarm
: Trigger alarm system with configurable parameters
In development environment:
redis
: Execute Redis commands (development only)shell
: Execute shell commands (development only)
- YAML Configuration File (
radio-gaga.yml
) - Command Line Flags
- Redis Settings (fallback for MQTT broker URL and CA certificate)
scooter:
identifier: "VEHICLE-ID" # Vehicle identifier (MQTT username)
token: "auth_token" # Authentication token (MQTT password)
environment: "production" # production or development
mqtt:
broker_url: "ssl://mqtt.example.com:8883" # Fallback to Redis `HGET settings cloud:mqtt-url` if not set
ca_cert: "/path/to/ca.crt" # Optional CA certificate for TLS (fallback to Redis `HGET settings cloud:mqtt-ca` if not set)
keepalive: "180s" # MQTT keepalive interval
redis_url: "redis://localhost:6379"
telemetry:
intervals:
driving: "1s" # Interval while driving
standby: "5m" # Interval in standby with battery
standby_no_battery: "8h" # Interval in standby without battery
hibernate: "24h" # Interval in hibernate mode
commands: # Optional command configuration
honk:
disabled: false # Commands can be disabled by setting `disabled: true`
on_time: "100ms"
alarm:
hazards:
flash: true
horn:
honk: true
on_time: "400ms"
off_time: "400ms"
-config string
Path to config file (defaults to radio-gaga.yml)
-environment string
Environment (production or development)
-identifier string
Vehicle identifier (MQTT username)
-token string
Authentication token (MQTT password)
-mqtt-broker string
MQTT broker URL
-mqtt-cacert string
Path to MQTT CA certificate
-mqtt-keepalive string
MQTT keepalive duration (default "30s")
-redis-url string
Redis URL (default "redis://localhost:6379")
-driving-interval string
Telemetry interval while driving (default "1s")
-standby-interval string
Telemetry interval in standby (default "5m")
-standby-no-battery-interval string
Telemetry interval in standby without battery (default "8h")
-hibernate-interval string
Telemetry interval in hibernate mode (default "24h")
The system monitors and reports comprehensive vehicle telemetry including:
- Operating state
- Kickstand position
- Seatbox lock status
- Blinker status
- Current speed
- Odometer reading
- Motor voltage and current
- Motor temperature
- Main battery presence and levels (0-100%)
- AUX battery level and voltage
- CBB battery level and current
- GPS coordinates (latitude/longitude)
- Go 1.22 or higher
- Redis server
- MQTT broker
# Standard build
make
# Cross-platform builds
make amd64 # Linux AMD64 build
make arm # Linux ARM build
# Distribution build for deployment
make dist
# Using default config file (radio-gaga.yml)
./radio-gaga
# Using custom config file
./radio-gaga -config /path/to/config.yml
# Override config with flags (run with -help to see flags)
./radio-gaga -identifier SCOOTER1 -mqtt-broker ssl://mqtt.example.com:8883
- TLS encryption support for MQTT communication
- Custom CA certificate support for MQTT
- Vehicle-specific authentication using identifier/token
- Environment-based command restrictions
- Command validation and sanitization
- Retained message cleanup
- Secure defaults
- Teal Bauer [email protected]