user44949: i have problem with accessing at-command in module Bluetooh HC-05.
i just follow all tutorial to activate at-command like this, 
http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-in-slave-mode/
or in this video
https://www.youtube.com/watch?v=Vr4cdpsoVEo&t=31s
and just read some explanation and implemented to my problem
HC-05 Bluetooth AT+INQ command not working
but i just still get same error. 
i cant use AT+INQ command, always get ERROR(1F). 
AT+INIT get ERROR(17).
i have module HC-05 with version 3.0-20170601
This is my code i use it.
#include <SoftwareSerial.h>
SoftwareSerial BTserial(8, 9); // RX | TX`

const long baudRate = 38400; 
char c=' ';
boolean NL = true;

void setup() 

{
   Serial.begin(9600);
   Serial.print("Sketch:   ");   Serial.println(__FILE__);
   Serial.print("Uploaded: ");   Serial.println(__DATE__);
   Serial.println(" ");

BTserial.begin(baudRate);  
Serial.print("BTserial started at "); Serial.println(baudRate);
Serial.println(" ");
}

void loop()

{

// Read from the Bluetooth module and send to the Arduino Serial Monitor
if (BTserial.available())
   {
       c = BTserial.read();
       Serial.write(c);
   }


   // Read from the Serial Monitor and send to the Bluetooth module
if (Serial.available())
   {
       c = Serial.read();
       BTserial.write(c);   

    // Echo the user input to the main window. The ">" character indicates 
    the user entered text.
    if (NL) { Serial.print(">");  NL = false; }
    Serial.write(c);
    if (c==10) { NL = true; }
   }

}


user45081: I have two modules:
(A) HC-05 with firmware version 3.0-20170601 
(B) HC-05 with firmware version 2.0-20100601 (ok)
I have the same problem: when the AT command "AT+INQ" is sent on (A) module, the response is always "ERROR:(1F)". This error code seems not be reported in any document or specification available on internet. This BT module have firmware version (AT+VERSION) 3.0-20170601. Also I have noticed that command AT+INIT on (A) module returns always ERROR:(17), this error normally can be ignored if the command has been sent already (Initiate SPP lib), but the first time should be return "OK" as on (B) module. 
The (B) module with firmware version 2.0-20100601 works ok with the following commands (set PIN34 high at power-up, or press button on module and keep pressed during commands):
AT+RMAAD -> delete all paired devices list
AT+ROLE=1 -> Set master mode
AT+RESET -> reset module to enter into master mode
AT+CMODE=1 -> Permit connection with any device
AT+INQM=0,5,9 -> Set Search parameters(Query mode standard, 5 devices, 9secs)
AT+INIT  --> Init SPP profile mode (first time response: "OK")
AT+INQ  --> Start search devices (return device list after some seconds)
The differences between two modules are:
On AT+INIT the (A) module return always ERROR:(17), the (B) module return "OK" first time and ERROR:(17) if the command is sent twice.
On (A) module the command AT+INQ return always ERROR:(1F), the (B) module return the list of the BT devices.
Also the (A) and (B) modules are physically different. The (B) module have some components (resistors/capacitors) between the two big black chips, the (A) module no. 
Also I noticed that on (A) module the AT+CLASS? return "1f00" value (default?). The correct value should be "0" as (B) module ? Anyway setting AT+CLASS=0 on (A) module the result is always the same.
In slave mode (AT+ROLE=0) both modules works fine.
With (A) module I'm unable to use it as "MASTER" and connect it to any other slave BT modules because did not perform devices search. (INQ fails).  
I think that in 3.0 firmware is needed to set other(s) parameter(s) in order to start SPP profile correctly (INIT) and then avoid ERROR:(1F) in INQ command (search).
Someone already solved the problem ?

user7083: Extending the Presidenten's answer, the easiest way to program HC-05 is to sonnect a wire to EN on the chip and set the UART console to 9600.
Then pull the EN high, send commands, wait for OK (after each one), and drive EN down. 
You now have a chip in data state.

user48778: I have a HC-05 with 3.0-20170601 that I managed to bind to a slave last night. It turns out that the v3 has two AT-modes.
The first is when you hold the button while you connect power. The led will blink slowly and you can connect at 38400 baud. But this is like a configuration mode, where AT+INQ is not available.
In this mode I did these commands:
AT
AT+UART
AT+RMAAD
AT+ROLE=1

(Press and hold the button)
AT+RESET

(Release the button after device restarts and led is slowly blinking)
AT+CMODE=1
AT+INQM=0,5,5
AT+PSWD="9999"

AT should give OK as answer to know connection is working
AT+UART will show configured baudrate. Default is 9600.
AT+RMAAD clears all saved connections
AT+ROLE=1 sets it as master
AT+RESET restarts the device to change to master
AT+CMODE=1 accepts all kinds of devices
AT+INQM=0,5,5 inquires in standard mode, with 5 max connections or 5 secs
AT+PSWD="9999" sets the pin code 9999, change to the pin you need
After this it is time to update the arudino code. In your case you should update line 4 from 
const long baudRate = 38400;

to
const long baudRate = 9600;

...or what ever value you might have set the baud rate to. Then reflash your arduino.
Now enter the very irritating second AT command mode. 
Power up without holding the button. You will get the fast blink speed. When its powered up, press and hold the button. The led will continue blinking fast, but while the button is pressed you can now connect to the device on the configured baud rate. So open the serial monitor and type AT to verify.
Remember that the mode is only active while the button is pressed. So keep it pressed. I had a small clamp I put on there.
Then I entered these commands:
AT+STATE

AT+STATE will show current state, should be inquiring
Then power up the slave device and the adress should start popping up. It will be something like xyz:xy:xyzw,931F00,7FFF
The first part is the address you want (xyz:xy:xyzw)
Change : to , and get xyz,xy,xyzw
Check that you connecting to the correct device
AT+RNAME?xyz,xy,xyzw

Then bind
AT+PAIR=xyz,xy,xyzw,5
AT+BIND=xyz,xy,xyzw
AT+LINK=xyz,xy,xyzw

The AT+LINK command gave me FAIL as output. But it did not matter.
I restarted and did not press any button before or after. Just normal start. 
After 5-10s serial data showed up in my serial monitor. 
Modules are bound. And will automatically connect at power up. If not you might have the wrong pincode. Make sure to change 9999 above to 0000 or 1234 or what ever it may be. When I hade the wrong pin I still got OK from the AT+PAIR and AT+BIND commands... It didnt work for me until I entered the correct pin.
Sorry for long post, but I wanted to be thorough since info about HC-05 v3 is very scarce on the internet right now. 
A reference to all commands can be found here:
http://www.electronicaestudio.com/docs/istd016A.pdf
(Link valid 2018-08-13)

44949: <p>i have problem with accessing <strong>at-command in module Bluetooh HC-05</strong>.</p>

<p>i just follow all tutorial to activate at-command like this, 
<a href="http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-in-slave-mode/" rel="nofollow noreferrer">http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-in-slave-mode/</a></p>

<p>or in this video
<a href="https://www.youtube.com/watch?v=Vr4cdpsoVEo&amp;t=31s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Vr4cdpsoVEo&amp;t=31s</a></p>

<p>and just read some explanation and implemented to my problem
<a href="https://electronics.stackexchange.com/questions/180962/hc-05-bluetooth-atinq-command-not-working">HC-05 Bluetooth AT+INQ command not working</a></p>

<p><strong>but i just still get same error. 
i cant use AT+INQ command, always get ERROR(1F). 
AT+INIT get ERROR(17).</strong></p>

<p>i have module HC-05 with version 3.0-20170601</p>

<p>This is my code i use it.</p>

<pre><code>#include &lt;SoftwareSerial.h&gt;
SoftwareSerial BTserial(8, 9); // RX | TX`

const long baudRate = 38400; 
char c=' ';
boolean NL = true;

void setup() 

{
   Serial.begin(9600);
   Serial.print("Sketch:   ");   Serial.println(__FILE__);
   Serial.print("Uploaded: ");   Serial.println(__DATE__);
   Serial.println(" ");

BTserial.begin(baudRate);  
Serial.print("BTserial started at "); Serial.println(baudRate);
Serial.println(" ");
}

void loop()

{

// Read from the Bluetooth module and send to the Arduino Serial Monitor
if (BTserial.available())
   {
       c = BTserial.read();
       Serial.write(c);
   }


   // Read from the Serial Monitor and send to the Bluetooth module
if (Serial.available())
   {
       c = Serial.read();
       BTserial.write(c);   

    // Echo the user input to the main window. The "&gt;" character indicates 
    the user entered text.
    if (NL) { Serial.print("&gt;");  NL = false; }
    Serial.write(c);
    if (c==10) { NL = true; }
   }

}
</code></pre>
 45081: <p>I have two modules:</p>

<p>(A) HC-05 with firmware version 3.0-20170601 </p>

<p>(B) HC-05 with firmware version 2.0-20100601 (ok)</p>

<p>I have the same problem: when the AT command "AT+INQ" is sent on (A) module, the response is always "ERROR:(1F)". This error code seems not be reported in any document or specification available on internet. This BT module have firmware version (AT+VERSION) 3.0-20170601. Also I have noticed that command AT+INIT on (A) module returns always ERROR:(17), this error normally can be ignored if the command has been sent already (Initiate SPP lib), but the first time should be return "OK" as on (B) module. </p>

<p>The (B) module with firmware version 2.0-20100601 works ok with the following commands (set PIN34 high at power-up, or press button on module and keep pressed during commands):</p>

<p>AT+RMAAD -> delete all paired devices list</p>

<p>AT+ROLE=1 -> Set master mode</p>

<p>AT+RESET -> reset module to enter into master mode</p>

<p>AT+CMODE=1 -> Permit connection with any device</p>

<p>AT+INQM=0,5,9 -> Set Search parameters(Query mode standard, 5 devices, 9secs)</p>

<p>AT+INIT  --> Init SPP profile mode (first time response: "OK")</p>

<p>AT+INQ  --> Start search devices (return device list after some seconds)</p>

<p>The differences between two modules are:</p>

<p>On AT+INIT the (A) module return always ERROR:(17), the (B) module return "OK" first time and ERROR:(17) if the command is sent twice.
On (A) module the command AT+INQ return always ERROR:(1F), the (B) module return the list of the BT devices.</p>

<p>Also the (A) and (B) modules are physically different. The (B) module have some components (resistors/capacitors) between the two big black chips, the (A) module no. </p>

<p>Also I noticed that on (A) module the AT+CLASS? return "1f00" value (default?). The correct value should be "0" as (B) module ? Anyway setting AT+CLASS=0 on (A) module the result is always the same.</p>

<p>In slave mode (AT+ROLE=0) both modules works fine.</p>

<p>With (A) module I'm unable to use it as "MASTER" and connect it to any other slave BT modules because did not perform devices search. (INQ fails).  </p>

<p>I think that in 3.0 firmware is needed to set other(s) parameter(s) in order to start SPP profile correctly (INIT) and then avoid ERROR:(1F) in INQ command (search).</p>

<p>Someone already solved the problem ?</p>
 7083: <p>Extending the Presidenten's answer, the easiest way to program HC-05 is to sonnect a wire to EN on the chip and set the UART console to 9600.</p>

<p>Then pull the EN high, send commands, wait for OK (after each one), and drive EN down. </p>

<p>You now have a chip in data state.</p>
 48778: <p>I have a HC-05 with 3.0-20170601 that I managed to bind to a slave last night. It turns out that the v3 has two AT-modes.</p>

<p>The first is when you hold the button while you connect power. The led will blink slowly and you can connect at 38400 baud. But this is like a configuration mode, where AT+INQ is not available.</p>

<p>In this mode I did these commands:</p>

<pre><code>AT
AT+UART
AT+RMAAD
AT+ROLE=1
</code></pre>

<p>(Press and hold the button)</p>

<pre><code>AT+RESET
</code></pre>

<p>(Release the button after device restarts and led is slowly blinking)</p>

<pre><code>AT+CMODE=1
AT+INQM=0,5,5
AT+PSWD="9999"
</code></pre>

<p>AT should give OK as answer to know connection is working</p>

<p>AT+UART will show configured baudrate. Default is 9600.</p>

<p>AT+RMAAD clears all saved connections</p>

<p>AT+ROLE=1 sets it as master</p>

<p>AT+RESET restarts the device to change to master</p>

<p>AT+CMODE=1 accepts all kinds of devices</p>

<p>AT+INQM=0,5,5 inquires in standard mode, with 5 max connections or 5 secs</p>

<p>AT+PSWD="9999" sets the pin code 9999, change to the pin you need</p>

<p>After this it is time to update the arudino code. In your case you should update line 4 from </p>

<pre><code>const long baudRate = 38400;
</code></pre>

<p>to</p>

<pre><code>const long baudRate = 9600;
</code></pre>

<p>...or what ever value you might have set the baud rate to. Then reflash your arduino.</p>

<p>Now enter the very irritating second AT command mode. </p>

<p>Power up without holding the button. You will get the fast blink speed. When its powered up, press and hold the button. The led will continue blinking fast, but while the button is pressed you can now connect to the device on the configured baud rate. So open the serial monitor and type AT to verify.
Remember that the mode is only active while the button is pressed. So keep it pressed. I had a small clamp I put on there.</p>

<p>Then I entered these commands:</p>

<pre><code>AT+STATE
</code></pre>

<p>AT+STATE will show current state, should be inquiring</p>

<p>Then power up the slave device and the adress should start popping up. It will be something like xyz:xy:xyzw,931F00,7FFF</p>

<p>The first part is the address you want (xyz:xy:xyzw)</p>

<p>Change : to , and get xyz,xy,xyzw</p>

<p>Check that you connecting to the correct device</p>

<pre><code>AT+RNAME?xyz,xy,xyzw
</code></pre>

<p>Then bind</p>

<pre><code>AT+PAIR=xyz,xy,xyzw,5
AT+BIND=xyz,xy,xyzw
AT+LINK=xyz,xy,xyzw
</code></pre>

<p>The AT+LINK command gave me FAIL as output. But it did not matter.
I restarted and did not press any button before or after. Just normal start. </p>

<p>After 5-10s serial data showed up in my serial monitor. </p>

<p>Modules are bound. And will automatically connect at power up. If not you might have the wrong pincode. Make sure to change 9999 above to 0000 or 1234 or what ever it may be. When I hade the wrong pin I still got OK from the AT+PAIR and AT+BIND commands... It didnt work for me until I entered the correct pin.</p>

<p>Sorry for long post, but I wanted to be thorough since info about HC-05 v3 is very scarce on the internet right now. </p>

<p>A reference to all commands can be found here:
<a href="http://www.electronicaestudio.com/docs/istd016A.pdf" rel="nofollow noreferrer">http://www.electronicaestudio.com/docs/istd016A.pdf</a>
(Link valid 2018-08-13)</p>
