How to connect with Dodge Caliber?

Ideas and discussion of what to do with the CAN Bus ( i.e. XMDirect, iPod, Carputer, etc... )
mrdennis87
What's hacking?
Posts: 26
Joined: 2015 Nov 19 11:21

Re: How to connect with Dodge Caliber?

Post by mrdennis87 » 2015 Nov 19 21:41

linuxkidd wrote:grafffik:
I had a similar issue hacking the CAN bus on my RV w/ an Arduino and the SEEEDStudio CAN-BUS Shield. Banged my head against the wall for several days.. Until...

Code: Select all

START_INIT:
    if(CAN_OK == CAN.begin(CAN_125KBPS))
    {
        Serial.println("CAN BUS Shield init ok!");
        Serial.print("Resetting Filters...");
        CAN.init_Mask(0,1,0);
        CAN.init_Mask(1,1,0);
        for(int i=0;i<6;i++) {
          CAN.init_Filt(i,1,0);
        }
        Serial.println("Done");
    }
    else
    {
        Serial.println("CAN BUS Shield init fail");
        Serial.println("Init CAN BUS Shield again");
        delay(100);
        goto START_INIT;
    }
}
I RESET THE DAMN MASK/FILTERS!

Evidently, they came pre-set w/ some value that was blocking my data flow.. You may need to substitute the 2nd value as a 0 instead of 1 for the init_Mask and init_Filt calls ( 0 = normal CAN frames, 1 = Extended CAN frames ).

I **JUST** figured this out and thought I should share...

Have fun!
LK

So I was trying this code, and getting frustrated because I've spent the last 3 month's trying to get this to work. I think I found out why tonight though, that mine isn't working.. I am on a one wire Class2 (GM's early can bus), which is pin 2, J1850 VPW. The baud rate for this is 10.4k.. And no library supports connecting to that baud rate with the can bus shields :( I used my elm 327, and tried to connect to all of the different protocols. It would say can't connect.. until I connected to the J1850 VPW(ATSP2).. So I need to connect my Arduino/Can bus shield to the 10.4 baud rate and I should be good. Now to figure that out :p

mrdennis87
What's hacking?
Posts: 26
Joined: 2015 Nov 19 11:21

Re: How to connect with Dodge Caliber?

Post by mrdennis87 » 2015 Nov 27 12:08

thank you very much for the info! So I went ahead and applied all of the changes, trying with both versions of the cfg1, cfg2, cfg3.. Couldn't get it to connect still. I also tried changing the CS PIN to 9, then back to 10.. I'm attaching my library to this post, maybe I had missed something if you're up for double checking for me ? (:
MCP_CAN_lib-master.zip
(13.3 KiB) Downloaded 121 times
This board supports the J1850 VPW 10.4k Baud rate, but I Can't find the library to check my current one against it.. was thinking I could use the values from that library?
https://www.sparkfun.com/products/9555 I'm hoping I can get this board to work, instead of having to buy a whole different one.

Here is my Arduino Code.. All of the baud rates are highlighted orange, when typing them in. Except the 10K4BPS one, maybe it's not recognizing it?

Code: Select all

// demo: CAN-BUS Shield, send data
#include <mcp_can.h>
#include <SPI.h>

MCP_CAN CAN0(10);                                      // Set CS to pin 10

void setup()
{
  Serial.begin(115200);
  // init can bus, baudrate: 500k
  if(CAN0.begin(CAN_10K4BPS) == CAN_OK) Serial.print("can init ok!!\r\n");
  else Serial.print("Can init fail!!\r\n");
}

unsigned char stmp[8] = {0, 1, 2, 3, 4, 5, 6, 7};
void loop()
{
  // send data:  id = 0x00, standrad flame, data len = 8, stmp: data buf
  CAN0.sendMsgBuf(0x00, 0, 8, stmp);  
  delay(100);                       // send data per 100ms
}

/*********************************************************************************************************
  END FILE
*********************************************************************************************************/

User avatar
linuxkidd
Site Admin
Posts: 345
Joined: 2005 Jul 22 15:48
Location: Anywhere, USA
Contact:

Re: How to connect with Dodge Caliber?

Post by linuxkidd » 2015 Nov 27 12:53

mrdennis87: Just for confirmation, are you saying that you're not getting the 'can init ok' message? Or is there some other indication? The reason I ask, your sample code would send data, not receive it, so I just want to confirm what you're seeing.

LK
If you can read this, the light is still red.

mrdennis87
What's hacking?
Posts: 26
Joined: 2015 Nov 19 11:21

Re: How to connect with Dodge Caliber?

Post by mrdennis87 » 2015 Nov 27 13:02

linuxkidd wrote:mrdennis87: Just for confirmation, are you saying that you're not getting the 'can init ok' message? Or is there some other indication? The reason I ask, your sample code would send data, not receive it, so I just want to confirm what you're seeing.

LK

I understand it would send data, the receive example didn't have an if statement to print the results of the connection, and the send did, I was just using the send sketch to see if I could get a connection. If I can get a connection, then I can proceed with listening to the can bus. I do not get a can init ok message, only the can init fail (for some reason it prints the can init fail message twice in the serial monitor..) I used both examples for the bit rates for the three cfg1, cfg2, cfg3, I even went to the calculator and tried a couple more sets. When I type the new baud rate I've added into the library, it doesn't highlight orange like that other ones do.. When I close Arduino IDE all the way out, and reopen the project that reloads the library correct? or do I need to re import it?

User avatar
grafffik
How the heck did I end up here?
Posts: 8
Joined: 2015 Jan 23 12:08
Location: Warsaw, Poland
Contact:

Re: How to connect with Dodge Caliber?

Post by grafffik » 2016 Jan 04 11:49

Hi.
I use SPI.h and mcp_can.h
___
one lone man want to hack Dodge in Poland :lol:

mrdennis87
What's hacking?
Posts: 26
Joined: 2015 Nov 19 11:21

Re: How to connect with Dodge Caliber?

Post by mrdennis87 » 2016 Jan 04 13:30

The board I was using just didn't want to connect to the GM J1850 :/ they didn't support it. I ordered a different can bus shield that supports and it and everything's working great now :D
I even have a voice shield set up with it to control the vehicle by voice ;) ty guys!

User avatar
grafffik
How the heck did I end up here?
Posts: 8
Joined: 2015 Jan 23 12:08
Location: Warsaw, Poland
Contact:

Re: How to connect with Dodge Caliber?

Post by grafffik » 2016 Jan 04 15:52

so, what you can bus shield you order ?
I use cheapest shiled from aliexpress and works fine :)
Tomorrow I'll make photos my "hack tools" :D
___
one lone man want to hack Dodge in Poland :lol:

mrdennis87
What's hacking?
Posts: 26
Joined: 2015 Nov 19 11:21

Re: How to connect with Dodge Caliber?

Post by mrdennis87 » 2016 Jan 04 16:48

This is the one I ordered that works good.

https://www.sparkfun.com/products/9555

Post Reply