marcio.ota:
I should cross SI and SO ?? Or close J1 jumper (terminal resistor 120ohms?
Nano x MCP2515
SI <--> SO
SO <--> SI
No, MOSI should go to MOSI and MISO to MISO like you have it or else configuration would have failed.
The Arduino Nano is based off the ATmega328 microcontroller which is what the Duemilanove and the Uno use. I've used the library with plenty of ATmega328 ICs, so there shouldn't be an issue with the Nano.
marcio.ota:
I changed in your code (like nexts posts): [...] INT on pin 9 -> pin 10
I hope you meant the CS pin.
I just tested the code against my vehicle and found some bugs that I fixed. Would you please try it again. I messed up initializing the generic filters and corrected the less generic filters.
Just remember, if you do not receive any messages when using the loopback test, that means there is possibly a wiring issue between the Arduino and the CAN interface or the CAN interface is bad.
Just for example, this is what I expect to see in serial console when connected to a vehicle:
is the payload being sent to onto the CAN bus. The third byte, 0x00, is the PID I have the program requesting. Your output this request tells me what PIDs 0x01 to 0x20 are available. It appears that PIDs 0x01, 0x04, 0x05, 0x0C, 0x0D, 0x1C, and 0x20 are available. If you change the 0x00 in that request to 0x0C, the 0x7E9 message should show engine speed. More info on OBD-II PIDs can be found here: OBD-II PIDs - Wikipedia
Additionally, you can try the receive example sketch included with the library and that should show you anything your vehicle transmits without a request, but be aware that data is usually not disclosed publicly outside of what others may have decoded. Google would be your friend here.
Great! I get a lot of data Standard (over 500kbps and unfiltered). Standard was only from engine? To get data of steering wheel, a/c,... is in extended? If I connect in CAN of radio, its possible get this type of data?
tanks a lot!!!
Edit: Only works if I set: #define standard 1
// 7E0/8 = Engine ECM
// 7E1/9 = Transmission ECM #if standard == 1 #define LISTEN_ID 0x7EA #define REPLY_ID 0x7E0 #define FUNCTIONAL_ID 0x7DF #else #define LISTEN_ID 0x98DAF101 #define REPLY_ID 0x98DA01F1 #define FUNCTIONAL_ID 0x98DB33F1 #endif
marcio.ota:
Great! I get a lot of data Standard (over 500kbps and unfiltered). Standard was only from engine? To get data of steering wheel, a/c,... is in extended? If I connect in CAN of radio, its possible get this type of data?
tanks a lot!!!
That data could be from anything on the CAN bus. The ID type doesn't mean anything other than how many bits are available in the ID.
marcio.ota:
Edit: Only works if I set: #define standard 1
// 7E0/8 = Engine ECM
// 7E1/9 = Transmission ECM #if standard == 1 #define LISTEN_ID 0x7EA #define REPLY_ID 0x7E0 #define FUNCTIONAL_ID 0x7DF #else #define LISTEN_ID 0x98DAF101 #define REPLY_ID 0x98DA01F1 #define FUNCTIONAL_ID 0x98DB33F1 #endif
OBD-II has two standards on CAN, one uses standard IDs and the other uses extended IDs. My old Ford Escape used standard IDs while my 2015 Renegade uses extended.
marcio.ota:
Why LISTEN_ID and REPLY_ID are needed?
They are not used. Its code from another sketch that I used as a base. I was simulating an OBD-II ECM.
marcio.ota:
I always need to send at least 1 query to start receiving the dump (unfiltered). Is this really necessary? (like to register the new slave ID)
For your vehicle, yes it very well could be. I really have no way to know, but in my experience with a Ford Escape and a Jeep Renegade, they have a constant stream of CAN data when the vehicle ignition is first turned on (engine still off).
The only way to find out is to search for others trying to interface with a similar vehicle by the same make to see what they've found out.
Hi,
I use the same can bus module and the same library. In the standard setting I can get answer on standard OBD pid request - rpm, coolant temp etc. But only when I send request, I get answer.
But I cant recieve no traffic. When I use example to recieve can bus communication, in the terminal is shown nothing.
My car is VW sharan from 2011.
stepos:
Hi,
I use the same can bus module and the same library. In the standard setting I can get answer on standard OBD pid request - rpm, coolant temp etc. But only when I send request, I get answer.
But I cant recieve no traffic. When I use example to recieve can bus communication, in the terminal is shown nothing.
My car is VW sharan from 2011.
Thank you tor your help
same issue here. i cant get any data without request from my 2015 mazda3.
pls help