I am using an ELM327 adapter to talk to the OBD2 port on my car over ISO 15765-4 11b/500k. I want to query for non-standard messages outside of standard OBD2 PIDs, (which I have separately logged from a diagnostic tool). I am trying to reproduce manually via a serial terminal (and then later programmatically) the successful request/response message flow that I see from that diagnostic tool.
I have it working for everything except multiline responses which require the CAN flow control message. The flow control message is not working, preventing the receive of the additional payload lines.
A good example would be Air Intake Temperature. Here is a successful trace from the diagnostic tool:
5F0 02 21 01 -> initial request to 5F0 of length 02 with payload 21 01
6F0 10 1A 61 01 60 6B 5F 60 -> response from 6F0 explaining that there are 1A bytes to come
5F0 30 00 01 -> flow control message back to 5F0 saying send the lines
6F0 21 EF 81 05 69 67 05 F7 -> three additional lines of content.
6F0 22 65 1A 28 41 05 E8 65
6F0 23 05 FF 65 3B 00 00 AA
So to reproduce this myself manually without the diagnostic tool I:
ATZ -> Reset
ATSP6 -> Select Protocol: ISO 15765-4 11b/500k
ATSH5F0 -> Set Headers 5F0 (target can ID address)
ATCRA6F0 -> Set CAN Receive Address: 6F0
Note: I have 2 serial terminals set up against 2 adapters joined into a Y-split into the ODB port, so I can run another ELM327 in AT MA mode to show whats actually going to the vehicle. One is read-only using AT MA, the other is where I issue the commands. This is how I got the trace from the diagnostics tool, so I dont think this is causing the problem.
I can then go about sending a 21 01 which shows up as (and then stops!):
5F0 02 21 01 -> great
6F0 10 1A 61 01 60 6B 5F 60 -> great, first line back from 6F0 is perfect
6F0 30 00 00 -> problem: seeing this instead of 5F0 30 00 01
Why is my ELM automatically sending a different flow control message to what my diagnostics tool sends?
Ok, then lets try turning off Automatic Formatting and Automatic Flow Control, perhaps we can take care of this ourselves manually.
ATCAF0 -> Set CAN Automatic Formatting off (messages need to start with byte count now)
ATCFC0 -> Set CAN Flow Control off (need to manually send the flow control message when required)
After that, I can send an 02 21 01 (i need to send number of bytes manually now) and get:
5F0 02 21 01 -> ok, as before
6F0 10 1A 61 01 60 D1 31 60 -> ok, as before
now i manually send flow control with 30 00 01:
5F0 30 00 01 - ok, looks good (same as tool) but doesnt yield any more lines
What am I doing wrong, and how can I solve this?