# HC-05 -\> Inquiring mode (INQ)

**URL:** <https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316>\
**Category:** General Guidance\
**Created:** [September 10, 2015, 9:57am UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316 "2015-09-10T09:57:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shihaoyap](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Shihaoyap](https://forum.arduino.cc/u/Shihaoyap)\
**Post date:** [September 10, 2015, 9:57am UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/1 "2015-09-10T09:57:43Z")

</div>

Hello,

I am currently doing a project which requires me to get the RSSI value of bluetooth devices.  
I am using an arduino Uno board and a HC-05 bluetooth module.

Is it possible for the HC-05 to run in inquiring mode by itself? because right now i must always set it into inquiring mode by typing "AT+INQ" in the serial command. Is it possible to program the arduino so that the HC-05 is always in inquiring mode and will automatically take in the RSSI of bluetooth devices when i plug it into a power source.

I have also set "AT+INQM = 1, 5000, 48". and the inquiring will always stop after some time. is it possible for it to run forever, until i switch it off?

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [September 10, 2015, 10:28am UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/2 "2015-09-10T10:28:00Z")

</div>

> Shihaoyap:  
> I have also set "AT+INQM = 1, 5000, 48". and the inquiring will always stop after some time. is it possible for it to run forever, until i switch it off?

Simple answer is no, you cannot make it run forever. The 48 in your command is the timeout value and can only be set between 1 and 48. 48 gives a timeout of about 61.44 seconds. What can't you get the arduino to look for the OK response when the command times out and send it again?

DON'T CROSSPOST

---

<div class="post-metadata">

**Author:** ![Shihaoyap](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Shihaoyap](https://forum.arduino.cc/u/Shihaoyap)\
**Post date:** [September 11, 2015, 12:05pm UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/3 "2015-09-11T12:05:16Z")

</div>

@Riva -\>Thank you for your reply 🙂 How will i be able to make my program to read a "OK" from the serial monitor?

---

<div class="post-metadata">

**Author:** ![Shihaoyap](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Shihaoyap](https://forum.arduino.cc/u/Shihaoyap)\
**Post date:** [September 11, 2015, 12:15pm UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/4 "2015-09-11T12:15:56Z")

</div>

bump

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [September 11, 2015, 12:31pm UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/5 "2015-09-11T12:31:51Z")

</div>

> Shihaoyap:  
> @Riva -\>Thank you for your reply 🙂 How will i be able to make my program to read a "OK" from the serial monitor?

Similar to how your reading the data supplied by the AT+INQ you sent to the BT module. I assume your reading and acting on this data as your looking for the RSSI of nearby BT devices.

---

<div class="post-metadata">

**Author:** ![Shihaoyap](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Shihaoyap](https://forum.arduino.cc/u/Shihaoyap)\
**Post date:** [September 12, 2015, 4:33am UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/6 "2015-09-12T04:33:41Z")

</div>

@Riva

This is the set of code i am using. It does seem to be able to repeat. Is it possible to help me have a look at it?

#include \<SoftwareSerial.h\>

SoftwareSerial BTSerial(10, 11); // RX | TX

int count=0;  
char val;

void setup()  
{  
pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode  
digitalWrite(9, HIGH);  
Serial.begin(9600);  
Serial.println("Enter AT commands:");  
BTSerial.begin(38400); // HC-05 default speed in AT command more  
Serial.println("AT");  
BTSerial.println("AT");  
delay(1000);  
Serial.println("AT+ORGL");  
BTSerial.println("AT+ORGL");  
delay(1000);  
Serial.println("AT+INIT");  
BTSerial.println("AT+INIT");  
delay(1000);  
Serial.println("AT+ROLE=1");  
BTSerial.println("AT+ROLE=1");  
delay(1000);  
Serial.println("AT+INQM=1,10000,48");  
BTSerial.println("AT+INQM=1,10000,48");  
delay(1000);  
BTSerial.println("AT+INQ");  
delay(1000);  
}

void loop()  
{  
// Keep reading from HC-05 and send to Arduino Serial Monitor  
if (BTSerial.available())  
{  
Serial.write(BTSerial.read());  
val = Serial.read();  
}

// Keep reading from Arduino Serial Monitor and send to HC-05  
if (Serial.available())  
{  
BTSerial.write(Serial.read());  
val = Serial.read();  
}

if (val == 'OK')  
{  
BTSerial.println("AT+INQ");  
}

}

---

<div class="post-metadata">

**Author:** ![Riva](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/riva/32/1013044_2.png) [@Riva](https://forum.arduino.cc/u/Riva)\
**Post date:** [September 12, 2015, 7:00am UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/7 "2015-09-12T07:00:00Z")

</div>

I see you have started a new thread on this [here](http://forum.arduino.cc/index.php?topic=347161.0) so I will stop replying here and comment in new thread.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 5:36pm UTC](https://forum.arduino.cc/t/hc-05-inquiring-mode-inq/334316/8 "2021-05-05T17:36:22Z")

</div>

Closed on May 5, 2021, 5:36pm UTC


