GithubHelp home page GithubHelp logo

arduino-obd2's Introduction

๐Ÿ‘‹๐Ÿฝ Hi there, I'm Sandeep ๐Ÿ‘จ๐Ÿฝโ€๐Ÿ’ป

๐Ÿ‘จ๐Ÿฝโ€๐Ÿ”ฌ Personal Projects

Current

  • Arduino Libraries: ๐Ÿ“ก LoRa | โš™๏ธ nRF5 | ๐Ÿฅซ CAN | ๐Ÿš˜ OBD2 |

Past

๐Ÿ‘จ๐Ÿฝโ€๐Ÿ”ง Past work for @arduino

arduino-obd2's People

Contributors

jasonjoyner01 avatar njh avatar per1234 avatar sandeepmistry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduino-obd2's Issues

CANReceiver example works but OBD RMP and other codes are not working

Hi
My car is Suzuki produced in 2011.
The development board uses esp32-wroom-32, and the can transceiver uses vp230.
Some data can be obtained using the CANReceiver program, but all the other sample code does not work. Later, I started to try the OBD2 library, and all the sample programs stopped at OBD2.Begin(), specifically: the serial port output failed several times, and then stopped. If the vehicle is not connected, it always outputs failed. I tried all kinds of possibilities in a few days, but still only the canreceiver program can get some data๏ผš
QQๅ›พ็‰‡20220901223409

Clear DTC function is currently broken

Right now the implementation of the clear DTC (#7) is broken and we are trying to work out how to get it to work. I am starting this issue thread so we can do a bit of a knowledge dump while we work out how to get it working.

Here are a few links to information that may be helpful.

http://www.totalcardiagnostics.com/support/Knowledgebase/Article/View/104/0/obd2-pids-for-programmers-technical
https://electronics.stackexchange.com/questions/561221/0x7e8-to-0x7fh-on-the-can-bus
https://en.wikipedia.org/wiki/OBD-II_PIDs
https://en.wikipedia.org/wiki/On-board_diagnostics

Here is the current implementation

ID: 0x7DF
Length: 8
Data: 0x00, 0x04x 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

Based of the information in the Wikipedia article, this should work but in practice it does not seem to work.

Fiat Ducato ( + Peugeot Boxer + Renault Sprinter)

HI - I tried to the connetion with the CAN BUS of my Ducato - but no luck.
I use the ESP32 with SN65HVD230 (+120R Termination). I use the ODB connector right the steering and also the builders-port (Pin 9+10) right behind the co driver seat. In SW I select differend BAUD rates in OBD2.cpp (500k, 250k, 125k, 50k) All without success.

Any hints or ideas ?

ESP32 stucks on OBD2.begin()

I'm trying to use this library with an MCP2515 and an ESP32.
Code compiles properly but when calling to OBD2.begin(); the process stucks and I don't get any response.

Does anyone knows how to solve this?

Thanks!

Incorrect header specified in libraries.properties

The libraries.properties file looks fine here on github, however if you add this OBD2 library to an Arduino sketch using Tools -> Manage Libraries in the IDE, the library gets added fine however the include file is specified as ODB2.h ( not OBD2.h ).

The result is that the sketch will not compile as the incorrect header file is specified.

Just a heads up incase anyone else runs into this same exact issue.

How to read the dtc codes

Hello,
How to read the dtc codes?

int OBD2Class::ReadDtcs(uint8_t mode, void* data, int length)
{
// make sure at least 60 ms have passed since the last response
unsigned long lastResponseDelta = millis() - _lastPidResponseMillis;
if (lastResponseDelta < 60) {
delay(60 - lastResponseDelta);
}
for (int retries = 10; retries > 0; retries--) {
if (_useExtendedAddressing) {
CAN.beginExtendedPacket(0x18db33f1, 8);
} else {
CAN.beginPacket(0x7df, 8);
}
CAN.write(0x02); // number of additional bytes
CAN.write(mode);
//CAN.write(pid);
if (CAN.endPacket()) {
// send success
break;
} else if (retries <= 1) {
return 0;
}
}
bool splitResponse = (length > 5);
for (unsigned long start = millis(); (millis() - start) < _responseTimeout;) {
if (CAN.parsePacket() != 0 &&
(splitResponse ? (CAN.read() == 0x10 && CAN.read()) : CAN.read()) &&
(CAN.read() == (mode | 0x40))) {

  _lastPidResponseMillis = millis();

  // got a response
  if (!splitResponse) {
    return CAN.readBytes((uint8_t*)data, length);
  }
  int read = CAN.readBytes((uint8_t*)data, 3);
  for (int i = 0; read < length; i++) {
    delay(60);

    // send the request for the next chunk
    if (_useExtendedAddressing) {
      CAN.beginExtendedPacket(0x18db33f1, 8);
    } else {
      CAN.beginPacket(0x7df, 8);
    }
    CAN.write(0x30);
    CAN.endPacket();
    // wait for response
    while (CAN.parsePacket() == 0 ||
           CAN.read() != (0x21 + i)); // correct sequence number
    while (CAN.available()) {
      ((uint8_t*)data)[read++] = CAN.read();
    }
  }
  _lastPidResponseMillis = millis();
  return read;
}

}

return 0;
}

I have added a function like this. While running this function, there is no output. could you please suggest any changes.

Thanks

Fiat Linea

Hi, my car is fiat linea, I'm using Arduino nano towards connections. but unfortunately, the connection failed.
image

Calling custom PIDs

I want to call custom PIDs from mode 0x22.
I need a combination of both standard (0x01) PIDs and custom (0x22) PID's.
The headers are different and the PID values are 16 bit due to their larger value.

I've copied the src code and modified it with new functions (copying the ReadPid functions and renaming and editing conditions) but the new function always returns naN.

Do you have any other methods to suggest?

Read stored DTC and clear MIL

Hi,

first of all thank you for this library!

Don't know if creating an issue is the right way, but I wasn't able to figure out how to use the OBD2 library to read all the stored DTC codes and then try to clear them which result turning off the MIL light

Are you able to help?

Constant Char "PA[]" collides with other libraries

I changed this a several other instances of the use of PA[] to ZPA[] which avoids collision with AVR128 Board Manager libraries. Please use larger variable names in the future to avoid collision with board managers.

Line 214: const char PA[] PROGMEM = "Pa";
Line 281: PA,
Line 314: PA,

Not sure that's all of them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.