-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A small problem #273
Comments
Bro, my code is the same, and I’ve tested it with both the Wi-Fi and Bluetooth modules, but I’m getting the same results on the serial monitor with both. What could be the problem? Please help me. `#include <WiFi.h> const char* ssid = "WiFi_OBDII"; //IP Adress of your ELM327 Dongle uint32_t rpm = 0; void setup() // Connecting to ELM327 WiFi WiFi.mode(WIFI_AP); while (WiFi.status() != WL_CONNECTED) Serial.println(""); if (client.connect(server, 35000)) myELM327.begin(client, true, 2000); void loop() if (myELM327.nb_rx_state == ELM_SUCCESS) |
serial monitor Clearing input serial buffer |
Bro, please use proper markdown formatting for your code and debug prints, please. From what I can tell, however, is that your car/ELM327 isn't responding properly to the queries and is not a library issue. What is your car's make and model? |
Hello my friend, first of all, thank you for creating such a great project and taking the time to respond to me. I have reviewed the closed question articles, but I saw that you mentioned it doesn’t work on vehicles older than 2008. My car is a 2006 Kia Sorento, and it uses the ISO 14230-4 KWP protocol. I was able to connect via a module using my phone. Is there any other way to make this system work on my car? Please guide me on how I can get this system to work in my vehicle. This project is very important to me. |
Dude, I can't believe my eyes! After struggling for so long, my project has finally shown some light, and I successfully received this response with the WiFi module. My next goal is to get the temperature data. It's late now, so I'll test it tomorrow. I'm so happy my hands are shaking! :) `Normal length query detected
|
Dude, I've been working on this for 4 months. Even though not every day, I kept going back and forth to the car, getting negative results. This feels like a miracle to me! Thank you so much for the effort you've put into this project. I tested it, and the code is the one that reads multiple PIDs. |
#include <WiFi.h>
#include "ELMduino.h"
const char* ssid = "WiFi_OBDII"; // ELM327 Wi-Fi SSID'si
const char* password = ""; // Eğer şifre varsa buraya ekle
IPAddress server(192, 168, 0, 10); // ELM327'nin IP adresi
WiFiClient client;
ELM327 myELM327;
typedef enum { ENG_RPM, COOLANT_TEMP } obd_pid_states;
obd_pid_states obd_state = ENG_RPM;
float rpm = 0;
float coolantTemp = 0;
void setup()
{
Serial.begin(115200);
Serial.print("Wi-Fi'ye bağlanılıyor: ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid); // Şifre varsa kullan
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("\nWi-Fi bağlantısı tamamlandı.");
Serial.print("Cihaz IP Adresi: ");
Serial.println(WiFi.localIP());
// ELM327'ye bağlan
if (!client.connect(server, 35000))
{
Serial.println("ELM327 bağlantı hatası!");
while (1);
}
else
{
Serial.println("ELM327 bağlantısı başarılı.");
}
if (!myELM327.begin(client, true, 2000))
{
Serial.println("ELM327 başlatılamadı!");
while (1);
}
Serial.println("ELM327 hazır.");
}
void loop()
{
switch (obd_state)
{
case ENG_RPM:
{
rpm = myELM327.rpm();
if (myELM327.nb_rx_state == ELM_SUCCESS)
{
Serial.print("RPM: ");
Serial.println(rpm);
obd_state = COOLANT_TEMP;
}
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
{
myELM327.printError();
obd_state = COOLANT_TEMP;
}
break;
}
case COOLANT_TEMP:
{
int rawTemp = myELM327.engineCoolantTemp(); // OBD-II'den su sıcaklığını oku
if (myELM327.nb_rx_state == ELM_SUCCESS)
{
coolantTemp = rawTemp - 40; // OBD-II formülü: A - 40
Serial.print("Soğutma Suyu Sıcaklığı: ");
Serial.print(coolantTemp);
Serial.println(" °C");
obd_state = ENG_RPM;
}
else if (myELM327.nb_rx_state != ELM_GETTING_MSG)
{
myELM327.printError();
obd_state = ENG_RPM;
}
break;
}
}
}
|
I didn't test it myself, but codellama says "the code is correct and should work as expected", fwiw. |
Hello my friend, I have been trying to read data from the OBD for a long time, around 3-4 months, and I have tried many projects, but the results were negative. I have made the best progress with your project. It's currently 3 AM and I'm still working on it. I will ask my question now, but if you're still active, I will go to the car and take a screenshot of the error on the serial monitor.
The text was updated successfully, but these errors were encountered: