Skip to main content
Headwaters inside a camper van at night, stars and aurora over the mountains

Headwaters

The brain of every TrailCurrent install. A compact edge compute gateway that quietly runs your whole rig, even when the cell bars are gone.

What's Inside  /  Module

The Edge Gateway

Dashboards, offline maps, automation, and the bridge between every module on the CAN bus, all running on a compact enclosure that lives out of sight in your rig.

Built around the Raspberry Pi Compute Module 5 on a Waveshare carrier board with an RS485 CAN HAT. No custom PCBs, no soldering. Everything inside Headwaters is off-the-shelf or 3D printed. The whole thing lives in a matte black enclosure you can print on any consumer FDM machine.

Containers Node.js CM5 CAN Bus MQTT Offline Maps
View on GitHub
TrailCurrent Headwaters enclosure rendering

At a Glance

What lives inside the enclosure and what comes out of the ports.

Compute

Raspberry Pi Compute Module 5 on a Waveshare carrier board. Quad-core Arm Cortex-A76, 4 GB+ RAM, NVMe SSD. All the power it needs to run five Docker containers, serve offline maps, and bridge CAN traffic without breaking a sweat.

Vehicle Network

RS485 CAN HAT (B) links Headwaters to the TrailCurrent vehicle bus through a Deutsch DTM 4-pin connector on the outside of the case. A Python host service bridges CAN frames to MQTT topics so every service on the gateway sees the same data.

Enclosure

Two-piece 3D printed case: vented bottom with integrated standoffs, and a cover with the TrailCurrent logo embossed on top. Four mounting tabs, four M2.5×8 screws. Prints on any consumer FDM machine. ABS or ASA recommended for vehicle interior temperatures.

Bill of Materials

Everything you need to build one Headwaters, top to bottom.

Qty Part Description Source
1 Raspberry Pi Compute Module 5 Quad-core Arm Cortex-A76, 4 GB+ RAM. eMMC or Lite variant with NVMe SSD. Raspberry Pi
1 Waveshare CM5 Carrier Board Standard CM5 carrier with Gigabit Ethernet, dual USB 3.0, dual USB 2.0, HDMI, and an M.2 NVMe slot. Waveshare
1 Waveshare RS485 CAN HAT (B) 40-pin HAT adding a MCP2515 SPI CAN controller. Connects to the TrailCurrent vehicle bus. Waveshare
1 Waveshare CM5 Fan 3007-B 5V Active cooling fan mounted to the CM5 heatsink. Keeps the SoC in its thermal envelope during sustained loads like tile serving and CAN bridging in a warm cabin. Waveshare
1 128 GB+ NVMe SSD (M.2 2242/2280) Holds the OS, Docker images, and offline map tiles (~25 GB for full US coverage). Any brand
1 Deutsch DTM04-4P Connector Sealed 4-pin receptacle for the CAN bus cable. The TrailCurrent standard for vehicle bus interconnects. TE Connectivity
1 Case Bottom 3D printed. 95 × 118 × 42 mm. Vented on one long side, ports on the other, four mounting tabs. ABS or ASA recommended. 3D printed (STL below)
1 Case Cover 3D printed. 91 × 95 × 4.5 mm. TrailCurrent logo embossed on the top face. ABS or ASA recommended. 3D printed (STL below)
4 M2.5 × 8 mm Machine Screws Secure the cover to the case bottom at the four corners. Stainless or zinc-plated steel. Hardware store

Technical Drawings

Orthographic views of the full assembly, exported straight from FreeCAD.

Headwaters top view with dimensions

Top View

Embossed logo, four cover screws, and four mounting tabs at the corners.

Headwaters front view with dimensions

Front View

Vent fins on the long side. The vents run the full height of the case bottom.

Headwaters right view with dimensions

Right View

Port side: Deutsch DTM CAN connector, HDMI, dual USB, and Gigabit Ethernet.

Headwaters left view with dimensions

Left View

The blank side. This is the face that usually sits against the bulkhead.

Overall dimensions: 91 × 118 × 46 mm. Source CAD lives in the CAD folder of the Headwaters repo.

3D Printed Parts

Two pieces, ABS. A ready-to-slice .3mf project file with both plates and the full print profile lives in the CAD folder.

Headwaters case bottom, 3D printed

Case Bottom

The main body. Integrated standoffs hold the CM5 carrier board in place, a long vent array runs the full length of one side to shed heat, and openings on the opposite side frame the connectors. Four mounting tabs at the corners let you bolt it wherever it lives in the vehicle.

  • Dimensions: 95 × 118 × 42 mm
  • Material: ABS (or ASA)
  • Nozzle: 0.4 mm
  • Layer height: 0.2 mm
  • Walls: 6 perimeters
  • Infill: 100% (zig–zag)
  • Supports: Tree (auto), 30° threshold
  • Nozzle temp: 270 °C (260 °C first layer)
  • Bed temp: 90 °C
  • File: BodyTrailCurrentHeadwatersCaseBottomV5.stl
Headwaters case cover, 3D printed

Case Cover

The lid. A flat plate with the TrailCurrent logo embossed on the top face and four clearance holes for the cover screws. Print this one with the logo face up for the cleanest finish. The embossing shows beautifully with a satin filament and a fine layer height.

  • Dimensions: 91 × 95 × 4.5 mm
  • Material: ABS (or ASA)
  • Nozzle: 0.4 mm
  • Layer height: 0.2 mm
  • Walls: 6 perimeters
  • Infill: 100% (zig–zag)
  • Supports: None (prints flat, logo face up)
  • Nozzle temp: 270 °C (260 °C first layer)
  • Bed temp: 90 °C
  • File: BodyTrailCurrentHeadwatersCaseCoverV2.stl

Assembly

Start to finish in about thirty minutes, most of which is the print.

  1. 1

    Print the case

    Easiest path: open TrailCurrentHeadwaters.3mf from the CAD folder in Bambu Studio (or Orca) and print both plates. The profile is ABS, 0.2 mm layers, 100% infill, 6 walls, tree supports auto-enabled for the bottom. If you're slicing from STL, match those settings and add tree supports under the vent arches of the case bottom; the cover prints flat with no supports.

  2. 2

    Prep the compute stack

    Seat the CM5 on the Waveshare carrier board and attach the CM5 3007-B cooling fan to the SoC heatsink (plug its 2-pin lead into the carrier's fan header). Install the NVMe SSD in the M.2 slot and flash the TrailCurrent CM5 image to it on the bench; easier than doing it in the vehicle.

  3. 3

    Add the CAN HAT

    Seat the Waveshare RS485 CAN HAT (B) on the carrier's 40-pin header. Snug it down flat so the headers seat evenly.

  4. 4

    Drop it in the case

    Lower the carrier board into the bottom of the case. The integrated standoffs line up with the board's mounting holes, so no extra screws needed for the board itself.

  5. 5

    Wire the connectors

    Press the Deutsch DTM04-4P receptacle into its opening and wire it to the CAN HAT's CAN H / CAN L terminals plus power pass-through. Mount the Molex WM 4-pin power connector in its opening and wire it to the carrier board's power input.

  6. 6

    Close the case

    Drop the cover on. Secure with four M2.5 × 8 mm screws at the corners. Snug, not cranked down; the plastic threads are gentle.

  7. 7

    First boot

    Power it up. On first boot the setup wizard prompts for admin password and MQTT credentials. After that, the containers come up automatically and the dashboard is reachable at https://headwaters.local.

What It Runs

Five Docker containers, plus a handful of host-side services.

Frontend

Nginx serving the MapLibre GL progressive web app over HTTPS. This is Overlook, the dashboard you hit from any phone, tablet, or laptop on the vehicle's WiFi.

Backend

Node.js Express API. Handles the CAN–to–MQTT bridge, the cloud bridge, light and relay commands, thermostat, alarm notifications, and SMS over SSH to a cellular router.

Mosquitto

Eclipse Mosquitto MQTT broker over TLS on port 8883. Every module, every service, and every dashboard talks to each other through topics on this broker.

MongoDB

MongoDB 7 document store. Holds configuration, historical data, user settings, and encrypted credentials like the SMS SSH key.

Tileserver

Custom vector tile server with styles, fonts, and sprites. Serves offline map tiles baked into the image so navigation keeps working when cell service doesn't.

Host Services

can–to–mqtt.py bridges the physical CAN bus to MQTT. discovery–mdns.py finds modules on the local network. deployment–watcher.py applies OTA updates from the cloud when they land.

Build Your Own Headwaters

Every file is in the repository: CAD, firmware, container configs, setup scripts, and the CM5 image build system. Fork it, build it, make it yours.

Headwaters on GitHub