ELMduino
ELMduino copied to clipboard
What function do i use to check existing dtcs codes?
For an overview of DTCS codes, check this out
While I haven't tested it myself, according to this, the monitorStatus() should allow you to begin checking each trouble code. Then, you send (in ASCII) 03 to get the information on each code. Since this message has no PID, you'll have to send it manually and parse the response manually. I literally just googled all this 5min ago, but once I get some time (could be months), I'll seriously consider adding this functionality into the lib so users won't have to manually do it all...
Having a way to check codes and subsequently clear them would be wonderful.
Thanks for the library!
Hello. The description of the library say's "Also, you can use ELMduino to view and clear your car's trouble codes". I assume it is implemented now and I am just to dumb to find it :) Did anybody has a working example of reading the stored dtc? :)
I have the same question has @TerAtoM. Is already implemented in the library or we still have to manually do it? I check the library src and found the freezeDTC() method to use. my question is if that is the one i can use to get them? Thank you so much @PowerBroker2 for the effort put in develop the library.
For now, try the process in my first comment
I'm almost done adding a method to query and return the current DTC codes. I've implemented both blocking and non-blocking variants and I'm not sure which approach is preferred. NB is more in keeping with the overall design intent of the library, but fetching codes doesn't seem like something one would do in conjunction with other activities. More likely, we just want to get the list and then display it. Also I'm not sure about potential side-effects of performing other actions while the codes are being processed. So, blocking during this request seems reasonable and I think I'm leaning towards that.
@PowerBroker2 do you have any advice on this point?
I've implemented both blocking and non-blocking variants and I'm not sure which approach is preferred
I'm ok with having both options available - especially if already implemented. As long as the user uses an FSM like in the multi-PID example sketch, there shouldn't be an issue with the non-blocking version, although most will probably want to use the blocking version.
Updating this discussion to note that a new method currentDTCCodes() has been added that accomplishes this. It's not yet in a tagged release and some additional testing seems prudent, but I have had it working with 2 adapters and 2 vehicles. If anyone else can try this out, it would be appreciated.
@TerAtoM, I have added two example programs to demonstrate checking for MIL (Check Engine Light) status / code count and fetching any current DTCs.
This has been implemented on main and will be included in the next tagged version
For an overview of DTCS codes, check this out
While I haven't tested it myself, according to this, the
monitorStatus()should allow you to begin checking each trouble code. Then, you send (in ASCII)03to get the information on each code. Since this message has no PID, you'll have to send it manually and parse the response manually. I literally just googled all this 5min ago, but once I get some time (could be months), I'll seriously consider adding this functionality into the lib so users won't have to manually do it all...
Is it possible to visualize the DTCs instead of just seeing if the DTCs is present or not? I want to see the DTCs... the actual trouble code which we see using a scan tool. Is it possible?
Is it possible to visualize the DTCs instead of just seeing if the DTCs is present or not? I want to see the DTCs... the actual trouble code which we see using a scan tool. Is it possible?
Is it possible to visualize the DTCs instead of just seeing if the DTCs is present or not? I want to see the DTCs... the actual trouble code which we see using a scan tool. Is it possible?
Can you help me out on interfacing the ELM327 with Arduino UNO? Can anyone provide me the pin diagrams for it?
Unless you intend to open up your ELM327 and solder connections to it, you’re likely better off using a Bluetooth connection. You will need to add a device like the HC05/HC06 Bluetooth module your arduino board. There’s lots of tutorials about how to do that. Personally, I think it’s a lot easier to use an esp32 board (~$10) that has BT built in.
@PowerBroker2 Hey I connected Arduino Uno with HC05 Bluetooth module with pins (HC05 - RX, TX, VCC, GND to Uno - 10, 11, 5v, GND) and I've successfully connected ELM327 bluetooth obd2 tool to arduino. I have this code to read engine rpm but it is not getting connected to the obd2 scanner. please help me out with this. I'm doing this on a Skoda Octavia mk2 (Laura) Code: #include "ELMduino.h" #include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
ELM327 myELM327;
uint32_t rpm = 0;
void setup() { #if LED_BUILTIN pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); #endif
Serial.begin(115200); mySerial.begin(115200);
Serial.println("Attempting to connect to ELM327...");
if (!myELM327.begin(mySerial, true, 2000)) { Serial.println("Couldn't connect to OBD scanner"); while (1); }
Serial.println("Connected to ELM327"); }
void loop() { float tempRPM = myELM327.rpm();
if (myELM327.nb_rx_state == ELM_SUCCESS) { rpm = (uint32_t)tempRPM; Serial.print("RPM: "); Serial.println(rpm); } else if (myELM327.nb_rx_state != ELM_GETTING_MSG) myELM327.printError(); } O/P: Couldn't connect to OBD scanner