Skip to main content
Circuit board traces representing system architecture

System Architecture

A three-tier platform spanning custom ESP32 hardware, Docker-orchestrated edge compute, and optional cloud—all connected by CAN bus.

Full-Stack, From Microcontroller to Mobile App

30+ open-source repositories (and growing) under the MIT license. Three architectural tiers that operate independently and sync when connected.

CAN Bus MQTT HTTPS WebSocket ESP-NOW Bluetooth

System Diagram

Three tiers connected by standard protocols. Cloud is optional—the vehicle operates fully offline.

Cloud Tier Optional — Internet-connected
Web Dashboard
NGINX / Browser
REST API
Node.js / Express
WebSocket
MQTT Broker
Mosquitto (TLS)
MongoDB
Historical Data
Android App
Kotlin / Jetpack Compose
MapLibre / MQTT
HTTPS / MQTT over TLS — WiFi or Cellular when available
Edge Tier In-Vehicle Compute — Raspberry Pi / Orange Pi
CAN → MQTT
Bidirectional
Bridge
MQTT Broker
Mosquitto
Local + TLS
REST API
Node.js / Express
WebSocket
Node-RED
Visual Automation
Workflows
MongoDB
Local Cache
Tileserver GL
Offline Maps
MBTiles
Dashboard
NGINX Frontend
PWA
Docker Compose Orchestrated
CAN Transceiver (MCP2515)
CAN BUS
500 kbps Galvanically Isolated Standard / Extended Frames Up to 40m
Device Tier 14+ ESP32 Hardware Modules — Custom PCBs / KiCAD
Sensors
GPS / GNSSLocation Module
Air QualitySensor
Cabinet & DoorSensor
Shunt GatewayBattery Monitor
Seven-PinTrailer Monitor
Controllers
Power Distribution8-ch PWM
Electric HeaterControl
Vehicle LevelerAccelerometer
MPPT SolarCAN Gateway
User Interfaces
8-Button PanelPhysical Controls
Wall-Mount DisplayTouchscreen
In-Vehicle DisplayTrailer Display
Wireless Gateways
BluetoothGateway
CAN-to-ESP-NOWGateway
Shared Libraries & Tooling
OTA Update Library TWAI CAN Driver Debug Library RGB LED (WROOM-32) RGB LED (ESP32-C6) KiCAD Symbol & Footprint Libraries
ESP-IDF / PlatformIO / Arduino Framework  •  FreeRTOS Tasks  •  OTA Firmware Updates  •  CAN + Optional BLE / WiFi / ESP-NOW
Cloud (Optional)
Edge Compute
Hardware Modules
CAN Bus

Layer by Layer

Each tier is independently functional. Together they form a complete Software Defined Vehicle platform.

Device Tier — Custom ESP32 Modules

14+ hardware modules designed in KiCAD with open schematics, PCB layouts, and 3D-printable enclosures. Each module runs FreeRTOS firmware built with PlatformIO.

  • ESP32 and ESP32-C6 microcontrollers
  • CAN bus communication (TWAI driver)
  • Over-the-air firmware updates
  • Optional BLE, WiFi, and ESP-NOW
  • Shared libraries for common functions

CAN Bus — The Backbone

The same automotive-grade communication standard used in cars, trucks, and heavy equipment. All modules connect via a 4-wire daisy-chain cable.

  • 500 kbps with galvanic isolation
  • Priority-based message arbitration
  • Standard and extended frames
  • Up to 40 meters of cable length
  • Add or remove modules without rewiring

Edge Tier — In-Vehicle Compute

A Docker Compose stack running on a Raspberry Pi or Orange Pi inside the vehicle. Provides dashboards, automation, offline maps, and the CAN-to-MQTT bridge.

  • Mosquitto MQTT broker (local + TLS)
  • Node.js REST API with WebSocket
  • Node-RED visual automation engine
  • Tileserver GL for offline navigation
  • PWA dashboard accessible from any browser
  • MongoDB for local data caching

Cloud Tier — Optional Remote Access

A self-hostable Docker Compose deployment that enables remote monitoring, push notifications, and historical data when internet is available.

  • Node.js Express API with JWT auth
  • MongoDB for historical data storage
  • MQTT broker with TLS encryption
  • WebSocket for real-time updates
  • Native Android app (Kotlin / Jetpack Compose)
  • Vehicle operates fully without cloud

Architecture Principles

Design decisions that set TrailCurrent apart from cloud-dependent IoT platforms.

Edge-First
All critical functions operate offline. The cloud is an optional enhancement, not a dependency. Your vehicle works at a remote campsite the same as in your driveway.
Data Sovereignty
All data stays on the vehicle unless you explicitly sync to the cloud. No telemetry harvesting, no third-party access, no data leaving your control.
Modular by Default
Add or remove CAN modules without system changes. Each module is self-contained and announces itself on the bus. True plug and play.
Standard Protocols
CAN bus, MQTT, HTTPS, WebSocket, ESP-NOW, and BLE. No proprietary protocols, no vendor lock-in. Every interface uses industry standards.
Containerized
Docker Compose orchestration at both edge and cloud tiers. Reproducible deployments, isolated services, and straightforward updates.
Full-Stack Transparency
From KiCAD schematics to mobile app source code, every layer is open source under MIT. Inspect, modify, or rebuild any component.

Explore the Source

Every layer, every module, every line of code is open source on GitHub.