Sniffing the CAN-BUS with the SuperSniffer Software v1.xx

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby MartinViljoen » Wed Oct 22, 2014 12:57 pm

Ok awsome please do
Image
User avatar
MartinViljoen
 
Posts: 111
Joined: Mon Oct 06, 2014 5:23 pm
Location: Centurion South Africa

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby capu81 » Wed Oct 22, 2014 9:08 pm

http://youtu.be/A1T0zMl7n0I
http://youtu.be/JqLvXjiWLu0

(load video can take 2 hours)

I make 2 new DB9 cable: one for connect to radio connector, one for connect to OBD port but they won't work at all.... If i use DB9 connector i must use USB cable for power on arduino and shield, power isn't take from +12v of the db9 connector

I've tried with another Arduino Uno with no result

If i've a new Arduino with no program (or if i reset my arduino), if i connect can+ and can- the rx/tx led must blink? Is possible there is a code problem?
capu81
 
Posts: 13
Joined: Sat Oct 18, 2014 4:57 pm

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby gapco » Thu Oct 23, 2014 12:29 am

There is possibly a mechanical problem. Wiring of interfaces to CAN BUS system
Run only the USB cable to the PC. Do not use the DB9 power supply
Connect the CAN H and CAN L to the correct wires behind the radio

Please note that VW has a central gateway that is between the ODB port and the rest of the car. Connect only the CAN H and CAN L wires to the radio. No connection to the ODB port

Turn the radio in and check for communication

Regards
Gennaro
Give me an espresso and nobody gets hurt...
User avatar
gapco
 
Posts: 5
Joined: Sat Oct 18, 2014 8:06 pm
Location: Johannesburg, South Africa

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby capu81 » Thu Oct 23, 2014 8:37 am

In my car i've a obd2 elm327 bluetooth reader, i'll try to detach and try to connect shield only with two wires on the green connector.

I've received a mail from seedstudio, he write for the possibility that my car canbus data is too much and this make the can bus shield crash (but is a supposition)

I will try to set a mask in my code, can you help me for this?

For example: my volume+ data is
0x000005c1 06 00 00 60

and my code is:

Code: Select all
#include <SPI.h>
#include "mcp_can.h"

INT32U canId = 0x000;

unsigned char len = 0;
unsigned char buf[8];
char str[20];


void setup()
{
    Serial.begin(38400);

START_INIT:

    if(CAN_OK == CAN.begin(CAN_100KBPS))
    {
        Serial.println("CAN BUS Shield init ok!");
    }
    else
    {
        Serial.println("CAN BUS Shield init fail");
        Serial.println("Init CAN BUS Shield again");
        delay(100);
        goto START_INIT;
    }
}


void loop()
{
    if(CAN_MSGAVAIL == CAN.checkReceive()) 
    {
        CAN.readMsgBuf(&len, buf);
        canId = CAN.getCanId();
        Serial.print("<");Serial.print(canId);Serial.print(",");
        for(int i = 0; i<len; i++)
        {
            Serial.print(buf[i]);Serial.print(",");
        }
        Serial.print(">");
        Serial.println();
    }
}
capu81
 
Posts: 13
Joined: Sat Oct 18, 2014 4:57 pm

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby MartinViljoen » Thu Oct 23, 2014 11:36 am

gapco wrote:There is possibly a mechanical problem. Wiring of interfaces to CAN BUS system
Run only the USB cable to the PC. Do not use the DB9 power supply
Connect the CAN H and CAN L to the correct wires behind the radio

Please note that VW has a central gateway that is between the ODB port and the rest of the car. Connect only the CAN H and CAN L wires to the radio. No connection to the ODB port

Turn the radio in and check for communication

Regards
Gennaro


Yes its the same with my Jeep, when hooking up to the OBD2 port you get nothing . It only gives data on request, so you have to send something to get something back.





capu81 wrote:In my car i've a obd2 elm327 bluetooth reader, i'll try to detach and try to connect shield only with two wires on the green connector.

I've received a mail from seedstudio, he write for the possibility that my car canbus data is too much and this make the can bus shield crash (but is a supposition)

I will try to set a mask in my code, can you help me for this?

For example: my volume+ data is
0x000005c1 06 00 00 60


I dont think the shield is too slow, it can handle 1Mb/s which is the max for CAN-BUS specification.
Besides you mentioned that its running at 100Kb/s which is actually quite slow, Since it can handle a 1000kb's your interiour is only sending at 100, If anything the serial power on the arduino should crash.

Not sure what you mean by the ELM327 ?
What you can do to test your can bus shield without connecting it to the Car its to.
Connect the CAN-BUS Shield+Arduino to one port on your computer and the ELM327 to your PC via bluetooth.

Download putty.exe and make sure you are able to connect to the ELM327 via its Bluetooth serial comport.
Then do the same with the CAN-BUS shield start another putty session and make sure you are able to connect to the Arduino's Serial port.

Then from the 2 pins on the green connector connect CAN-H to pin 6 on the ELM327 and CAN-L to Pin 14 on the ELM327 and connect 5V+ on pin 16 of the ELM327 and GND from the Arduino to Pin 4 or 5 on the ELM327.

Send 01 0C from the putty session connected to the ELM327 and watch the other putty session for data comming into the Shield, this is how i test mine or to eavesdrop on traffic happening inbetween an ELM327 and the OBD2 port, by simply connecting the CAN-BUS shield in paralell
Image
User avatar
MartinViljoen
 
Posts: 111
Joined: Mon Oct 06, 2014 5:23 pm
Location: Centurion South Africa

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby MartinViljoen » Thu Oct 23, 2014 7:10 pm

capu81 wrote:In my car i've a obd2 elm327 bluetooth reader, i'll try to detach and try to connect shield only with two wires on the green connector.

I've received a mail from seedstudio, he write for the possibility that my car canbus data is too much and this make the can bus shield crash (but is a supposition)

I will try to set a mask in my code, can you help me for this?

For example: my volume+ data is
0x000005c1 06 00 00 60

and my code is:

Code: Select all
#include <SPI.h>
#include "mcp_can.h"

INT32U canId = 0x000;

unsigned char len = 0;
unsigned char buf[8];
char str[20];


void setup()
{
    Serial.begin(38400);

START_INIT:

    if(CAN_OK == CAN.begin(CAN_100KBPS))
    {
        Serial.println("CAN BUS Shield init ok!");
    }
    else
    {
        Serial.println("CAN BUS Shield init fail");
        Serial.println("Init CAN BUS Shield again");
        delay(100);
        goto START_INIT;
    }
}


void loop()
{
    if(CAN_MSGAVAIL == CAN.checkReceive()) 
    {
        CAN.readMsgBuf(&len, buf);
        canId = CAN.getCanId();
        Serial.print("<");Serial.print(canId);Serial.print(",");
        for(int i = 0; i<len; i++)
        {
            Serial.print(buf[i]);Serial.print(",");
        }
        Serial.print(">");
        Serial.println();
    }
}


capu,

Below is some code i was using to detect if my Jeep's Head lights were switched on.

Where if (canId==680) change to 5C1
So it will only then print data received from CAN-ID 5C1

Code: Select all
#include <SPI.h>
#include "mcp_can.h"

INT32U canId = 0x000;

unsigned char len = 0;
unsigned char buf[8];
char str[20];
String CanMessage="";
int HeadLightsDetected=0;


void setup()
{
    Serial.begin(115200);

START_INIT:

    if(CAN_OK == CAN.begin(CAN_125KBPS))
    {
        Serial.println("CAN BUS Shield init ok!");
    }
    else
    {
        Serial.println("CAN BUS Shield init fail");
        Serial.println("Init CAN BUS Shield again");
        delay(100);
        goto START_INIT;
    }
}


void loop()
{
    if(CAN_MSGAVAIL == CAN.checkReceive()) 
    {
        CAN.readMsgBuf(&len, buf);
        CanMessage="";
        canId = CAN.getCanId();
       
        //Detect Main Beam HeadLisghts
        if (canId==680)
        {
          //Build Complete Message Without CAN ID From BUS
          for(int i = 0; i<len; i++)    // print the data
          {
            CanMessage = CanMessage + buf[i];
          }
          //Check Main Beams / Brights
          if (CanMessage=="3200000"){HeadLightsDetected=1;}else{HeadLightsDetected=0;}
         
          if (HeadLightsDetected==1)
          {
            //PUT CODE HERE To TURN ON Transistor/Relays
            Serial.println("Brights turned on!!!!!");
          }
        }
       

       
       

       
    }
}
Image
User avatar
MartinViljoen
 
Posts: 111
Joined: Mon Oct 06, 2014 5:23 pm
Location: Centurion South Africa

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby capu81 » Fri Oct 24, 2014 12:36 pm

Thankyou for code, i'll try this and the elm test in this weekend
capu81
 
Posts: 13
Joined: Sat Oct 18, 2014 4:57 pm

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby capu81 » Thu Oct 30, 2014 11:29 am

I've tried EML and code test without success.... I'll buy a new shield (now from Sparkfun) and make new test :?
capu81
 
Posts: 13
Joined: Sat Oct 18, 2014 4:57 pm

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby MartinViljoen » Thu Oct 30, 2014 8:21 pm

capu81 wrote:I've tried EML and code test without success.... I'll buy a new shield (now from Sparkfun) and make new test :?


damn! Which one are you planning to buy? Have you got a link?
Image
User avatar
MartinViljoen
 
Posts: 111
Joined: Mon Oct 06, 2014 5:23 pm
Location: Centurion South Africa

Re: Sniffing the CAN-BUS with the SuperSniffer Software

Postby capu81 » Mon Nov 03, 2014 9:12 am

capu81
 
Posts: 13
Joined: Sat Oct 18, 2014 4:57 pm

PreviousNext

Return to OBD2 & CAN-BUS Projects

Who is online

Users browsing this forum: No registered users and 1 guest