-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Board crashing after connection when attempting to add new hybrid focused PIDs #10
Comments
Seem esp32 crashed by something about wrong code operation or memory.
Please recheck if you set the correct board (ESP32 Devkit) and parttion
(minimum spiffs OTA)
I'll review your fork again.
…On Tue, Oct 22, 2024, 08:11 cr08 ***@***.***> wrote:
Hi! Hope I can get some direction and pointers. I've exhausted the
debugging options I can some up with on this. My Arduino/ESP32 knowledge is
fairly limited.
But I'm trying to modify this and add some hybrid specific PIDs from my
own Ford vehicle. The stock code works fine and the various gauges show
data where available. However once I add the new PID (just doing one for
now to test) once the connection is established and the first display page
is rendered it crashes.
Here's the manual queries I ran on my OBD adapter:
>001100BB
41 0B 63
>00110055
41 05 34
41 05 34
41 05 34
>00110044
41 04 00
41 04 00
41 04 00
>001155cc
NO DATA
>222211667744
NO DATA
>222211ee11cc
62 1E 1C 00 C3
62 1E 1C 00 F8
>222244880011
62 48 01 BA EB
>2222dddd0044
62 DD 04 FF
62 DD 04 38
>2222448800bb
62 48 0B 00 00
62 48 0B 00 00
>222244884411
62 48 41 0F CD
Ignore the duplicate characters. I misconfigured my minicom instance. But
PID 224801 is the one I tested with in the sketch. PIDs 22480B, 22DD04, and
224841 are additional ones I want to use but haven't put into the sketch
yet. I'm testing with the one for now.
Here's the serial monitor log:
<< Va&Cob OBDII Gauge >>
by Ratthanin W. BUILD -> Oct 20 2024 - 15:56:55
Error: File not found!
Show System: 0
Temp Offset: -50
Bluetooth..OK
Connecting to OBDII - 00:1d:a5:00:02:40
Connected Successfully!
ATZ
ELM327 v1.5
Display layout -> 0
010B
41 0B 63
010C
41 0C 00 00
41 0C 00 00
41 0C 00 00
Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x40092728 PS : 0x00060a30 A0 : 0x800ef26f A1 : 0x3ffd08a0
A2 : 0xae5b725a A3 : 0x3ffd098c A4 : 0x00000003 A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0xae5b725a
A10 : 0x00000030 A11 : 0x00000000 A12 : 0x00000001 A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000015 EXCCAUSE: 0x0000001d
EXCVADDR: 0xae5b725a LBEG : 0x4009273c LEND : 0x40092741 LCOUNT : 0x00000000
Backtrace: 0x40092725:0x3ffd08a0 0x400ef26c:0x3ffd08c0 0x400ef38a:0x3ffd08e0 0x400d54ca:0x3ffd0900 0x400dae52:0x3ffd09c0 0x400f24dd:0x3ffd0a40
Ran an exception decoder:
Backtrace: 0x40092725:0x3ffd08a0 0x400ef26c:0x3ffd08c0 0x400ef38a:0x3ffd08e0 0x400d54ca:0x3ffd0900 0x400dae52:0x3ffd09c0 0x400f24dd:0x3ffd0a40
Decoding stack results
0x40092725: memmove at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/newlib/newlib/libc/string/memmove.c:75
0x400ef26c: String::move(String&) at /home/cr08/.arduino15/packages/esp32/hardware/esp32/2.0.17/cores/esp32/WString.cpp:237
0x400ef38a: String::operator=(String&&) at /home/cr08/.arduino15/packages/esp32/hardware/esp32/2.0.17/cores/esp32/WString.cpp:277
0x400d54ca: getAB(String) at /home/cr08/Software/ESP32-OBD2-Gauge_cr08/sketch/VaAndCobOBD2Gauge/meter.h:396
0x400dae52: loop() at /home/cr08/Software/ESP32-OBD2-Gauge_cr08/sketch/VaAndCobOBD2Gauge/VaAndCobOBD2Gauge.ino:480
0x400f24dd: loopTask(void*) at /home/cr08/.arduino15/packages/esp32/hardware/esp32/2.0.17/cores/esp32/main.cpp:50
Since I have my own fork for this with some added lines, here should be
direct links to the lines being referenced:
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/VaAndCobOBD2Gauge.ino#L480
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/meter.h#L396
Added the PID as an extra line which should come up as PID number 7 and
that's been added in display 0:
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/VaAndCobOBD2Gauge.ino#L101C3-L101C78
And also an extra formula line for it:
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/meter.h#L473
Probably a lot of info but wanted to make sure I provide as much as I can
and what I've ran through trying to debug it myself. Any help would be
greatly appreciated in trying to figure this out. Seems I'm so close to
getting it going.
Thanks!
—
Reply to this email directly, view it on GitHub
<#10>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGGQHCTIBDWGR5FP5ESIDTDZ4WQ5LAVCNFSM6AAAAABQLK5GZKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYDGOJYGI4TSMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
oh one more thing. some ELM327 adaptor's quality is low. slow speed and sometimes return garbage data, since the code itself, there is no error checking. this could lead to errors during calculation. |
Thanks for looking into it! Yeah, I'm very aware of some adapter's quality. I've had a few over the years that have been hit or miss. This one I'm working with I have had before I discovered this project but specifically picked out because it had the recommended PIC18F25K80 chip and separate bluetooth daughterboard which seems to be better amongst the clones out there and should be the same as the linked Aliexpress product aside from being a different brand. I did do some further testing. First thing I did was run the 'SerialToSerialBTM' example code from the Arduino IDE which basically allows a simple Bluetooth to serial monitor terminal so I could manually run things from the same board for debugging. Followed all the init commands in your code and then tried to poll the PIDs. All looks good to me?
The I did also try adjusting the formula for that PID to clean it up some and more closely match some of the other formula in case that was an issue. The math still checks out:
Unfortunately still have the same issue. |
https://wokwi.com/projects/412905386300120065 I test the code, it works without problem. so can u debug step by step?
if (A and B) are interpreted correctly, it should work well when passing to formula 7 equation. |
Had a chance to dive into this a bit more today and looks like my added PID and formula are fine. In fact now it seems to possibly be crashing on some of the existing PIDs. Not sure how I managed to get a flawless running build before. I even went back and compiled and flashed your version and was getting the same crash cycles as with my mods. I wonder if any of this is due to this being a hybrid vehicle. In all of my tests the vehicle is fully running but the engine is off so stuff like the engine speed and load should be 0 but everything else in theory should be available. If this may be related, I'll have to push forward and try putting in all the hybrid PIDs I want and see how it behaves. The existing PIDs in your version would be completely wiped away and replaced which is the intent of my own fork. But that said, here's the most recent log I have from my own code with the suggested modifications per your last comment.
I then went back to the original code after that and that's where I was still getting crashes. Seemed to reoccur on the ENG SPD, PCM VOLT, ENG load, and occasionally trans temp PIDs. Each time whatever PID was queried right before the crash I'd put the MAP PID in that slot since the MAP PID seems to be the most reliable for me. This is the current pidConfig and display layouts:
And here's the log from that attempt. On display 0 it is stable. I end up in the config menu then back out again and then switching to layout 1 it crashes again seemingly on PID 0104/ENG load.
|
I notice from the response 010B 010B 010B Display layout -> 1 //---------------------------------- it's like repeatedly reading 010B but sometimes the adaptor gives CAN ERROR or this is my guess, it could be ELM327 adaptor that return data that make esp32 crash.
it proved that it works (no compiling needed), with this firmware, you can read a few simple PIDs so if you are still facing the crashing problem. It'd be the vehicle or ELM327 adaptor.
I hope this help. |
Hi! Hope I can get some direction and pointers. I've exhausted the debugging options I can some up with on this. My Arduino/ESP32 knowledge is fairly limited.
But I'm trying to modify this and add some hybrid specific PIDs from my own Ford vehicle. The stock code works fine and the various gauges show data where available. However once I add the new PID (just doing one for now to test) once the connection is established and the first display page is rendered it crashes.
Here's the manual queries I ran on my OBD adapter:
Ignore the duplicate characters. I misconfigured my minicom instance. But PID 224801 is the one I tested with in the sketch. PIDs 22480B, 22DD04, and 224841 are additional ones I want to use but haven't put into the sketch yet. I'm testing with the one for now.
Here's the serial monitor log:
Ran an exception decoder:
Since I have my own fork for this with some added lines, here should be direct links to the lines being referenced:
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/VaAndCobOBD2Gauge.ino#L480
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/meter.h#L396
Added the PID as an extra line which should come up as PID number 7 and that's been added in display 0:
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/VaAndCobOBD2Gauge.ino#L101C3-L101C78
And also an extra formula line for it:
https://github.com/cr08/ESP32-OBD2-Gauge/blob/cd845ff29f4046cf22e46fbfb5648ac8caeb7632/sketch/VaAndCobOBD2Gauge/meter.h#L473
Probably a lot of info but wanted to make sure I provide as much as I can and what I've ran through trying to debug it myself. Any help would be greatly appreciated in trying to figure this out. Seems I'm so close to getting it going.
Thanks!
The text was updated successfully, but these errors were encountered: