Comments (5)
Make sure that you have ELM327::begin
in the void setup()
.
In your code that should be something like:
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
DEBUG_PORT.begin(115200);
ELM_PORT.begin("ESP32test", true);
delay(10000);
DEBUG_PORT.println("Attempting to connect to ELM327...");
if (!ELM_PORT.connect("MIS-PENRIGHT-PC"))
{
DEBUG_PORT.println("Couldn't connect to OBD scanner");
while (1);
}
if (!myELM327.begin(Serial1, true, 2000))
{
Serial.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();
}
from elmduino.
I deleted my previous post, it was way off although it did point me in the right direction. It caused me to go back to the example "https://github.com/PowerBroker2/ELMduino/blob/master/examples/ESP32_Bluetooth_Serial/ESP32_Bluetooth_Serial.ino"
I am guessing where I got confused was between learning to connect to the Bluetooth and ELMduino library. Caught my mistake, @animevietsub was right, in cutting and pasting I missed the myELM327.begin.
Most of my class experience was with .NET. After searching and learning more about C++ class constructor/destructor and typing the deleted response. I saw the errors of my way. I figured it had to be a dumb mistake which is why it was a question and not a bug. :-) Sorry for the confusion. Phase 2 errored when setting the SP (AT SP0). That could be an issue with my emulator, I will need to do some digging. I am going to close this issue. Thanks all.
from elmduino.
I'm not sure what's causing this issue. Perhaps try changing the third argument in sendCommand()
's memset()
call?
from elmduino.
Give me some time, I have always just pointed to a lib, using PlatformIO, and never have tried to modify one. I want to learn, let me do some searching on what to do and I will get back. I tried to patch it to turn on debug, but that did not work.
Once I get it figured out, What should I change it to?
Screenshot
Is there a way from the main setup to enable debugging? I tried myELM327.debugMode = True.
I also tried to hardcode it in the formatQueryArray, which is why I don't think I have to modify libs down. :-)
I was expecting this to dump to the serial monitor.
EDIT:
I just changed some in the code to test, on propose created a syntax error. I did get a compile error. So I may be in the wrong area.
Nope, right area, after fixing the syntax error, and recompile, I did get the serial output I was expecting.
from elmduino.
Should PAYLOAD_LEN be 0 at this point?
This is the only place I found where PAYLOAD was set
bool ELM327::begin(Stream &stream, const bool &debug, const uint16_t &timeout, const char &protocol, const uint16_t &payloadLen, const byte &dataTimeout)
{
elm_port = &stream;
PAYLOAD_LEN = payloadLen;
debugMode = debug;
timeout_ms = timeout;
Serial.println("begin - payloadLen: " + payloadLen);
payload = (char *)malloc(PAYLOAD_LEN + 1); // allow for terminating '\0'
// test if serial port is connected
if (!elm_port)
return false;
// try to connect
if (!initializeELM(protocol, dataTimeout))
return false;
return true;
}
As you can see, I added a Serial.println() in that function and I did not see it executed.
Is that a difference between Bluetooth and Serial?
The bottom line, I don't think the memory is being allocated.
I added a Serial.println above the memset to see and I was getting the error on strlen().
from elmduino.
Related Issues (20)
- Problem querying data with ESP32 HOT 5
- custom pid no response HOT 1
- Sending false Command? HOT 5
- Custom PID for KM since last DPF regeneration HOT 2
- Crash on calling batteryVoltage() HOT 7
- 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 6
- ESP32 s3 BLE compatibility? HOT 3
- Attempting to read non-standard PID HOT 1
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.