-
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
ELM32: right bit shifting more that 32 bits does not work #275
Comments
That's an odd looking response, perhaps the ':' are being used to separate multiple responses. It looks like the query is expecting 3 responses, is that correct? What is the output if you query service 01 with PID 1C? That should return a value indicating the specific protocol supported. |
I'll check ASAP
this is correct. I'm using it here: /~https://github.com/anegrin/GiuliaTFT/blob/wip/src/main.cpp#L607-L610
_gt_processPID signature is 1:1 to processPID (speaking about args) it is properly "resolving" I'm thinking about "fixing" this by splitting log responses payload to avout shifting by 40, 48 etc...returned "value" would still be wrong by bytes would be fine as this function is kinda working: /~https://github.com/anegrin/GiuliaTFT/blob/wip/src/main.cpp#L260 |
it's 6 EOBD (Europe), protocol is AUTOISO157654CAN29500
|
Thanks for the report - I made |
unfortunately it goes nuts
and all other pids i'm fetching are aslo getting bad values. i'll try to find a way for me to test elmduino with some mock |
Oops, yeah, I had a little bug in the code, but I think it's resolved now. Test with the updated main and let me know |
standard pids are working now. there're still issues with the long ones i had to change char param to char* or it won't compile
how do you test this? is there a testsuite you can push to github? i'd be glad to help but testing live on the car slow down my process a lot. i was hardconding some values on a main func on a separate c file but then i got stuck as unfortunately c and c++ are not "my cup of tea" I'm attaching a log file with a bunch of commands - it can maybe help |
No, unless there are unit tests specifically written into the lib code plus a CI/CD pipeline is established. Both are (at least to me) difficult to implement...
Now that you mention it, @jimwhitelaw made an OBD2 simulator as described here and I made a rudimentary simulator here. A third and more difficult (but lower tech) option is to manually put the OBD2 responses in the serial monitor I'll try and run some simulations tonight and see what I can do - thanks for the logs! |
@anegrin Check the latest main branch - I validated it myself using my uber-simple python OBD2 simulator connected to a Teensy 4.0 via a TTL-USB converter. Please note that in |
so it works! but i had to request 2 expected responses; this is what i get if i do ask for 1:
this is what i get with expected = 2:
thanx for support i'll try to be more proactive next time with a PR :) |
Nice! Fixed in 3.3.1 |
Describe the bug
When a long response is parsed, we do get uint64_t shifted by 8,16,24 etc; responseByte_0 to responseByte_0 to responseByte_4 are correctly calculated while responseByte_5 to responseByte_7 seems to be affected by 32bit overflow
To Reproduce
Using ELM32 do parse response "00B0:6240B40A4B001:003E0182DC4B00"
Expected behavior
Equipment
CrowPanel 3.5"-HMI ESP32 Display https://www.elecrow.com/esp32-display-3-5-inch-hmi-display-spi-tft-lcd-touch-screen.html
Code
Provide all applicable code in tags.
Additional Context
Full log:
i tried some exlicit casting while shifting without luck - maybe i'm missing some compiler option?
The text was updated successfully, but these errors were encountered: