billcyz
billcyz

Reputation: 1389

flutter_blue can't find HC-05 Bluetooth Module

I'm using flutter_blue for Android app. I've granted all required permissions and also enabled GPS on the phone. When it starts to scan, I can see a list of Bluetooth devices, but I can't find my HC-05 Bluetooth Module. However when the HC-05 module can be found when I use my phone directly. Can anyone help me?

Here is my code for scanning:

FlutterBlue flb = _bluetoothService.getInstance();
    flb
        .startScan(timeout: Duration(seconds: 20), scanMode: ScanMode.lowPower)
        .then((x) {
      List<ScanResult> r = x as List<ScanResult>;
      r.forEach((a) {
        print('<<<<<');
        print('${a.device.id.id}');
        print(a.rssi);
      });
    });

Upvotes: 1

Views: 1852

Answers (1)

Michael Kotzjan
Michael Kotzjan

Reputation: 2662

The HC-05 is a Bluetooth Classic module, not a Bluetooth Low Energy (BLE) module. This is the reason you can find it through the usual Bluetooth Classic search in your phones operating system but not using flutter_blue, a BLE library.

You have to either use a BLE module or a different flutter library like flutter_bluetooth_serial.

Upvotes: 5

Related Questions