Any ideas how to read out the VIN number?
I can see that there is a declaration of a variable called vin in odb.h
line 123: // current VIN
line 124: byte vin[17];
but I can´t find any function that reads the actual VIN from the OBD interface...
Do I need to implement that function or am I missing something here?
Read VIN?
Re: Read VIN?
Found the answer
write 0902 to ask for the VIN.
With a VIN of WP0ZZZ99ZTS392124 in the OBD-simulator a got this respond back:
014 0: 49 02 01 57 50 30
01: 5A 5A 5A 39 39 5A 54
02: 53 33 39 32 31 32 34
According to the ELM327 specification:
014 - 014 bytes of information (HEX)
0:-sequence number
4902-response to an 0902 request
01-numbers of data items
So if I discard this bytes and convert the remaining hex numbers to ASCII I get:
57 50 30 5A 5A 5A 39 39 5A 54 53 33 39 32 31 32 34
W P 0 Z Z Z 9 9 Z T S 3 9 2 1 2 4
Perfect
Hope this can help someone that needs the VIN.
write 0902 to ask for the VIN.
With a VIN of WP0ZZZ99ZTS392124 in the OBD-simulator a got this respond back:
014 0: 49 02 01 57 50 30
01: 5A 5A 5A 39 39 5A 54
02: 53 33 39 32 31 32 34
According to the ELM327 specification:
014 - 014 bytes of information (HEX)
0:-sequence number
4902-response to an 0902 request
01-numbers of data items
So if I discard this bytes and convert the remaining hex numbers to ASCII I get:
57 50 30 5A 5A 5A 39 39 5A 54 53 33 39 32 31 32 34
W P 0 Z Z Z 9 9 Z T S 3 9 2 1 2 4
Perfect
Hope this can help someone that needs the VIN.
Re: Read VIN?
Where are you putting the code to write 0902 to ask for the VIN? Are you putting it in OBD.h or OBD.cpp?
I'm trying to get the VIN myself, would you be willing to share the code snippet please?
I tried adding a definition to OBD.h like this:
.. but I can't see how the mode is defined (all other PIDs have a 'mode' of 1, request vehicle data is 9.
I'd love to add this to the OBD library as a definition so that the VIN can be requested in the same way as any other PID, but I can't work out how to account for the different 'mode'.
I also suspect that the string might need to be normalised and formatted in OBD.cpp?
I'm trying to get the VIN myself, would you be willing to share the code snippet please?
I tried adding a definition to OBD.h like this:
Code: Select all
#define PID_VIN 0x02
.. but I can't see how the mode is defined (all other PIDs have a 'mode' of 1, request vehicle data is 9.
I'd love to add this to the OBD library as a definition so that the VIN can be requested in the same way as any other PID, but I can't work out how to account for the different 'mode'.
I also suspect that the string might need to be normalised and formatted in OBD.cpp?
Re: Read VIN?
In current implementation of OBD library, only mode 01 is handled. You can though send "0902\r" to request for the VIN data and parse it.
Re: Read VIN?
1. Can I make this request from datalogger.ino, or do I need to do this in the OBD library? Something like this?
2. To make requests of the OBD-II, does "0902\r" need to be prefixed with an special AT command? For example:
Apologies if my questions seem basic, I am trying to understand how serial requests to the different attached components work.
Code: Select all
write("0902\r");
receive();
2. To make requests of the OBD-II, does "0902\r" need to be prefixed with an special AT command? For example:
- a. requests to the GPS depending on need are prefixed with ATBR2 to set baud rate, ATSGC to set NMEA update rate and ATGRR to get NMEA data.
b. requests to the OBD-II appear to be prefixed by ATSP.
Apologies if my questions seem basic, I am trying to understand how serial requests to the different attached components work.
-
- Posts: 2
- Joined: Sun Apr 23, 2017 6:32 am
Re: Read VIN?
I am sending a "0902"<CR> and I am get back 84 bytes of VIN data. Is there another command that can help me parse this VIN data?
Re: Read VIN?
Please refer to our Arduino library for how to parse the response.
-
- Posts: 1
- Joined: Mon Aug 28, 2017 7:11 pm
- Contact:
Re: Read VIN?
I can´t find any function that reads the actual VIN from the OBD interface...