Skip to content

MotorvateDIY/ESP32_RET_SD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

58bf93f · Jan 31, 2025

History

24 Commits
Jan 2, 2025
Jan 30, 2025
Jan 3, 2025
Jan 2, 2025
Jan 2, 2025
Jan 31, 2025
Jan 2, 2025
Jan 2, 2025
Jan 2, 2025
Jan 2, 2025
Jan 30, 2025
Jan 2, 2025
Jan 2, 2025
Jan 2, 2025
Jan 2, 2025
Jan 2, 2025
Jan 30, 2025
Jan 2, 2025

Repository files navigation

ESP32 Based CAN Bus Reverse Engineering Tool with SD Card CAN Logging

ESP32 Reverse Engineering Tool with stand alone SD CAN bus logging and wifi support for SavvyCAN.
Based on Collin Kidder fantastic A0RET.

Fusion_CAN_logger

Main Goal: Easy to use CAN Bus Recording to SD Card or with SavvyCAN

  • If a FAT32 formatted SD card IS detected at power up, all CAN bus data is saved to the SD card, in SavvyCAN, CSV/GVRET format
  • If a FAT32 formatted SD card IS NOT detected, a WIFI access point is created for a SavvyCAN connection to receive and/or send CAN frames

With a focus on ease of use, the following changes have been made from A0RET

  • Removed: ELM327 compatability
  • Removed: LAWICEL
  • Removed: Bluetooth
  • Removed: Digital and Analog I/O
  • Added: Saving all CAN data to SD card in SavvyCAN CSV format

Now compiles using default 1.2MB APP partition

SD, CAN and WIFI Configuration Settings

If using the MotorvateDIY CAN BUS LOGGER V1.0 board, no configuration changes are required.
OR change the required setting(s) in config.h to match your hardware:

  • SD card pins on lines 43-46 (default: Standard VSPI where SD_SCK 18, SD_MISO 19, SD_MOSI 23, SD_CS 5)
  • CAN Tx/Rx pins on lines 50-51 (defaut: GPIO_CAN_TX 17, GPIO_CAN_RX 16)
  • CAN bus speed on lines 54 (default: 500,000 bits/second)
  • SSID and password on lines 54-55 (default ESP32_RET_SD and motorvate)

How to Program/Flash the ESP32

Web Flash Requirements:

  • Your hardware must use the default config.h settings or use the MotorvateDIY CAN BUS LOGGER V1.0 board
  • Only supported by Google Chrome or Microsoft Edge at this time
  • If the above is good, use this link: ESP32_RET_SD_webflash

Compile/Programming Requirements:

You will need the following to be able to compile the run this project:

  • Arduino IDE Tested on IDE v2.3.4
  • Arduino-ESP32 Support - Allows for programming the ESP32 with the Arduino IDE (Tested on Arduino core 2.0.17 and 3.1.1)
  • esp32_can - A unified ESP32 CAN library. (Must use this version if you want SD CAN log timestamps)
  • can_common - Used by esp32_can
  • To record to a SD card, it must be 32GB or less and formatted in FAT32

See parts list and wiring diagram below.

DIY: CAN Data Logger for ESP32_RET_SD

You can easily build your own hardware for the ESP32_RET_SD

You will need:

  • 30 Pin ESP32 Dev Kit
  • 3.3v CAN Bus Tranceiver (SN65HVD230)
  • SD or micro SD module
  • OBD Connector (Male)
  • Micro USB cable and laptop or power bank for power or 5v DC to DC converter

Then, connect everything as shown below: (click to enlarge)

Fusion_CAN_logger

Once Assembled, you can use the ESP Web Flasher with Google Chrome or Microsoft Edge: ESP32_RET_SD_webflash

MotorvateDIY CAN LOGGER Story

First Version

Four years ago, this what I used for a low cost (<$15!) CAN bus data logging tool: SavvyCAN, with A0RET. I used a 30 pin ESP32 dev kit, a 3.3v CAN bus transceiver (SN65HVD230) module and a male OBD connector.

Plugging it into the OBD diagnostic port (pre ~2018, no CAN gateway!), connect it to a USB power bank and use a laptop running SavvyCAN to record the CAN bus over wifi. It was a low cost and reliable solution.

Fusion_CAN_logger_v1

Second Version

Sometimes, you don't want a laptop with you to record the CAN bus, all you want to do is plug something in and go. So... I switched to a ESP32 D1 Mini, added a micro SD card shield, a DC to DC converter to drop the car's 12-14 volts down to ESP32 levels and added a power switch.

With a FAT32 formatted micro SD card (32GB or less) and plugging it into the OBD diagnostic port, all the CAN bus data is recorded to the SD card in SavvyCAN CSV/GVRET format for easy analysis. I used this for three years without a single issue.

Fusion_CAN_logger_v2

Third Version

Using the electronics design feature in Fusion 360, I made nice small PCB that fits inside a standard(ish) AliExpress OBD enclosure. Assembly is now much faster than cutting, stripping and soldering a bunch of wires, like the second version -AND- you don't need to double check to make sure each wire is connected to the correct pin!

Fusion_CAN_logger_v3

Why ESP32_RET_SD?

At this point I wanted the best of both worlds, plug and play CAN bus logging to SD card, and using SavvyCAN on wifi to send/receive CAN messages. This is how ESP32_RET_SD came to be. Over the last few months I've tested it on a few older vehicles (2011 & 2015) and all looks to be working well.

Fusion_CAN_logger

Soooo, if you want a good and low cost way to start to learn about CAN bus, this just might be a good place to start.

Step by Step CAN bus Sniffing and Reverse Analysis videos will be posted here and on my YouTube Channel, once editing is done.

NOTE: Some vehicles after around 2015 may have a CAN bus gateway that block CAN bus messages from the OBD port, and nothing is recorded.

About

CAN Bus reverse engineering tool firmware for the ESP32

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published