Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to find nearby Bluetooth devices

Status
Not open for further replies.

Mithun_K_Das

Advanced Member level 3
Joined
Apr 24, 2010
Messages
899
Helped
24
Reputation
48
Reaction score
26
Trophy points
1,318
Location
Dhaka, Bangladesh, Bangladesh
Activity points
8,252
We know that we can scan nearby Bluetooth devices through our phones. But how we can scan nearby available Bluetooth devices using Bluetooth modules such as HC-05/06 or JDY-08 etc?

Thanks in advance.
--- Updated ---

I used this code after reading that the HC05 can find the scan list.
Code:
#include <SoftwareSerial.h>

SoftwareSerial Bluetooth(6, 5);
String readstr;
void setup()
{
  Serial.begin(9600);
  Bluetooth.begin(38400);
  // Bluetooth.begin(115200);
  Bluetooth.print("AT+ROLE=1\r\n"); delay(1000);
  Bluetooth.print("AT+CMODE=1\r\n"); delay(1000);
  Bluetooth.print("AT+INIT\r\n"); delay(1000);
  Bluetooth.print("AT+IAC=9e8b33\r\n"); delay(1000);
  Bluetooth.print("AT+CLASS=1f1f\r\n"); delay(1000);
  Bluetooth.print("AT+INQM=1,2,20\r\n"); delay(1000);

  Serial.println("BT Scan result: ");
}

void loop()
{


  Bluetooth.print("AT+INQ\r\n");

  delay(10);
  while (Bluetooth.available())
  {
    delay(10);
    char c = Bluetooth.read();
    readstr += c;
  }
  if (readstr.length() > 0)
  {
    Serial.print("BT response:");
    Serial.println(readstr);
    readstr = "";
    delay(3000);
  }
  delay(2000);

}

But there is nothing except just 'OK' in return
 
Last edited by a moderator:

I believe the advice is to use Bluetooth over short distances. Distant devices may not be detected.

Even with nearby devices Bluetooth seems fussy. I have an iPhone and Macintosh. They recognize each other but that's all. I have never succeeded in transferring data. Usually I must make several attempts, discarding and reconnecting. (The passcode works.) Nor has cable USB hookup ever succeeded for me.

Those are my only Bluetooth devices. Occasionally the list includes a device from a nearby apartment.

I'd appreciate a helpful verbose report onscreen, telling me how far Bluetooth contact progressed, and what is the hangup. I don't understand why Macintosh and Windows keep it obscure.

Can you dig further internally to find progress reports... such as what channel frequencies it tries, baud rates, signal strengths?
 

I've not used the devices you mention, nor used the ATxxx codes, but all Bluetooth devices will advertise in whatever manner the device maker wishes. (Devices connected to a power supply generally advertise continuously, while battery powered devices tend to advertise in bursts to conserve power.)
What @BradtheRad is probably seeing on iPhones and Macs is probably a filtered set of advertisement packets.
On my iPhone/iPad I use 'BLE Scanner' or 'CySmart' that show all of the advertising devices (and their RSSI values) although many show up as 'N/A' (because the device is not advertising its name - there is probably something else in the packet that is being used to identify it). There are other apps that scan for Bluetooth devices around.
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top