Can't read CAN bus

Hi everyone, I'm new to microcontrollers and CAN protocol. I am trying to get an esp32 to read the CAN bus of my car using the SN65HVD230 transiever.

I have verified that the hardware works on its own by getting two esp32 boards to communicate over can. However when I try read the high speed can bus of my car, I get nothing. It somehow also appears to be messing with the cars electronics as when I reboot the esp32, for a brief moment the abs light comes on (normally off) and the check engine light turns off (normally on when the key is in the ignition but the car isn't on).

I am using pins 6 and 14 of the obd2 port and I have the bus speed set to 500kbps.

I had a look at the signal with a digital logic analyser and I am indeed getting a 500kbps signal on the pins I'm using. However when I connect the esp32, the signal becomes noisy and has a good amount of false, although very short (in the ns range) transitions. The esp32 still isn't able to pick up anything.

I think for some reason it's the esp32 or the transiever are to blame. Which is strange as I can transmit and receive data between two esp32s without an issue.

Caution Putting signals on the CAN bus can damage your vehicle. The fact that some things are cycling indicates that is what is happening. Until you get it working disable your transmitter.

How can I disable the transmitter? The code is not supposed to be transmitting anything, it should only be receiving so I am unsure what happens with the dashboard lights. It only happens when I reboot the esp32, after that everything goes back to normal.

That can be done in hardware, but without an annotated schematic I can only guess.

To provide the most accurate assistance, please include detailed information about your setup. Indicating the specific board, shield, wiring configuration, and power sources is crucial. An annotated schematic would be ideal as it would contain this information, but you should also include links to the technical details of your hardware components.

I am using a SN65HVD230 board, this is the link to the datasheet and general info:
https://www.waveshare.com/wiki/SN65HVD230_CAN_Board

I have the 3.3V and ground coming from the esp32 and I am connected pin 4 of the esp for the rx pin on the board and pin 5 on the esp for the tx pin.

I have also tried to connect the chassis ground and the signal grounds of the obd2 port to the ground of the board and that didn't seem to make any difference if either is connected or or neither.

I used a digital logic analyser to look at the can bus of the car and I can see it's at 500kbps as the shorted bit duration is 2μs, however I only managed to get some data if I set the can speed to 1Mbps on the esp32. But even then the data coming in is somewhat nonsensical, especially a few seconds after resetting the esp32. After a few seconds the read data would stop changing and the same ID and information was shown as being received over and over, however each time it was reset it would settle on a different ID and data.

I am using this arduino library:
https://github.com/sandeepmistry/arduino-CAN

I also tried connecting 10kΩ resistors between the tx and rx pins and the esp board and that also didn't make a difference.

Finish answering post #4.

I don't have an annotated schematic, I don't have the software to make one but I described my entire setup in the post above bar forgetting to mention which esp32 board I have, it is the CH340c.

You can download KiCad for free and it is fully featured for schematic capture. It can start with schematic capture and end with the Gerber files needed to make a PCB.

It will send an ACK, that is part of the protocol built into a CAN controller which is part of the processor.

P1 Header 4 Pin 2 is where your transmit signal is connected.