sandeepmistry / arduino-CAN

An Arduino library for sending and receiving data using CAN bus.
MIT License
696 stars 237 forks source link

Doesn't work on SN65HVD230 Transceiver #6

Closed ruffle-b closed 6 years ago

ruffle-b commented 6 years ago

Nice library but it doesn't work on a SN65HVD230 Transceiver (which are now very common).

Using your simple EngineRPM demo; it hangs at CAN.endPacket() (the standard can library in esp-idf does work with SN65HVD230).

Weirdly, if I put a Serial.println immediately before that it not only hangs but I have to power cycle my ESP32 before it will talk again:

CAN.write(0x0c); // engine RPM
Serial.println("Written 0x0c");
CAN.endPacket();
sandeepmistry commented 6 years ago

Hi @ruffle-b,

Are you connecting it to a car? Have you tried any of the non-OBDII examples?

I've successfully used a SN65HVD230 transceiver for board to board, but haven't had success getting OBD-II data from a car with it.

rakhmaevao commented 6 years ago

Hi, all. It is problem have a solution. Very important chip imaging. Set the terminator to 60 ohms. If the free standing on the bus is not 1.65 V, then use pull-up resistors for this. CANH > RES 3kOhm > GND (Pull down) CANL > RES 3kOhm > +3,3 V (Pull up)

rakhmaevao commented 6 years ago

Driver ADM3053 also works.))

quadcodes commented 6 years ago

I tried using with my Suzuki. I'm getting following data on CAN BUS.

Received packet with id 0x13 and length 4

?0p

Received packet with id 0x39 and length 0

Received packet with id 0x41 and length 0

How do I read/parse this data as OBD response ? I tried using your OBD library along with this but It shows nothing on serial.

rakhmaevao commented 6 years ago

image

Your data is output if the LENGTH is not zero.

sandeepmistry commented 6 years ago

@quadcodes please open another issue for your questions as it's not related to the original topic of this issue.

sandeepmistry commented 6 years ago

@rahmaevao thanks for the tips!

sandeepmistry commented 6 years ago

Closing due to lack of feedback.