Giter Site home page Giter Site logo

How to change OBD protocol about elmduino HOT 5 CLOSED

reflexsa avatar reflexsa commented on August 24, 2024
How to change OBD protocol

from elmduino.

Comments (5)

PowerBroker2 avatar PowerBroker2 commented on August 24, 2024 1

You would have to add the argument in the sketch kind of like this:

myELM327.begin(ELM_PORT, true, 2000, ISO_15765_11_BIT_500_KBAUD);

from elmduino.

PowerBroker2 avatar PowerBroker2 commented on August 24, 2024

The elm should automatically find and use the best protocol, but if you want to specify it yourself, you can do so in the begin() function:

/*
bool ELM327::begin(Stream &stream, const bool& debug, const uint16_t& timeout, const char& protocol, const uint16_t& payloadLen, const byte& dataTimeout)
Description:
------------
* Constructor for the ELM327 Class; initializes ELM327
Inputs:
-------
* Stream &stream - Reference to Serial port connected to ELM327
* bool debug - Specify whether or not to print debug statements to "Serial"
* uint16_t timeout - Time in ms to wait for a query response
* char protocol - Protocol ID to specify the ELM327 to communicate with the ECU over
* uint16_t payloadLen - Maximum number of bytes expected to be returned by the ELM327 after a query
* byte dataTimeout - Number of ms to wait after receiving data before the ELM327 will
return the data - see https://www.elmelectronics.com/help/obd/tips/#UnderstandingOBD
Return:
-------
* bool - Whether or not the ELM327 was properly initialized
*/
bool ELM327::begin(Stream &stream, const bool &debug, const uint16_t &timeout, const char &protocol, const uint16_t &payloadLen, const byte &dataTimeout)

from elmduino.

reflexsa avatar reflexsa commented on August 24, 2024

Thank you. For some reason when using my adapter with Torque for example I will get an 'engine check light' unless I specify the protocol. The actual error is communication to the gearbox so it seems that is somehow interfered with.
So would I just change the "const char &protocol" to 6 in the below?
bool ELM327::begin(Stream &stream, const bool &debug, const uint16_t &timeout, const char &protocol, const uint16_t &payloadLen, const byte &dataTimeout)

to:
bool ELM327::begin(Stream &stream, const bool &debug, const uint16_t &timeout, 6, const uint16_t &payloadLen, const byte &dataTimeout)

from elmduino.

reflexsa avatar reflexsa commented on August 24, 2024

Thank you. I see, that does make sense. I'm hoping this will resolve my other issue where I just have a recurring response after the initial AT commands #241

from elmduino.

jimwhitelaw avatar jimwhitelaw commented on August 24, 2024

Fixed in version 3.3.0.

from elmduino.

Related Issues (20)

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.