I would like to ask you which finally is the best way to initialize ELM327-ECU communication? I've read about the 33h for ISO standards, about ATZ, ATSP, ATWS etc..
From my experience, I've never used 33h for ISO neither something else except ATZ.. But what happens is that sometimes the application just refuses to connect. I haven't been able to track down the problem, but what I have found is that if I open some other software such as OBDGauge or Torque, then my app will connect fine..
So what I imagine is that there must be a command that makes the ECU or the ELM327 fire up again and start working.. I currently just use ATZ and planning on trying ATWS and ATSP0..
Also, when I quit my app do I have to send any special command for smooth disconnection or just exit the app?
What is your opinion about all the above? Is there a universal solution for all protocols or should I find out which protocol it is and then do something special about each adn every protocol?
So, so many experienced programmers here with so many apps written and nobody is willing to help?
I think you should read the ELM327 datasheet. ATZ resets the ELM, it does not initialize communication. ATSP0 sets the protocol to auto-detect, and if you issue a command, such as 0100 directly afterwards, it will query the ECU and attempt to figure out what protocol it is supposed to use, and then return the proper reply.
Yes that's exactly what I'm doing, ATZ then 0100 to figure out the available PIDs.. Sometimes therefore, the scanner seems to stall there and it may return " >" forever..
Here's an example of simple ELM init and PID reads. It sounds like what you are doing should work. Is this an intermittent problem, or does it always fail to respond to the 0100 request? Also, what is the protocol of the vehicle you are testing on?
RX:0100\r7E8 06 41 00 BE 1F A8 13 \r\r
RX:0120\r7E8 06 41 20 90 05 B0 15 \r\r
RX:0140\r7E8 06 41 40 FA DC 20 00 \r\r
RX:0101\r7E8 06 41 01 00 07 65 00 \r\r
It is ISO-9141-2.. It dowsn't always fail to connect, just sometimes.. And sometimes it happens the very first time you plug in the scanner to the car and try to connect..
From the commands you posted I don't always use 0100 and I don't use 0101 at all..
Oh btw if I do it through Hyperterminal it always responds, maybe windows mobile are a bit strange in their communications..
That was just an example, but you shouldn't need to send 0100 or 0101 in that order. One odd thing about ELM is that sometimes it responds with a message "SEARCHING". This can mess up your parsing if you aren't expecting it.
Originally Posted by Nitroking
True.. Usually for 0100 it says SEARCHING... and then it responds, I have no problem parsing the SEARCHING... thing, it's just that sometimes it just sends " >" and I thought that maybe there was some command I didn't know about..