Everything I learnt about the CAN bus from building cars

6 points by janosch_123 4 months ago | 3 comments
  • Terr_ 3 months ago
    I have a stalled project to read events from one of my car's CAN buses that I really need to get back to... The easily accessible OBD-II port is either the wrong network, or filters out the interior cabin stuff I'm interested in.

    Even as a non-C/C++ person, it was honestly easier than I expected to get raw data: A small breadboard with an ESP32 chip and a CAN transceiver chip, power them both from my phone's USB-C port, and run an app to log serial output coming back over the same cable. I just need to plug the transceiver's high/low CAN wires into the right spots to start recording raw messages.

    The biggest frustration, besides removing stubborn car paneling, is that so much of the CAN bus traffic is undocumented (no DBC) so I need to change things and look for time-correlated patterns.

    • janosch_123 3 months ago
      Filtering I haven't seen, but I am sure some manufacturers heavily sanitise their output.

      Taking a log and annotating the values while opening the window, stopping and starting the car is exactly how you go about reverse engineering components. The problem is you can never be sure you really found all messages.

    • janosch_123 4 months ago
      A (hopefully) concise & practical introduction:

      2 min theory followed by 2 min of listening to an existing network followed by 2 min of common pitfalls when building your own network.

      I built my own electric cars from 2018 - 2023 and am now sharing everything I learnt with you in a series of videos and on https://foxev.io/academy in a learning web app :)

      I hope this helps someone!

      • 4 months ago