Hi everyone - looking for some help to get my project off the ground. My goal is to read CAN bus and/or ODBII PID data using an Adafruit ESP32 feather and a Waveshare SN65HVD230. I will upload a pic of the wiring schematic but I feel pretty confident in that, as well as the pinout from my OBDII connector. CAN high/low both measure ~2.5V with a multimeter straight off the port in my VW, and those are attached via screw terminal to the Waveshare. Waveshare has power and ground, and the OBDII pinout has both signal and chassis ground running to the same ground as Waveshare. Waveshare is powered with 3.3V/ground from the ESP32.
I have tried using the ESP32 Can library found here, which contains a CAN_config header file that relies on FreeRTOS, relying on avr.io. I tried compiling this in Visual Studio and realized I was lacking the AVR file, but switching back to Arduino IDE, I was able to compile the 'esp32CanBasic' file successfully at a 500kbps baud rate, which I know to be the standard for VW vehicles.
Now, hooking into OBDII port while outputting to the serial monitor reveals.... nothing!
I am very new to CANbus, and appreciate any and all input! I have a pair of Adafruit Feather M4 CAN Express with ATSAME51 boards, an altimeter, and thermocouples delivering this week, so I'm hoping to get a benchtop setup operational where I can read atmospheric pressure, and a few temperatures, then transmit that data over a standalone CANbus from one feather to the next.
All this will effectively combine to allow me to read aftermarket sensors in the car, as well as factory sensors directly from the ECU.
Hi, did you get anywhere with this? I am trying to build a similar thing from a GitHub project for the ESP32 where it sends CAN messages to a Citroen "Confort" CAN bus as 125K, but yet it shows no data out, on my car or the PCan CAN analyser I have (which I have used to sniff the bus and send messages manually, and know that analyser works) but the ESP32 seems not to send the data to the pins indicated in the project. I wonder if we need to use a specific ESP32 which contains a CAN controller.
I am also using a clone of he SN65HVD230. The problem I feel, is the DIO pins used to send the data to the CTX and CRX pins on the SN65HVD230 can not send "data" unless in digital bit format, so probably better to use a serial pin pair (my board has a couple of sets marked RX0 / TX0 for example) - and may need to use the library for the 2515 as in [#include <MCP2515.h> ]
You need to be sending data as a differential serial port from the ESP32 so use one with a built in CAN controller / differential serial port - not the DIO pins. This is what the SN65HVD230 expects, not digital bits or states on the DIO pins.
I am going this route myself now, as I realise the mistake I made in assuming this could be done using DIO pins. I'm now sure it can't be.
I wasn't getting anywhere with the Wavehsare so I switched over to an Adafruit M4 CAN Express and have had great success. Used a dealer-level diagnostic tool to poll specific PIDs through an OBDII splitter while monitoring requests and responses with my device. This allowed me to build a system that can monitor 20+ sensors and display them in real-time or write to an SD card.