CAN-Bus Shield / Arduino Uno / Interpreting basic data from OBD-II connection

Hello all

I have connected the CAN-Bus Shield to my car and I have not seen many messages, but these :

(The format is : before the ">" is the CAN ID, and after are the values got from the CAN bus).

CAN BUS Shield init ok!
00>
00>
00>
00>
A00>1D:09:24:39:76:37:E2:63:00:00:0A:00:00:00:1D
A000A00>FF:FF:FF:FF:FF:FF:FF:FF:01:00:0A:00:0A:00:FF
A000A00>FF:FF:FF:FF:FF:FF:FF:FF:01:00:0A:00:0A:00:FF

(....many many times...)

Until here the card is still not connected to the OBD-II port.

Now it is being connected :

A000A00>FF:FF:FF:FF:FF:FF:FF:FF:01:00:0A:00:0A:00:FF
A000A00>FF:FF:FF:FF:FF:FF:FF:FF:01:00:0A:00:0A:00:FF
A000A00>
724>9D:09
720>1D:09
7200A00>FD:F9:E4:7B:F6:F7:E6:67:01:00:0A:20:07:00:FD
A000A00>FF:FF:FF:FF:FF:FF:FF:FF:01:00:0A:00:0A:20:07
A000005>FF:FF:FF:FF:FF:FF:FF:FF:01:05:00:00:0A:00:FF
50005>FF:FF:FF:FF:FF:FF:FF:FF:01:05:00:05:00:00:FF
50005>FF:FF:FF:FF:FF:FF:FF:FF:01:05:00:05:00:05:FF
50005>FF:FF:FF:FF:FF:FF:FF:FF:01:05:00:05:00:05:FF

(... many many times the 50005 message only here...)

(OBD-II port being disconnected here...)

50005>FF:FF:FF:FF:FF:FF:FF:FF:01:05:00:05:00:05:FF
50005>7F:FF:FF:FF:FF:C0:B0:FE:01:05:00:05:00:05:7F
50005>FC:80:00:0E:00:00:FF:FF:01:05:00:05:00:05:FC
50005>00:00:00:00:00:00:C0:00:00:05:00:05:00:05:00
00>E7:E0:00:00
00>
00>
17>
17>
1E30F0>
1E30F0>
30F00005>FF:FF:FF:FF:FF:FF:FF|F:FF:FF:FF:01:05:00:F0:30:1E:00
1E30F0>

If any one of you could point me in the right direction in order to understand how to hack this CAN Bus :slight_smile:

As you have not posted the shield and code that you are using I fear that it will be difficult/impossible to provide any help.

What are you expecting the CAN-Bus messages to look like ?

I'm idiot :slight_smile:

Here is the source code :

Anyway, I've just given it another try and my can-bus shield works hardly... Because of I think a bad contact.

I've made another try with the basic example below and got a new bunch of freshly formatted messages :

INT32U canId = 0x000;

void loop()
{
    if(CAN_MSGAVAIL == CAN.checkReceive())            // check if data coming
    {
        CAN.readMsgBuf(&len, buf);    // read data,  len: data length, buf: data buf
        
        canId = CAN.getCanId();
          
        Serial.print(canId, HEX); Serial.print('>');
        
        for(int i = 0; i<len; i++)    // print the data
        {
          if (buf[i]<16)
          {
            Serial.print('0');
          }
          
          Serial.print(buf[i],HEX);
          
          if (i<len-1)
          {
            Serial.print(":");
          }
        }
        
        Serial.println();
    }
}

Here is the output hardly got after redeploying the application many times :

CAN BUS Shield init ok!
0>
3E0003>FF:FF:A4:39:76:13:E2:23:00:03:00:3E:00:0E:FF
A410924>
1FF96F07>09:24:39:76:37:E6:67:00:07:07
38>07:07:07:07:07:07:07
38>07:07:07:07:07:07:07
38>
38>07:07:07:07:07:07:07
38>07:07:07:07:07:07:07




CAN BUS Shield init ok!
0>
0>
0>
0>
0>
0>
0>
124>1D:09
120>1C:08
120>1C:08
1FDD1E7B>AF:E4:BE:93:6B:FF:CC:67:00
297E0F:FF:FF:E6:67:00:07:F:E6:67:00:07:00:7E:29:1E:7B
7001C>7B:F0:1F:00:00:B4:20:00:00:1C:00:07:00:7E:29:03:1F:00:00:B7:20:00:00:25:00:1C:00:07:00:07
1C0025>29:03:1F:00:00:B7:20:00:00:25:00:1C:00:07:29:03:1F:00:00:B7:20:00:00:25:00:25:00:1C:00:0F:00:00:00:10:00:00:00:33:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:30:30:37:3E:46:46:3A:46:39:3A:36:34:3A:33:33:41:3A:34:36:3A:33:39:3A:33:41:3A:33:36:3A:33:34:3A:33:41
18>
18>

The real question is has anyone any database around the IDs sent, the algorithms etc... Specific to a make for example :slight_smile:
I have time to search, while I'll try to get a replacement :wink:

Some videos for the record :slight_smile: :

seeedstudio does know about this problem and they told me to try to isolate the two metallic parts that are in contact but nothing to do, I tried everything. They even told me to try to separate the Arduino and the CAN-Bus shield and that does not work also.

I have lost 60€ !

I'll never buy Arduino and CAN-Bus shield and I'll make everyone know my story on my blogs, videos and websites.

See you.

rnsft:
I'll never buy Arduino and CAN-Bus shield and I'll make everyone know my story on my blogs, videos and websites.

I see. You bought some stuff, and you don't understand the results and that is our fault? I presume you have not googled stuff linking Arduino to OBD2? Or noticed that there are a couple of open source programs but mostly closed that sell for good money?

But never mind that, we are supposed to know how to work a product you bought from someone who we don't know, you haven't linked to it or anything.

As a first attempt you are trying to hack a complex system....

Have you thought of learning to crawl before starting an Apollo moon shot?

rnsft:
See you.

Possibly... Possibly not.

No you did not understand :

  • I bought arduino + can-bus shield + obd-II cable
  • I tried some programming : the arduino works well, but the can-bus shield sends erroneous data, after a long delay before the can-bus shield is started
  • What I did not understand is that the can-bus shield sends data even when not connected to a CAN Bus !!!
    ----> these data sent by the can-bus shield are incoherent data (nothing that is compliant to OBD-II standard)
    ----> where do these data come from ?
    ----> they come from a bad contact between the usb port and the obd-II port <=> between can-bus shield and the arduino card !!!!!
    ----> the seller of the can-bus shield admits the problem < IMPORTANT !!!!
    ----> the seller of the can-bus shield told me to try to isolate the two mettalic parts < IMPORTANT !!!
    ----> the two metallic parts cannot be isolated because it needs the can-bus shield to be separated from the arduino board, and then no communication with can-bus shield cannot be made !

It is normal that the data cannot be interpreted because it is INCOHERENT data due to a BAD CONTACT between TWO metallic parts (important ones = USB and OBD-II DB9 Style)

ChilliTronix:
I see. You bought some stuff, and you don't understand the results and that is our fault? I presume you have not googled stuff linking Arduino to OBD2? Or noticed that there are a couple of open source programs but mostly closed that sell for good money?

But never mind that, we are supposed to know how to work a product you bought from someone who we don't know, you haven't linked to it or anything.

As a first attempt you are trying to hack a complex system....

Have you thought of learning to crawl before starting an Apollo moon shot?

Possibly... Possibly not.

rnsft,

I have the same setup as you and have had a few issues with sparse documentation. Here's what I have learned through trial and error as well as cobbling together what I can find online.

Parts I am using:

  • 2014 Audi A4
  • Arduino UNO R3
  • SeeedStudios CAN-bus Shield v1.0
  • OBD-II to D9 cable
  • ELM327 bluetooth dongle for troubleshooting
  1. Initially I could get no values from plugging everything together. While several other people online seem to have been having no trouble getting a flood of data from their CAN-bus, I literally would get the "CAN BUS Shield init ok!" message followed by absolutely no data.

  2. The R3 resistor! A fellow in South Africa helped remind me that the R3 resistor might need to be removed from the CAN-bus shield in order to allow it to properly terminate or something like that... I removed it and still nothing happened.

  3. Another friend noticed the contact you have been mentioning in your posts between the usb port on the Arduino and the metal pins protruding from the bottom of the CAN-bus shield. We simply added some electrical tape to both sides and this contact is now insulated. This didn't change anything.

  4. I then used the ELM327 to check and see if the OBD-II diagnostic port was available to anything other than an Audi diagnostic computer and of course, it worked perfectly and there was a ton of data available. Hope was restored but obviously the process is fairly frustrating to someone that is, as ChilliTronix pointed out, crawling. (I am new to all of this!)

*5. So the realization for me at this point in the project is that the OBD-II diagnostic port is behind something called the Gateway Control Unit. It cuts off access to the data completely, but with the correct initialization/handshake it will respond to queries for specific values (which is all I'm trying to do). This is why the ELM327 works... it knows how to communicate with the GCU so the goal became to listen in on the communication between the ELM327 and the car.

  1. I bought an extra OBD-II to D9 cable and cut it apart, connecting the ELM327 pins that are important to this effort to the cable and allowing the ELM327 to talk to the car while running the example sketch from SeedStudios called "receive_check". This simply listens for anything on the CAN-bus lines and reports it to the serial monitor. As a side note... this worked amazingly well.

  2. Here's where I'm at now as step 6 occurred last night.

  • I am getting a flood of data, and rnsft, it's gibberish in the same sense as wheat you are seeing, although I am not getting the hex values, I am getting a string of numeric values in sets of 8 numbers. But I also know that this is exactly what we are supposed to be seeing... it's now down to us to decipher what each string of values means, as I have seen plenty of this kind of information online. It's not well documented as it varies from manufacturer to manufacturer and even model to model, but you'll be able to use a variety of means to figure out what your signals mean (I'm being optimistic that this is the case as I see others doing the same).

I'll post more as I sort out what the signals mean... here is an example of the code the Arduino/CAN-bus is gathering... (this is just a snippet and the difference in layout is due to my code using a tab to deliniate where you have a ":" separating values...

2 1 16 0 0 0 0 0
4 65 16 1 55 0 0 0
2 1 12 0 0 0 0 0
4 65 12 12 122 0 0 0
2 1 0 0 0 0 0 0
6 65 0 190 31 168 19 0
2 1 1 0 0 0 0 0
6 65 1 0 7 229 0 0
2 1 3 0 0 0 0 0
4 65 3 2 0 0 0 0
2 1 4 0 0 0 0 0
3 65 4 26 0 0 0 0
2 1 5 0 0 0 0 0
3 65 5 127 0 0 0 0
2 1 6 0 0 0 0 0
3 65 6 130 0 0 0 0
2 1 7 0 0 0 0 0
3 65 7 142 0 0 0 0
2 1 12 0 0 0 0 0
4 65 12 12 122 0 0 0
2 1 13 0 0 0 0 0
3 65 13 0 0 0 0 0
2 1 14 0 0 0 0 0
3 65 14 135 0 0 0 0
2 1 15 0 0 0 0 0
3 65 15 88 0 0 0 0
2 1 16 0 0 0 0 0
4 65 16 1 49 0 0 0
2 1 17 0 0 0 0 0
3 65 17 30 0 0 0 0
2 1 19 0 0 0 0 0
3 65 19 3 0 0 0 0
2 1 21 0 0 0 0 0
4 65 21 134 255 0 0 0
2 1 28 0 0 0 0 0
3 65 28 3 0 0 0 0
2 1 31 0 0 0 0 0

The application I am using to instigate the communications is Movi... which is very awesome as I can run it on my laptop and connect to the ELM327 via bluetooth from my laptop. It has a potentially VERY helpful feature in that you can output a log file from Movi and it shows every step it's taking in full detail which is more descriptive than the data I've shown above. Here is an example...

Ignoring Line:SEARCHING...
lines[0]:01 57 41 55
lines[1]:4D 46 43 46 4C 38 45
lines[2]:4E 30 32 34 38 38 31
VIN:WAUMFCFL8EN024881
OBD Connection:Disconnecting serial port...
Serial Connection:Disconnecting...
Resetting serial port:...
Flushing serial port:...
Closing serial port:...
Serial Connection:Disconnected
Check connection:...
Serial Connection:Listing serial ports...
Serial Port 0:Bluetooth-Incoming-Port
Serial Port 1:Tilston6-WirelessiAP
Serial Port 2:OBDII-SPPDev

Connection preferences:
Serial Port: OBDII-SPPDev
Port Speed: 38400
Parity: No Parity
Timeout: 10
OBD Protocol: 0 - Automatic
Headers On: On

OBD Connection:Trying port: OBDII-SPPDev
Serial Connection:Opening: /dev/cu.OBDII-SPPDev
Serial Connection:Device Found
Serial Send:ATZ
Serial Read:ATZ

ELM327 v1.5

OBD Init:ELM327 v1.5 chip found.
OBD Init:Setting protocol on ELM chip...
Serial Send:AT SP 0
Serial Read:AT SP 0
OK

OBD Init:Setting headers...
Serial Send:AT H1
Serial Read:AT H1
OK

OBD Init:Turning on echo...
Serial Send:AT E1
Serial Read:AT E1
OK

OBD Init:Turning off line feeds...
Serial Send:ATL0
Serial Read:ATL0
OK

OBD Init:Turning on wakeup...
Serial Send:ATSW99
Serial Read:ATSW99
OK

OBD Connection:Done
Serial Send:03
Serial Read:03
SEARCHING...
7E8 02 43 00

Ignoring Line:SEARCHING...
Serial Send:ATDP
Serial Read:ATDP
AUTO, ISO 15765-4 (CAN 11/500)

Last Port:OBDII-SPPDev
Serial Send:ATRV
Serial Read:ATRV
11.6V

Getting VIN:...
Serial Send:09 02
Serial Read:09 02
7E8 10 14 49 02 01 57 41 55
7E8 21 4D 46 43 46 4C 38 45
7E8 22 4E 3X 3X 3X 3X 3X 3X

lines[0]:01 57 41 55
lines[1]:4D 46 43 46 4C 38 45
lines[2]:4E 3X 3X 3X 3X 3X 3X
VIN:WAUMFCFL8ENXXXXXX
Serial Send:01 00
Serial Read:01 00
7E8 06 41 00 BE 1F A8 13

Serial Send:01 20
Serial Read:01 20
7E8 06 41 20 A0 07 B0 11

Serial Send:01 40
Serial Read:01 40
7E8 06 41 40 FE D0 84 00

Serial Send:01 00
Serial Read:01 00
7E8 06 41 00 BE 1F A8 13

Serial Send:01 01
Serial Read:01 01
7E8 06 41 01 00 07 E5 00

Serial Send:01 03
Serial Read:01 03
7E8 04 41 03 02 00

Serial Send:01 04
Serial Read:01 04
7E8 03 41 04 25

Serial Send:01 05
Serial Read:01 05
7E8 03 41 05 82

Serial Send:01 06
Serial Read:01 06
7E8 03 41 06 7A

So I would recommend maybe using this app in conjunction with your setup so that you can get more insight into what is being dumped to your Arduino.

Good luck and have patience rnsft... this isn't plug and play (as I was hoping it would be) but it's obviously doable given a deeper understanding of what is happening and what the messages structure is. I just need to do more reading, and I will post more as I discover it.

Hi rnsft,
I got your message this morning... I'll try to post up some of the information you asked for asap... just in the midst of a lot of work. Check back later today or tomorrow!! :slight_smile:
All the best,
Andrew

Hello all and thanks for these informations, that's clear.

What I still don't understand is why the CAN-Bus shield is "receiving" data even when not plugged...

I know all that is R&D. I've put apart this work for now but will very soon work again on this and :

    1. I'll try to understand where how these data are generated when the CAN-Bus shield is not connected
    1. Then when I'll understand that I'll start again my arduino code and will try to find the necessary initial handshake for activating the receiving of data from the VW.

Will let you know (but I think that the boards that I have are not working properly...).

Hello
I tried again and problems again.
I will post a vidéo to be clearer.
I sent back to lextronic. They will call me on 3 weeks after checking.

Hi all

Just made some tests with VCDS and a CAN to USB interface and I have seen this error that seems to have been generated the last time I connected the Arduino Uno/CANBus-Shield unit on my Golf VI :


Adresse 19: Gateway CAN (J533) Labels: 7N0-907-530-V2.clb
No. pièce Log: 7N0 907 ### H Mat: 1K0 907 ###
Pièce: J533 Gateway H42 1620
Révision: H42 No. de série: 161011F100####
Codage: 350000
No. Atelier: WSC 01357 011 0####
VCID: 3561D73D9C3905B####-####

1 Code défaut trouvé:
00469 - Bus de données Infotainment dans système monoconducteur
011 - Coupure - Intermittent
Capture:
Etat du défaut: 00101011
Priorité du défaut: 3
Fréquence du défaut: 1
Compteur de RAZ: 51
Kilometrage: 56521 km
Heure: 0
Date: 2038.14.14
Temps: 09:50:50


I think that this may be a technical confirmation that it's not working. Anyway, this is just for the record, I'll work soon with my new Arduino/CANBus-Shield if they can repair them :slight_smile:

The important piece of info here is the "Intermittent" term that may denotes bad data in the communication (I had to slightly move the Arduino Uno/CANBus Shield the last time to have some sort of random data printed out from the CAN).

Hi

Video of my last try before getting back to reseller to give them back :