-
Notifications
You must be signed in to change notification settings - Fork 125
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
Crash on calling batteryVoltage() #226
Comments
I see this similar issue that occurred with an older version of ESP IDF. What version of ESP-IDF are you building with? From what I've been able to find, arduino-esp32 for Arduino IDE is using an older version (4.4.6) than the PlatformIO espressif32 framework (ESP-IDF 5.1.2). That might have an impact on your project. |
Indeed, I am running the latest version of Arduino (2.3.2) which uses ESP-IDF 4.4. It's weird, because this bug shows up only when querying for |
If there's a way to use a newer version of ESP-IDF in Arduino IDE, that looks to be worth a try for you. (Or you could patch your local ESP-IDF with the change in (espressif/esp-idf@b43e777). I don't know exactly what is happening and it could be completely irrelevant, but the batteryVoltage() request is bit different from other PID requests. It uses the "AT RV" command and the ELM327 returns the voltage it reads at its own power supply pin. There's no communication to the vehicle ECU for that request. |
Hello The Problem is in the ELMduino.cpp in the function "float ELM327::batteryVoltage(void)". If you uncomment the "payload = start + 4;" the error is gone. Is not the best way, but works ;) |
Reverting to v3.2.0 will re-introduce a bug where if the ECU returns "ATRV" as part of the response (as some do), then the value will not be parsed correctly. So be careful if implementing that solution. I believe that the |
It may not be the root cause, that's why I said it's not the best way. |
Refactor to try to avoid crash bug in ESP-IDF #226
@Fichte79 or @suoivilbo2 are you able to test the PR I have just committed? I think it may be a fix, but I don't have hardware that exhibits the crash, so I can't test thoroughly. I can only test that the new code has not introduced a regression. Thx |
Describe the bug
When making calls to
batteryVoltage()
, the board crashes (tested on both a LilyGo T-Beam 1.1 and a Heltec Wifi LoRa V2). The console output isSo, it crashes after printing the voltage twice.
To Reproduce
On the OBD client, here is the simple Arduino code that results the above crash message:
As you can see, this is essentially the BT example file from ELMduino.
I am using ELMulator (also on a T-Beam board) with the following simple Arduino code:
(That being said, I don't think it is a problem with ELMulator, as I have ELMduino also crashing in my car with a real ELM327 BT dongle.)
Expected behavior
Continuously printing voltage on the serial.
Equipment
I am using a Lilygo T-Beam V1.1 (ESP32) with ELMulator as OBD device and either another T-Beam or a Heltec Wifi LoRa V2 (also ESP32) as the OBD client running ELMduino (<---not sure about the terminology). As you can see, both boards communicate over Bluetooth.
Code
See code snippets above.
Wiring
No wiring
The text was updated successfully, but these errors were encountered: