user3237: I currently try to connect an Arduino Micro/Leonardo/32u4 to an ELM327 Bluetooth dongle using a HC-05 Bluetooth shield from iTeadStudio. I also have similar problems trying to connect to a bluetooth dongle (with added serial connection) on my PC.
The basic AT-command communication works, but I haven't found out yet why AT+PAIR or AT+LINK are failing and what should be done to avoid this (I've done dozens of Serial Monitor command iterations). Until now I haven't found a command sequence that reliably connects. What I've tried so far (from different documentation and example codes):
Check general AT command set:
AT
> OK

Reset to default values:
AT+ORGL
> OK

Set master mode and check it:
AT+ROLE=1
> OK
AT+ROLE?
> +ROLE:1
> OK

Connect only to the specified bluetooth address:
AT+CMODE=0
> OK

Reset and initialize:
AT+RESET
> OK
AT+INIT
> OK

Configure inquiring mode:
AT+INQM=1,9,48
> OK

Inquire:
AT+INQ
> +INQ:12:34:567890:1F1F,7FFF
> OK
AT+STATE?
> +STATE:INQUIRING

Try to stop inquiring:
AT+INQC
> OK
AT+STATE?
> +STATE:INQUIRING
> OK

Reset and initialize again (otherwise we can't leave the inquiring state):
AT+RESET
> OK
AT+INIT
> OK
AT+STATE?
> +STATE:INITIALIZED
> OK

Try to pair with the found device (my PC asks for the 1234-password and creates a serial port):
AT+PAIR=12,34,567890,20
> OK
AT+STATE?
> +STATE:PAIRED

Try to connect
AT+BIND=12,34,567890
> OK
AT+LINK=12,34,567890
> FAIL
...

Does someone have some hints for finding the right sequence?

user3237: It looks like I now have a slight understanding of what happens and how to get the HC-05 working.
Be sure to have the CMD-DAT-switch set to CMD before turning on the HC-05.
Command mode (configuration)
Check general AT command set:
AT
> OK

Reset to default values (sets, among others, ROLE=0 and CMODE=1):
AT+ORGL
> OK

Set master mode and check it:
AT+ROLE=1
> OK
AT+ROLE?
> +ROLE:1
> OK

Reset and initialize (reset aborts, e.g. the inquiring state - quickly flashing LED; without initializing you would get ERROR(16)):
AT+RESET
> OK
AT+INIT
> OK

Now the LED should slowly flash.
Optionally: set password of the target device:
AT+PSWD=1234
> OK

Show count of all authenticated devices in pair list:
AT+ADCN?
> +ADCN:7
> OK

If the value is larger than 0, delete all authenticated devices in pair list:
AT+RMAAD
> OK

Now pair with the desired device (the last 20 mean 20s):
AT+PAIR=12,34,567890,20
> OK

The LED starts flashing one time with a longer pause.
Set the desired device:
AT+BIND=12,34,567890
> OK

Now link (e.g. when connecting to the ELM327; the PC will create another new port after having requested the password from the user):
AT+LINK=12,34,567890
> OK

The LED starts flashing two times with a longer pause. After linking, it might be that either the HC-05 switches to data-mode or continues in command-mode (haven't found out when it does one or the other).
Command mode (auto connect)
Now switch off the HC-05 and keep the CMD-DAT-switch to CMD. Switch it on again. It should automatically connect to the previously connected device. To switch to the data mode, first disconnect...
AT+DISC
> +DISC:SUCCESS
> OK

... and reconnect.
AT+LINK=12,34,567890
> OK

Now the connection seems to have switched to data mode.
Data Mode
Now switch off the HC-05 and move the CMD-DAT-switch to DAT. Turn on the HC-05. It automatically will try to connect to the previously connected device - the LED should flash two times with longer pause - and you don't have to mess with HC-05-AT commands any more.

user4519: I am using a "BIND" between the PAIR and LINK:
AT+PAIR=98D3,31,FC2D54,5
AT+BIND=98D3,31,FC2D54
AT+LINK=98D3,31,FC2D54

That seems to work for me.
See the docs here:
ftp://imall.iteadstudio.com/Modules/IM120723009/DS_IM120723009.pdf

3237: <p>I currently try to connect an Arduino Micro/Leonardo/32u4 to an ELM327 Bluetooth dongle using a HC-05 Bluetooth shield from iTeadStudio. I also have similar problems trying to connect to a bluetooth dongle (with added serial connection) on my PC.</p>

<p>The basic AT-command communication works, but I haven't found out yet why AT+PAIR or AT+LINK are failing and what should be done to avoid this (I've done dozens of Serial Monitor command iterations). Until now I haven't found a command sequence that reliably connects. What I've tried so far (from different documentation and example codes):</p>

<p>Check general AT command set:</p>

<pre><code>AT
&gt; OK
</code></pre>

<p>Reset to default values:</p>

<pre><code>AT+ORGL
&gt; OK
</code></pre>

<p>Set master mode and check it:</p>

<pre><code>AT+ROLE=1
&gt; OK
AT+ROLE?
&gt; +ROLE:1
&gt; OK
</code></pre>

<p>Connect only to the specified bluetooth address:</p>

<pre><code>AT+CMODE=0
&gt; OK
</code></pre>

<p>Reset and initialize:</p>

<pre><code>AT+RESET
&gt; OK
AT+INIT
&gt; OK
</code></pre>

<p>Configure inquiring mode:</p>

<pre><code>AT+INQM=1,9,48
&gt; OK
</code></pre>

<p>Inquire:</p>

<pre><code>AT+INQ
&gt; +INQ:12:34:567890:1F1F,7FFF
&gt; OK
AT+STATE?
&gt; +STATE:INQUIRING
</code></pre>

<p>Try to stop inquiring:</p>

<pre><code>AT+INQC
&gt; OK
AT+STATE?
&gt; +STATE:INQUIRING
&gt; OK
</code></pre>

<p>Reset and initialize again (otherwise we can't leave the inquiring state):</p>

<pre><code>AT+RESET
&gt; OK
AT+INIT
&gt; OK
AT+STATE?
&gt; +STATE:INITIALIZED
&gt; OK
</code></pre>

<p>Try to pair with the found device (my PC asks for the 1234-password and creates a serial port):</p>

<pre><code>AT+PAIR=12,34,567890,20
&gt; OK
AT+STATE?
&gt; +STATE:PAIRED
</code></pre>

<p>Try to connect</p>

<pre><code>AT+BIND=12,34,567890
&gt; OK
AT+LINK=12,34,567890
&gt; FAIL
...
</code></pre>

<p>Does someone have some hints for finding the right sequence?</p>
 3237: <p>It looks like I now have a slight understanding of what happens and how to get the HC-05 working.</p>

<p>Be sure to have the CMD-DAT-switch set to CMD before turning on the HC-05.</p>

<p><strong>Command mode (configuration)</strong></p>

<p>Check general AT command set:</p>

<pre><code>AT
&gt; OK
</code></pre>

<p>Reset to default values (sets, among others, ROLE=0 and CMODE=1):</p>

<pre><code>AT+ORGL
&gt; OK
</code></pre>

<p>Set master mode and check it:</p>

<pre><code>AT+ROLE=1
&gt; OK
AT+ROLE?
&gt; +ROLE:1
&gt; OK
</code></pre>

<p>Reset and initialize (reset aborts, e.g. the inquiring state - quickly flashing LED; without initializing you would get ERROR(16)):</p>

<pre><code>AT+RESET
&gt; OK
AT+INIT
&gt; OK
</code></pre>

<p>Now the LED should slowly flash.
Optionally: set password of the target device:</p>

<pre><code>AT+PSWD=1234
&gt; OK
</code></pre>

<p>Show count of all authenticated devices in pair list:</p>

<pre><code>AT+ADCN?
&gt; +ADCN:7
&gt; OK
</code></pre>

<p>If the value is larger than 0, delete all authenticated devices in pair list:</p>

<pre><code>AT+RMAAD
&gt; OK
</code></pre>

<p>Now pair with the desired device (the last 20 mean 20s):</p>

<pre><code>AT+PAIR=12,34,567890,20
&gt; OK
</code></pre>

<p>The LED starts flashing one time with a longer pause.
Set the desired device:</p>

<pre><code>AT+BIND=12,34,567890
&gt; OK
</code></pre>

<p>Now link (e.g. when connecting to the ELM327; the PC will create another new port after having requested the password from the user):</p>

<pre><code>AT+LINK=12,34,567890
&gt; OK
</code></pre>

<p>The LED starts flashing two times with a longer pause. After linking, it might be that either the HC-05 switches to data-mode or continues in command-mode (haven't found out when it does one or the other).</p>

<p><strong>Command mode (auto connect)</strong></p>

<p>Now switch off the HC-05 and keep the CMD-DAT-switch to CMD. Switch it on again. It should automatically connect to the previously connected device. To switch to the data mode, first disconnect...</p>

<pre><code>AT+DISC
&gt; +DISC:SUCCESS
&gt; OK
</code></pre>

<p>... and reconnect.</p>

<pre><code>AT+LINK=12,34,567890
&gt; OK
</code></pre>

<p>Now the connection seems to have switched to data mode.</p>

<p><strong>Data Mode</strong></p>

<p>Now switch off the HC-05 and move the CMD-DAT-switch to DAT. Turn on the HC-05. It automatically will try to connect to the previously connected device - the LED should flash two times with longer pause - and you don't have to mess with HC-05-AT commands any more.</p>
 4519: <p>I am using a "BIND" between the PAIR and LINK:</p>

<pre><code>AT+PAIR=98D3,31,FC2D54,5
AT+BIND=98D3,31,FC2D54
AT+LINK=98D3,31,FC2D54
</code></pre>

<p>That seems to work for me.</p>

<p>See the docs here:</p>

<p><a href="ftp://imall.iteadstudio.com/Modules/IM120723009/DS_IM120723009.pdf" rel="nofollow">ftp://imall.iteadstudio.com/Modules/IM120723009/DS_IM120723009.pdf</a></p>
