2

I bought the CAN-Shield from Sparkfun https://www.sparkfun.com/products/13262 and I also got the Uno from Sparkfun just to be sure everything works fine.

Some info about my car:

  • BMW E91 2006
  • OBD2 is available
  • KWP 2000 and other lines are available like the ones with the same baud rates from the demo

I tried the SparkFun_CAN_Demo which is available on their website and GitHub.

My output is that CAN init is successful but I don´t know if that´s true... If I try to read the RPM, for example, I get a buffer with a size of 1 -> " ".

My questions are:

  • Did I something wrong with the MCP2515 how do I know if it´s dead?
  • Does anybody know if the demo is working properly or not?
  • What´s the right way to get data from an BMW with OBD2?
  • what is the content of the buffer? – jsotola Dec 31 '18 at 20:28
  • Do you know the bitrate of your BMW's CAN-Bus? If not, have you tried different bitrates? – oh.dae.su Dec 31 '18 at 23:42
  • @oh.dae.su I tried different bitrates but none work I know that my BMW supports KWP 2000 with a bitrate of 10.5kbits and the standard OBD-II ISO with a rate of 500kbits – Kasti96 Jan 1 at 12:25
  • @jsotola it´s just a space char -> " " – Kasti96 Jan 1 at 12:27
0

First off I cannot say much about the library that you are using I have't tried that one yet as for the shield i have some of those and there are two versions of them check your PIN outs on them the cs pin is either on d9 or d10

the other thing is make sure that you are in the right operation mode ie. Normal and maybe give this library a try I have had lots of success with this one: https://github.com/coryjfowler/MCP_CAN_lib

as for the baud rate I have tried all types of ways of getting the right baud rate for certain vehicles but the best remains start small and step it up till you get the one that gives you reply

make sure that you ground the Arduino to the car as well it works without that but sometimes it does nothing If you are using the OBDII cable it should be grounded by default

  • Thank you for your reply, your suggestions seem to be a good way to find out what I´ve done wrong. – Kasti96 Jan 1 at 11:33
  • I have battled in the beginning and am still battling with the STM32 CAN bus but i think I have the Arduino one sorted from my side give that library a try it is the best one i could find be sure to use this line: if(CAN0.begin(MCP_ANY, CAN_500KBPS, MCP_16MHZ) == CAN_OK) and this: CAN0.setMode(MCP_NORMAL); one to set your device up right – Tjaart van aswegen Jan 1 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.