← All projects

Real-time Vehicle Network on Two ESP32s

A car's driver-assistance unit and brake ECU on two ESP32s that talk over ESP-NOW. I broke its task priorities on purpose, predicted each outcome in writing, measured it, and fixed the design.

What I did

  • Built seven FreeRTOS tasks per board with set priorities and core pinning, and a 100 Hz control loop that missed no deadlines
  • Starved the tasks on purpose at three priorities, predicted each outcome in writing, then measured it
  • Fixed the mechanisms, not the symptoms: stale brake requests rejected, braking moved off a low-priority loop, and a supervisor on the other core

Diagrams

  • System overview: an ultrasonic sensor on the driver-assistance ESP32, which sends brake requests over ESP-NOW to the ECU ESP32 and its brake lamp
  • The FreeRTOS tasks, priorities and queues on both boards, with the timed path from ping to confirmed brake