How to get RSSI value using HC-05

I want to calculate distance using RSSI value. I want my HC-05 and arduino UNO to calculate the RSSI value from any nearby bluetooth connected device.
how to write the code for this (I dont know much of arduino coding).
Also all the libraries I found are for wifi module, kindly suggest some library for getting RSSI in HC-05.

You can't in general, because RSSI is more strongly affected by relative antenna orientation and nearby absorbing and reflecting objects than distance.

To the question, even if it’s a moot point given this won’t help you calculate any meaningful distance, the RSSI is obtained by sending AT+INQ

Read this discussion for more info

I am trying this to find RSSI value from HC-05 using these commands :

at+init
at+orgl
at+role=1
at+inqm=1,9,48
at+inq

I have 4 doubts
can someone explain this (I am a noob)
1} AT+INIT is showing "ERROR:[0]" in my case. I did it once with role=0 and role=1, both are not working (its showing the same error)
2} also while calculating rssi, should the bluetooth be connected or not-connected.
3} "AT+INQM=1,9,48" in this command what is 1, 9 and 48.
4} Also I want to get rssi via a code rather than AT commands so is there a way. Pls suggest. Thanks in advance :slight_smile:

some old firmware might not have the AT+ INQ RSSI command.

➜ check the version of the firmware of your HC-05

AT+ORGL	(Resets the module to the factory default settings.)
AT+VERSION?

if it's supposed to work, You need to first initialise the search parameters

AT+INQM=Param1, Param2, Param3

  • Param1: Inquire access mode: 0 -> Standard, 1 -> RSSI
  • Param2: The maximum of Bluetooth devices response
  • Param3: The maximum of limited inquiring time

then run AT+ INQM? to verify the parameters are right and run AT+ INQ to get the info
it will perform a scan and report the RSSI for all the devices in range.

when I do this my arduino comes out of command mode and doesn't accept further commands

also can u give an example of this
thanks :slight_smile:
PS : sorry for late reply

What kind of example ?
It’s just an AT command

Merged to provide background.

okk
Thanks for all
:slight_smile: