user21699: Can I use Arduino OBD library with "custom" software serial or it needs to be used with hardware UART only? For example if I have D5 and D6 pin as RX and TX in my code hooked on OBD board, how do I initialize OBD library from there?
This is the OBD library that I'm referring to.
And I'm using this Allpro OBD board.
Update
Actually I would be satisfied with a answer how to know when entire response from the board is received, because this way is way too messy:
void getResponse(void){
 while(obdSerial.available()){
   Serial.write(obdSerial.read());
  }
}

Here I don't know when the message is received. And if I try to use example from Sparkfun obd-ii-uart-hookup-guide (different board doe) I ended up in infinite-loop since the board never return \r, if I send ELM command to use \n as terminator, and if I disable ELM to echo the command so that I use just one getResponse call I get some readings, but not all the time, I ended up in infinite-loop again.

user4143: That library is hard-coded to use the single Hardware Serial device on the Arduino Uno or the second Hardware Serial1 device on other boards.
#ifndef OBDUART
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168P__)
#define OBDUART Serial
#else
#define OBDUART Serial1
#endif
#endif

You can edit the library's header file OBD.h to define your own serial port though:
#include <SoftwareSerial.h>
extern SoftwareSerial mySerialPort;
#define OBDUART mySerialPort

And then in your sketch create the mySerialPort SoftwareSerial object.

21699: <p>Can I use Arduino OBD library with "custom" software serial or it needs to be used with hardware UART only? For example if I have D5 and D6 pin as RX and TX in my code hooked on OBD board, how do I initialize OBD library from there?</p>

<p>This is the <a href="https://github.com/stanleyhuangyc/ArduinoOBD" rel="nofollow">OBD library</a> that I'm referring to.</p>

<p>And I'm using this <a href="http://www.obddiag.net/allpro.html" rel="nofollow">Allpro OBD</a> board.</p>

<p><strong>Update</strong>
Actually I would be satisfied with a answer how to know when entire response from the board is received, because this way is way too messy:</p>

<pre><code>void getResponse(void){
 while(obdSerial.available()){
   Serial.write(obdSerial.read());
  }
}
</code></pre>

<p>Here I don't know when the message is received. And if I try to use example from <strong>Sparkfun</strong> <strong>obd-ii-uart-hookup-guide</strong> (different board doe) I ended up in infinite-loop since the board never return <code>\r</code>, if I send ELM command to use <code>\n</code> as terminator, and if I disable ELM to echo the command so that I use just one <code>getResponse</code> call I get some readings, but not all the time, I ended up in infinite-loop again.</p>
 4143: <p>That library is hard-coded to use the single Hardware Serial device on the Arduino Uno or the second Hardware Serial1 device on other boards.</p>

<pre><code>#ifndef OBDUART
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168P__)
#define OBDUART Serial
#else
#define OBDUART Serial1
#endif
#endif
</code></pre>

<p>You can edit the library's header file <code>OBD.h</code> to define your own serial port though:</p>

<pre><code>#include &lt;SoftwareSerial.h&gt;
extern SoftwareSerial mySerialPort;
#define OBDUART mySerialPort
</code></pre>

<p>And then in your sketch create the <code>mySerialPort</code> SoftwareSerial object.</p>
