0

i explain a bit...

I repair Electric powered steering systems for cars, especially Fiat/Alfa/Lancya (Delphi manufacturers) and i'm in need of making some tool to test these reparations, i mean just turning it on for example.

I have researched during some time, and i figured i need Can-bus signals to be simulated as the eps ECU is receiving ignition packets from CAN, here i go..

I need to know what way i could Read/Send CAN packets from/to BUS, i mean what tool or anything else. I have been trying with Arduino UNO + Sparkfun Shield, but i dont get any results, when everything connected, my serial console isnt sniffing any packets, i have connected all correctly i think, tried different bitRates, changed Arduino boards and shield, tried many different examples, i invested lots of hours with no profit... i was using Seat Ibiza 2010 for I+D, connected CAN-H AND CAN-L on OBD PORT, in the CAN lines from radio,etc...

Any idea of what could be wrong is welcome, as new method to make my project.. Thanks in advance!!

Info:

https://dl.dropboxusercontent.com/u/47864432/arduino/IMG_9358.JPG https://dl.dropboxusercontent.com/u/47864432/canbus/LIBRARYS_USED.rar

user2864740
  • 60,010
  • 15
  • 145
  • 220

3 Answers3

0

There are two potential issues here:

  1. H/W problem
  2. CAN bus library problem

The first step is try loopback test. If all is OK, try CAN bus from any car OBD port, the speed should be 500Kb.

vershov
  • 928
  • 4
  • 6
0

This one tries a couple of bus speeds -- works with sparkfun canbus shield:

#include <SPI.h>
#include <SD.h>
#include <Canbus.h>
#include <defaults.h>
#include <global.h>
#include <mcp2515.h>
#include <mcp2515_defs.h>

const int chipSelect = 9;
File dataFile;

void setup() {
  // put your setup code here, to run once:
  pinMode(chipSelect, OUTPUT);
  Serial.begin(115200); // For debug use
  Serial.println("CAN Read - Testing receival of CAN Bus message");
  delay(1000);
  if (Canbus.init(CANSPEED_500)) //Initialise MCP2515 CAN controller at the specified speed
    Serial.println("CAN Init ok:  500k");
  else if (Canbus.init(CANSPEED_250)) //Initialise MCP2515 CAN controller at the specified speed
    Serial.println("CAN Init ok:  250k");
  else if (Canbus.init(CANSPEED_125)) //Initialise MCP2515 CAN controller at the specified speed
    Serial.println("CAN Init ok:  125k");
  else
    Serial.println("Can't init CAN");
  delay(1000);
  if (!SD.begin(chipSelect)) {
    Serial.println("uSD card failed to initialize, or is not present");
    return;
  }
  else {
    Serial.println("uSD card initialized.");
    delay(1500);
  }
  dataFile = SD.open("caninfo.txt", FILE_WRITE);
}

void loop() {
  tCAN message;
  if (mcp2515_check_message())
  {
    if (mcp2515_get_message(&message))
    {
      if (dataFile)   {
        int timeStamp = millis();
        //write to uSD card
        dataFile.print(timeStamp);
        dataFile.print("ID: ");
        dataFile.print(message.id, HEX);
        dataFile.print(", ");
        dataFile.print("Data: ");
        dataFile.print(message.header.length, DEC);
        for (int i = 0; i < message.header.length; i++)
        {
          dataFile.print(message.data[i], HEX);
          dataFile.print(" ");
        }
        dataFile.println("");
        Serial.println("Writing to SD");
      }
      else
      {
        Serial.println("Problem writing to SD");
      }
    }
  }
}
veggiebenz
  • 389
  • 5
  • 12
0

If you want to communicate via CAN with Steering controller for example for an OEM like Delhpi .. this is not possible as the ECU (ELectronic control units) in the communication network are secured and the CAN protocol software decides who can participate and who can't.

As a tester tool you can read the trouble codes but you can't hack it to simulate the Ignition signal etc...

brasofilo
  • 25,496
  • 15
  • 91
  • 179