How zeroomega/canmim works
CANMIM is ESP32-C3 firmware that bridges vehicle CAN traffic, adds oil-pressure sensor measurements as custom CAN frames, and exposes CAN data over BLE. The principal flow is CAN/ADC acquisition, frame queuing and transmission to the second CAN bus; a BLE service provides a parallel data and filter interface. The excerpts show the main task orchestration and key calls, but omit portions of main.cpp and the MCP2515 integration, so some internal details are represented only where supported by the README or visible calls.
Main entry points: main.cpp Firmware Orchestrator · ble.cpp BLE GATT Service · board_config_v4.h Board Pin Config · canmim.h CAN Frame Contract
Components 15
Acquisition
- TWAI CAN I/O
main/main.cpp - MCP2515 SPI I/O
main/main.cpp - ADC Sampling
main/main.cpp - Pressure Encoding
main/main.cpp
CAN Bridge
- Firmware Orchestrator
main/main.cpp - CAN Frame Contract
main/canmim.h - CAN Queues
main/main.cpp
BLE Interface
- BLE Output Queue
main/main.cpp - BLE GATT Service
main/ble.cpp - CAN Filter Control
main/ble.cpp
Device Support
- Board Pin Config
main/board_config_v4.h - Status LED Driver
main/led_strip.c
Other components
- Vehicle CAN
- Oil Sensor
- Data Logger
Connections 21
- Firmware Orchestrator → TWAI CAN I/O: initializes
main/main.cpp - Firmware Orchestrator → MCP2515 SPI I/O: starts task
main/main.cpp - Firmware Orchestrator → ADC Sampling: starts sampling
main/main.cpp - Vehicle CAN → TWAI CAN I/O: CAN traffic
README.md - TWAI CAN I/O → CAN Queues: queues frames
main/main.cpp - Vehicle CAN → MCP2515 SPI I/O: CAN traffic
README.md - MCP2515 SPI I/O → CAN Queues: queues frames
main/main.cpp - Oil Sensor → ADC Sampling: analog signal
README.md - Firmware Orchestrator → Pressure Encoding: converts readings
main/main.cpp - Pressure Encoding → CAN Queues: queues CAN frame
main/main.cpp - CAN Queues → TWAI CAN I/O: transmits frames
main/main.cpp - TWAI CAN I/O → Vehicle CAN: forwards CAN
README.md - CAN Queues → BLE Output Queue: routes CAN data
main/main.cpp - Firmware Orchestrator → BLE GATT Service: starts BLE task
main/main.cpp - BLE Output Queue → BLE GATT Service: provides frames
main/main.cpp - BLE GATT Service → Data Logger: notifies CAN
- Data Logger → CAN Filter Control: writes filters
- BLE GATT Service → CAN Filter Control: handles writes
main/ble.cpp - Firmware Orchestrator → Status LED Driver: updates status
main/main.cpp - Board Pin Config → Firmware Orchestrator: configures pins
main/main.cpp - CAN Queues → CAN Frame Contract: stores frames
main/canmim.h