# Reaading OBD canbus on Fiat?

**URL:** <https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178>\
**Category:** Networking, Protocols, and Devices\
**Created:** [April 18, 2021, 5:26am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178 "2021-04-18T05:26:55Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![turqut74](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/turqut74/32/375587_2.png) [@turqut74](https://forum.arduino.cc/u/turqut74)\
**Post date:** [April 18, 2021, 5:26am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/1 "2021-04-18T05:26:55Z")

</div>

Hello friends, can anyone connect to Fiat group vehicles with can bus shield, mcp2515 and try to read canbus messages? If there is, which library can I learn which method and path you follow?

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 18, 2021, 6:01am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/2 "2021-04-18T06:01:02Z")

</div>

Hi,  
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".  
OR  
[https://forum.arduino.cc/index.php?topic=712198.0](https://forum.arduino.cc/index.php?topic=712198.0)

Have you googled

odb canbus fiat arduino

Tom... 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![turqut74](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/turqut74/32/375587_2.png) [@turqut74](https://forum.arduino.cc/u/turqut74)\
**Post date:** [April 18, 2021, 6:07am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/3 "2021-04-18T06:07:03Z")

</div>

Of course, I searched Google for days. But I could not read can messages from obd2 socket 16 and 6 pin with any arduino library that I have tried 250kbps 500kbps I tried 250kbps 500kbps because I could not reach the result, I wanted to write here maybe there is someone who has done it before and it can help me?

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 18, 2021, 6:22am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/4 "2021-04-18T06:22:21Z")

</div>

Hi,  
Are you sure you are looking at the correct pins.

 ![vJB6W](https://europe1.discourse-cdn.com/arduino/original/4X/7/2/a/72ae24315d3b28647eb8068a2dafddbeaea753d1.jpeg)

Can-Hi and Can-Lo pins are 6 and 14 respectively.

Tom... 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 18, 2021, 6:24am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/5 "2021-04-18T06:24:04Z")

</div>

Hi,  
What code are you using?  
Can you please post your code?

Thanks.. Tom... 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![turqut74](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/turqut74/32/375587_2.png) [@turqut74](https://forum.arduino.cc/u/turqut74)\
**Post date:** [April 18, 2021, 6:24am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/6 "2021-04-18T06:24:24Z")

</div>

Sorry, I mistyped you and I used pins 14 and 6 😂

---

<div class="post-metadata">

**Author:** ![turqut74](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/turqut74/32/375587_2.png) [@turqut74](https://forum.arduino.cc/u/turqut74)\
**Post date:** [April 18, 2021, 6:28am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/7 "2021-04-18T06:28:30Z")

</div>

I tried all the read libraries. Since I use Arduino Nano, I choose cs pin 10, the last library I use is the library on the link. [Can not receive messages from Arduino UNO with MCP2515 Module](https://forum.arduino.cc/t/can-not-receive-messages-from-arduino-uno-with-mcp2515-module/653937)

---

<div class="post-metadata">

**Author:** ![turqut74](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/turqut74/32/375587_2.png) [@turqut74](https://forum.arduino.cc/u/turqut74)\
**Post date:** [April 18, 2021, 6:35am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/8 "2021-04-18T06:35:01Z")

</div>

```cpp
/* CAN OBD & UDS Simple PID Request
 *
 * Currently requests PID 0x00 at a 1 second interval and
 * displays all received CAN traffic to the terminal at 115200.
 *
 * Written By: Cory J. Fowler April 5th, 2017
 *
 * (Disclaimer: Standard IDs are currently UNTESTED against a vehicle)
 *
 */

#include 
#include 

#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

// CAN TX Variables
unsigned long prevTx = 0;
unsigned int invlTx = 1000;
byte txData[] = {0x02,0x01,0x00,0x55,0x55,0x55,0x55,0x55};

// CAN RX Variables
unsigned long rxID;
byte dlc;
byte rxBuf[8];
char msgString[128]; // Array to store serial string

// CAN Interrupt and Chip Select Pins
#define CAN0_INT 2 /* Set INT to pin 2 (This rarely changes) */
MCP_CAN CAN0(10); /* Set CS to pin 9 (Old shields use pin 10) */

void setup(){

  Serial.begin(115200);
  while(!Serial);

  // Initialize MCP2515 running at 16MHz with a baudrate of 500kb/s and the masks and filters disabled.
  if(CAN0.begin(MCP_STDEXT, CAN_125KBPS, MCP_8MHZ) == CAN_OK)
    Serial.println("MCP2515 Initialized Successfully!");
  else{
    Serial.println("Error Initializing MCP2515... Permanent failure! Check your code & connections");
    while(1);
  }

//
// // Allow all Standard IDs
// CAN0.init_Mask(0,0x00000000); // Init first mask...
// CAN0.init_Filt(0,0x00000000); // Init first filter...
// CAN0.init_Filt(1,0x00000000); // Init second filter...
// // Allow all Extended IDs
// CAN0.init_Mask(1,0x80000000); // Init second mask...
// CAN0.init_Filt(2,0x80000000); // Init third filter...
// CAN0.init_Filt(3,0x80000000); // Init fouth filter...
// CAN0.init_Filt(4,0x80000000); // Init fifth filter...
// CAN0.init_Filt(5,0x80000000); // Init sixth filter...

#if standard == 1
  // Standard ID Filters
  CAN0.init_Mask(0,0x7F00000); // Init first mask...
  CAN0.init_Filt(0,0x7DF0000); // Init first filter...
  CAN0.init_Filt(1,0x7E10000); // Init second filter...

  CAN0.init_Mask(1,0x7F00000); // Init second mask...
  CAN0.init_Filt(2,0x7DF0000); // Init third filter...
  CAN0.init_Filt(3,0x7E10000); // Init fouth filter...
  CAN0.init_Filt(4,0x7DF0000); // Init fifth filter...
  CAN0.init_Filt(5,0x7E10000); // Init sixth filter...

#else
  // Extended ID Filters
  CAN0.init_Mask(0,0x90FF0000); // Init first mask...
  CAN0.init_Filt(0,0x90DA0000); // Init first filter...
  CAN0.init_Filt(1,0x90DB0000); // Init second filter...

  CAN0.init_Mask(1,0x90FF0000); // Init second mask...
  CAN0.init_Filt(2,0x90DA0000); // Init third filter...
  CAN0.init_Filt(3,0x90DB0000); // Init fouth filter...
  CAN0.init_Filt(4,0x90DA0000); // Init fifth filter...
  CAN0.init_Filt(5,0x90DB0000); // Init sixth filter...
#endif

  CAN0.setMode(MCP_NORMAL); // Set operation mode to normal so the MCP2515 sends acks to received data.

  // Having problems? ======================================================
  // If you are not receiving any messages, uncomment the setMode line below
  // to test the wiring between the Ardunio and the protocol controller.
  // The message that this sketch sends should be instantly received.
  // ========================================================================
  //CAN0.setMode(MCP_LOOPBACK);

  pinMode(CAN0_INT, INPUT); // Configuring pin for /INT input

  Serial.println("Simple CAN OBD-II PID Request");
}

void loop(){

  if(!digitalRead(CAN0_INT)){ // If CAN0_INT pin is low, read receive buffer

    CAN0.readMsgBuf(&rxID, &dlc, rxBuf); // Get CAN data
  
    // Display received CAN data as we receive it.
    if((rxID & 0x80000000) == 0x80000000) // Determine if ID is standard (11 bits) or extended (29 bits)
      sprintf(msgString, "Extended ID: 0x%.8lX DLC: %1d Data:", (rxID & 0x1FFFFFFF), dlc);
    else
      sprintf(msgString, "Standard ID: 0x%.3lX DLC: %1d Data:", rxID, dlc);

    Serial.print(msgString);

    if((rxID & 0x40000000) == 0x40000000){ // Determine if message is a remote request frame.
      sprintf(msgString, " REMOTE REQUEST FRAME");
      Serial.print(msgString);
    } else {
      for(byte i = 0; i= invlTx){
    prevTx = millis();
    if(CAN0.sendMsgBuf(FUNCTIONAL_ID, 8, txData) == CAN_OK){
      Serial.println("Message Sent Successfully!");
    } else {
      Serial.println("Error Sending Message...");
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 18, 2021, 6:37am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/9 "2021-04-18T06:37:36Z")

</div>

Hi,

Did you also connect signal gnd?  
My experience is with canbus in an industrial context, you will probably get some more members replying as your subject "Reading ODB canbus on Fiat" is pretty concise.

The world takes 24 hours to turn, so keep an eye on this thread.

Thanks.. Tom... 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![turqut74](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/turqut74/32/375587_2.png) [@turqut74](https://forum.arduino.cc/u/turqut74)\
**Post date:** [April 18, 2021, 6:44am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/10 "2021-04-18T06:44:15Z")

</div>

Is it to connect the gnd line on pins 4 and 5 to the Arduino gnd input in the obd socket you mentioned?

---

<div class="post-metadata">

**Author:** ![TomGeorge](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/tomgeorge/32/215261_2.png) [@TomGeorge](https://forum.arduino.cc/u/TomGeorge)\
**Post date:** [April 18, 2021, 6:51am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/11 "2021-04-18T06:51:47Z")

</div>

Hi,  
Yes, the hi and lo canbus signals are with respect to gnd, so mcp gnd and ODB gnd will have to be connected together.

Tom.... 😀 👍 ☕ 🇦🇺

---

<div class="post-metadata">

**Author:** ![turqut74](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/turqut74/32/375587_2.png) [@turqut74](https://forum.arduino.cc/u/turqut74)\
**Post date:** [April 18, 2021, 10:46am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/12 "2021-04-18T10:46:53Z")

</div>

![IMG-20210418-WA0010](https://europe1.discourse-cdn.com/arduino/original/4X/2/6/a/26ad752c0eb9ee9edbde541bf5f6d5fdb7fc2f16.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 16, 2021, 10:48am UTC](https://forum.arduino.cc/t/reaading-obd-canbus-on-fiat/850178/14 "2021-08-16T10:48:27Z")

</div>

Closed on August 16, 2021, 10:48am UTC

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
