Comments (14)
OK. I will try to turn off bluetooth on all devices in the car tomorrow, maybe some are pairing and blocking the connection.
from elmduino.
Unfortunately, no device blocked the bluetooth connection.
However, I was able to solve the problem.
ESP32 worked properly for the first few days so I decided that ESP32 has a problem.
- I have cleaned the Flash memory
- I uploaded the bootloader again
- I have uploaded the ESP32 test
Connection problem has resolved ESP connects correctly with ELM327 all data is transferred.
Thank you for your help.
from elmduino.
What sort of OBD scanner is it? Is it a classic bluetooth device or is it a BLE version?
When you try the ESP32_test.ino example, are you able to send AT commands?
from elmduino.
Yes, it's a classic ELM327. I have two different models on both there is the same effect. If I can connect, I can send AT commands and send PID and receive responses. Everything worked fine and I tested for several days. Suddenly he stopped connecting by accident, I noticed that the connection is only after sending the pairing pin 1234 on another device. I had a second ESP32 - started working but the situation repeated after a few days. I think the problem lies in pairing ELM237 with ESP32, but I don't know how to solve it because I'm not a programmer. I decided to take care of this project and I liked it, I managed to display DPF data and temperature. It would be great if it worked again.
from elmduino.
From the video I can see it failed the second phase of connection. The ESP32 test sketch overrides this "second phase" and allows you to send queries and AT commands manually. In order to debug, I need to know if you can still get proper AT and query responses from the ELM327 using the ESP32 test sketch. That'll be a big help to determine what went wrong.
Also, when you say "I decided to take care of this project", does that mean you took it over from someone?
from elmduino.
Tomorrow I will check the possibility of sending AT commands in test mode. As for the project, I saw on YouTube a video of the engine parameters display in ESP32 + Oled and I decided to do something similar myself. After the first successes, there was a connection problem that I couldn't solve myself. So I came back to basics and I start again with ESP32_test.ino to get a stable connection with ELM327 but my knowledge is too small.
from elmduino.
Interesting, could you post a link to the video?
from elmduino.
I found a bug in the code and applied a fix in version 2.0.12. Update your library and try using the ESP32 test sketch and post what happens when you send the following ELM327 commands:
AT E0 //Echo off
AT S0 //Spaces off
AT SP0 //Mode --> Automatic
010C //Query RPM
from elmduino.
Ok. I updated the library and uploaded the ESP32 test. I connected for a moment but couldn't send AT commands. I will have more time later so I will check again.
from elmduino.
Can you post a picture of the serial monitor after you input the commands (ensure the serial monitor is in newline and carriage return mode)?
from elmduino.
I connected ESP32 but does not accept AT commands and no response.
After entering pin 1234 on another device, I get the correct automatic response "rpm"
I also used to check the code:
#include "BluetoothSerial.h"
BluetoothSerial SerialBT;
#define DEBUG_PORT Serial
#define ELM_PORT SerialBT
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
DEBUG_PORT.begin(115200);
ELM_PORT.begin("ESP32test", true);
DEBUG_PORT.println("Attempting to connect to ELM327...");
if (!ELM_PORT.connect("OBDII"))
{
DEBUG_PORT.println("Couldn't connect to OBD scanner");
while(1);
}
DEBUG_PORT.println("Connected to ELM327");
DEBUG_PORT.println("Ensure your serial monitor line ending is set to 'Carriage Return'");
DEBUG_PORT.println("Type and send commands/queries to your ELM327 through the serial monitor");
DEBUG_PORT.println();
}
void loop()
{
if(DEBUG_PORT.available())
{
char c = DEBUG_PORT.read();
DEBUG_PORT.write(c);
ELM_PORT.write(c);
}
if(ELM_PORT.available())
{
char c = ELM_PORT.read();
if(c == '>')
DEBUG_PORT.println();
DEBUG_PORT.write(c);
}
}
And no shoulder to answer AT commands
And after entering the pairing code "1234" on another device, the connection is stable and the correct responses to AT commands follow.
The connection is always stable but only until ESP32 is restarted. ELM327 will not reconnect if it is not paired with the "1234" code on the external device
It seems to me that the problem lies in the connection of ELM327 with ESP32. ELM327 necessarily wants to pair with the "1234" pin and does not receive a response from ESP32 - is it possible?
from elmduino.
Ok, I think what's happening is that once the ESP32 restarts, one of your other devices (i.e. phone or laptop) automatically connects to the ELM327. Since the ELM327 can only be connected to one bluetooth device at a time, the ESP32 can't reconnect to it. Try turning off bluetooth and/or unpairing the ELM327 on all devices other than your ESP32. Once you do this, the ESP32 should be able to regain connection to the ELM327 after restarting.
Unfortunately, there is no way to send a security authentication pin via an ESP32's built-in bluetooth serial. (BLE is a different story, but we're not using BLE here)
from elmduino.
@tomek8308 Would you please let me know the steps and files needed to flash the memory and upload bootloader on ESP32?
from elmduino.
Unfortunately, no device blocked the bluetooth connection. However, I was able to solve the problem. ESP32 worked properly for the first few days so I decided that ESP32 has a problem.
- I have cleaned the Flash memory
- I uploaded the bootloader again
- I have uploaded the ESP32 test
Connection problem has resolved ESP connects correctly with ELM327 all data is transferred.
Thank you for your help.
Could you pleaase explain what you have done to get it working?
from elmduino.
Related Issues (20)
- ELM327::isPidSupported Error
- Custom PID, how it works HOT 9
- PID 70: Boost pressure control (Service 01) HOT 1
- Problem with flashing RPM value on OLED when using latest version of ELMduino HOT 8
- ESP32 not connecting to ELM327 HOT 5
- Protocol Data Point HOT 4
- Couldn't connect to OBD scanner (stucked) HOT 18
- First time Bluetooth pairing between ESP32 and ELM327 HOT 1
- custom pid for DPF HOT 17
- BT Pairing problem between ESP-32 and ELM327 HOT 6
- How to change OBD protocol HOT 5
- Response not detected HOT 28
- Error in getting Multiple PID's HOT 9
- ESP32 s3 BLE compatibility? HOT 3
- Attempting to read non-standard PID HOT 1
- When does `queryPid` return `true`? HOT 4
- ESP32_CheckPIDs_1_20.ino HOT 1
- How to read data if I know TXD RXF RXD and MTH HOT 2
- ERROR: ELM_BUFFER_OVERFLOW on Honda Vezel 2023 HOT 4
- Problems in phase 1, can't connect with ELM327 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmduino.