How forbes-automotive/openhaldex-c6 works
OpenHaldex is ESP32-C6 firmware that sits between a vehicle and its Haldex differential. Vehicle CAN signals drive configured modes and lock calculations; the firmware then relays or generates CAN commands. Users configure and inspect it through the web UI, with Bluetooth, diagnostics, wireless updates, and gauge relay as additional capabilities. The graph preserves README-documented capabilities; where sampled code does not expose runtime wiring, it omits those links rather than inferring calls.
Main entry points: OpenHaldexC6_can.cpp CAN interfaces · OpenHaldexC6_Calculations.cpp Mode and lock calculations · OpenHaldexC6_WiFi.cpp Wi-Fi access and bridge · OpenHaldexC6_tasks.cpp Learning and background tasks
Components 23
Vehicle control
- CAN interfaces
src/OpenHaldexC6_can.cpp - Chassis decoding
src/OpenHaldexC6_ChassisOther.cpp - Mode and lock calculations
src/OpenHaldexC6_Calculations.cpp - Standalone CAN generation
src/OpenHaldexC6_StandaloneCAN.cpp - Learning and background tasks
src/OpenHaldexC6_tasks.cpp
Configuration and access
- Web configuration and diagnostics
data/app.js - HTTP API
src/OpenHaldexC6_API.cpp - Settings persistence
src/OpenHaldexC6_Settings.cpp - EEPROM settings store
src/OpenHaldexC6_EEP.cpp
Diagnostics and connectivity
- Wi-Fi access and bridge
src/OpenHaldexC6_WiFi.cpp - Bluetooth LE
src/OpenHaldexC6_BLE.cpp - Wireless updates
src/OpenHaldexC6_OTA.cpp - CAN analyzer bridge
src/OpenHaldexC6_Analyzer.cpp - UDS and TP2 diagnostics
src/OpenHaldexC6_UDS.cpp - Gauge frame relay
src/OpenHaldexC6_ESPNow.cpp
Firmware runtime
- Buttons and outputs
src/OpenHaldexC6_IO.cpp - Firmware startup
src/main.cpp - Shared firmware state
src/OpenHaldexC6_globals.cpp - Controller definitions
include/OpenHaldexC6_defs.h - Firmware version metadata
include/OpenHaldexC6_ver.h
Other components
- Driver
- Vehicle CAN networks
- Haldex differential
Connections 21
- Driver → Web configuration and diagnostics: configures
README.md - Web configuration and diagnostics → HTTP API: sends settings
data/app.js - Vehicle CAN networks → CAN interfaces: sends CAN signals
README.md - CAN interfaces → Vehicle CAN networks: bridges CAN traffic
README.md - Vehicle CAN networks → Chassis decoding: provides chassis signals
README.md - Vehicle CAN networks → Mode and lock calculations: provides OEM signals
README.md - Mode and lock calculations → Haldex differential: modifies lock requests
README.md - Standalone CAN generation → Haldex differential: generates CAN commands
README.md - Driver → Buttons and outputs: uses controls
README.md - HTTP API → Settings persistence: applies settings
- Settings persistence → EEPROM settings store: persists settings
- Driver → Bluetooth LE: uses phone app
README.md - Driver → Wi-Fi access and bridge: configures device
README.md - Wi-Fi access and bridge → Wireless updates: supports updates
README.md - CAN interfaces → CAN analyzer bridge: exposes CAN traffic
README.md - Haldex differential → UDS and TP2 diagnostics: provides diagnostic data
README.md - CAN interfaces → Gauge frame relay: relays CAN frames
README.md - Firmware startup → Wi-Fi access and bridge: starts Wi-Fi
src/main.cpp - Firmware startup → Gauge frame relay: stops relay during reset
src/main.cpp - Learning and background tasks → Standalone CAN generation: uses CAN generation
src/OpenHaldexC6_tasks.cpp - Learning and background tasks → Mode and lock calculations: uses calculations
src/OpenHaldexC6_tasks.cpp