How to send custom CAN messages using ELM327?
I am working with ELM327 and I would like us to be able to send headers and data parts of CAN messages. I see there is some code to set up the header for posts
SH xxyyzz
But I'm having trouble finding a way to set the data and control piece when posting.
How does this happen when I submit an ASCII request for a PID with extra characters for a data field?
And will this use the header that was given by the SH command?
Is there a better way to do this?
source to share
If you are using ELM327 and you are using a protocol like J1850 vpw or J1850 pwm (older 2003 CAN models). Then you will use it to set the title.
The header will consist of xx yy zz xx = message priority (i.e. 68) yy = target address of the module you want to talk to (i.e. 5A) zz = Sender address, which can usually be F1
So your team will look like this: ATSH 68 5A F1
This sets the title. Now you want to send data. Any data you send from now on will use this header and send data to this module.
So, if you want to get RPM, you can just send 01 0C. You will get something like 41 0C 23. The last byte of data is the RPM value. You will need to find a formula to convert it to human readable format. A lot of information can be found here.
https://en.wikipedia.org/wiki/OBD-II_PIDs
By the way, if you are communicating on a CAN network, you just use the module ID as a header. ATSH 7E0 and then send your data. all vehicles 2008+ CAN .. some 2003-2007 as well.
source to share