flutter_blue icon indicating copy to clipboard operation
flutter_blue copied to clipboard

Cant find any devices while flutter blue scanning

Open luissouza opened this issue 6 years ago • 49 comments

I try to find the devices with de oficial example: https://github.com/pauldemarco/flutter_blue/tree/master/example

I have several devices (BLE) that should be listed, but they NEVER appear. What am i doing wrong? Please, help me!

All the devices are (BLE).

luissouza avatar Aug 08 '19 17:08 luissouza

Have you used another app (ex: LightBlue) to verify that your device can discover these devices?

gumbypp avatar Aug 09 '19 06:08 gumbypp

Have you used another app (ex: LightBlue) to verify that your device can discover these devices?

@gumbypp yes! Not appear to, why flutter_blue only appear BLE devices? I r

luissouza avatar Aug 09 '19 14:08 luissouza

I have the same issue. I tried with LG G6 with the example code and it shows nothing. Same if I search for paired devices. My devices are listed on LightBlue and on app built on top of flutter_bluetooth_serial.

scanForDevices() {

print('list of paired devices');
flutterBlue.connectedDevices.asStream().listen((paired) {
  print('paired device: $paired');
});
setState(() {
  _isScanning = true;
});
scanSubscription =
    flutterBlue.scan(timeout: Duration(seconds: 20)).listen((scanResult) {
  var device = scanResult.device;
  print('${device.name} found! rssi: ${scanResult.rssi}');
}, onDone: _stopScan);
scanSubscription.cancel();

} _logs: I/flutter (21110): list of paired devices D/BluetoothManager(21110): getConnectedDevices D/FlutterBluePlugin(21110): mGattServers size: 0 D/BluetoothAdapter(21110): isLeEnabled(): ON D/BluetoothLeScanner(21110): onScannerRegistered() - status=0 scannerId=5 mScannerId=0 I/flutter (21110): paired device: []

SzymonGalazka avatar Aug 19 '19 08:08 SzymonGalazka

I also encountered the same situation, but I can search for the device after I open the location of the phone.

RuijinYao avatar Sep 10 '19 08:09 RuijinYao

Same thing here, just one bluetooth device gets detected although plenty are on and visible for pairing. Tried all available ScanModes but no progress @RuijinYao by opening the location.. do you mean giving your app the location permission? To be honest after checking multiple BLE libraries and apps (LightBlue included) I am beginning to wonder if some manufacturers do something specific to prevent that their devices are detectable by anything other than the built in OS bluetooth software.

hicnar avatar Nov 29 '19 12:11 hicnar

Same problem

alejo9719 avatar Dec 04 '19 21:12 alejo9719

Me too, and I try agin by other bluetooth packages. but no one can work normally.

Skalate avatar Feb 03 '20 08:02 Skalate

HI Team ,
 I am also facing the same problem. My use case is I am trying to connect bluetooth scanner device (Socket 7XI[68481F]) but can’t find it with this plugin, though other devices are visible . I also tried the other flutter bluetooth serial plugin but in my case I’ll be needing this functionality in my IOS app . Does any one has got any work around for this , it will be much appreciate . Thanks in advance .

KushalRathore09 avatar Feb 22 '20 10:02 KushalRathore09

On Android devices, turn on GPS, and use all the functions in Flutter-blue. If not, phone can discover the device but cannot connect. Maybe you can turn on GPS. I haven't compiled the IOS program, maybe I can try it in a few days. I am a student studying automation, I don’t know much about android, but I have gained a lot of experience in the process of learning flutter. I am happy to share with you, I hope to keep in touch. 

 

李峦 掌上理工

联系我

 

------------------ 原始邮件 ------------------ 发件人: "Kushal Rathore"<[email protected]>; 发送时间: 2020年2月22日(星期六) 晚上6:37 收件人: "pauldemarco/flutter_blue"<[email protected]>; 抄送: "李峦"<[email protected]>; "Comment"<[email protected]>; 主题: Re: [pauldemarco/flutter_blue] Cant find any devices while flutter blue scanning (#336)

HI Team ,
 I am also facing the same problem. My use case is I am trying to connect bluetooth scanner device (Socket 7XI[68481F]) but can’t find it with this plugin, though other devices are visible . I also tried the other flutter bluetooth serial plugin but in my case I’ll be needing this functionality in my IOS app . Does any one has got any work around for this , it will be much appreciate . Thanks in advance .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Skalate avatar Feb 22 '20 14:02 Skalate

@Skalate thanks for reverting back , but unfortunately your solution didn't work for me . Have anyone got any solutions for this . Thanks in advance .

KushalRathore09 avatar Feb 26 '20 08:02 KushalRathore09

I don't know how to solve your problem, maybe you can try to contact the author of flutter-blue. Or use mixed development, it will take you some days to study the swift language. 

李峦 掌上理工

联系我

 

------------------ 原始邮件 ------------------ 发件人: "Kushal Rathore"<[email protected]>; 发送时间: 2020年2月26日(星期三) 下午4:55 收件人: "pauldemarco/flutter_blue"<[email protected]>; 抄送: "李峦"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [pauldemarco/flutter_blue] Cant find any devices while flutter blue scanning (#336)

@Skalate thanks for reverting back , but unfortunately your solution didn't work for me . Have anyone got any solutions for this . Thanks in advance .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Skalate avatar Feb 27 '20 03:02 Skalate

Hi I also have the same problem with trying to connect my arduino bluetooth using this example code. Is there any solution for this problem?

GreeceNg avatar Mar 18 '20 12:03 GreeceNg

@GreeceNg I have this problem. Some devices are not listed in this bluetooth plugin because they are different tecnologies. I had to change the plugin and now im using this: https://pub.dev/packages/blue_thermal_printer.

luissouza avatar Mar 18 '20 12:03 luissouza

Same Issue FlutterBluePlugin( 7582): mDevices size: 0

theali13 avatar Mar 22 '20 22:03 theali13

I have the same problem for me. I tried that 6 months ago with the same problem and I am surprised how little changed. @pauldemarco Hi Paul, do you have any input in this problem.

@luissouza I need basic write and read functionality with BLE. Would the package u use work fort that? Seems like this package works only for Android: https://pub.dev/packages/blue_thermal_printer.

Any alternative packages which are better maintained and work with ios would be highly appreciated. Any input?

ride4sun avatar Mar 24 '20 21:03 ride4sun

I have the same problem for me. I tried that 6 months ago with the same problem and I am surprised how little changed. @pauldemarco Hi Paul, do you have any input in this problem.

@luissouza I need basic write and read functionality with BLE. Would the package u use work fort that? Seems like this package works only for Android: https://pub.dev/packages/blue_thermal_printer.

Any alternative packages which are better maintained and work with ios would be highly appreciated. Any input?

That package didn't work for me either it, it doesn't connect

theali13 avatar Mar 24 '20 22:03 theali13

Hello, I checked some information and sorted out the following possible solutions.  1. Try programming with Object-c. Create a new empty directory and use 'flutter create -i objc my-flutter-app' to create a new project.  2. Use a lower version of the API. 'use_frameworks! platform :ios, '9.0'' If none of the above solutions can be solved, I highly recommend you to learn IOS development, Mixed development seems to be the only way

李峦 掌上理工

联系我

 

------------------ 原始邮件 ------------------ 发件人: "theali13"<[email protected]>; 发送时间: 2020年3月25日(星期三) 上午6:37 收件人: "pauldemarco/flutter_blue"<[email protected]>; 抄送: "李峦"<[email protected]>;"Mention"<[email protected]>; 主题: Re: [pauldemarco/flutter_blue] Cant find any devices while flutter blue scanning (#336)

I have the same problem for me. I tried that 6 months ago with the same problem and I am surprised how little changed. @pauldemarco Hi Paul, do you have any input in this problem.

@luissouza I need basic write and read functionality with BLE. Would the package u use work fort that? Seems like this package works only for Android: https://pub.dev/packages/blue_thermal_printer.

Any alternative packages which are better maintained and work with ios would be highly appreciated. Any input?

That package didn't work for me either it, it doesn't connect

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Skalate avatar Mar 29 '20 08:03 Skalate

Please try to use this branch. Defects got fixed on this branch which might fix ur problems. Keep track of this #145 to see if a new package get created to get better support.

use this in your yaml for now:

flutter_blue:
    git:
        url: https://github.com/boskokg/flutter_blue.git
        ref: 0.7.1

ride4sun avatar Mar 29 '20 18:03 ride4sun

I try to find the devices with de oficial example: https://github.com/pauldemarco/flutter_blue/tree/master/example

I have several devices (BLE) that should be listed, but they NEVER appear. What am i doing wrong? Please, help me!

All the devices are (BLE).

I also have the same issue. I don't know whats wrong

OmiWakode avatar Mar 30 '20 08:03 OmiWakode

Same here. I should be able to see a lot of devices around me, but all i can see is my connected SPEN (Galaxy Note10), which i actually can't see when i open my phones bluetooth settings and scan for devices...

dirkbo avatar Mar 30 '20 09:03 dirkbo

@ride4sun

Im using now esc_pos_bluetooth plugin. This plugin (esc_pos_bluetooth) cant fin my device too. I get this plugin example, and i change a bit, in the connection code, like this.

 printerManager.selectPrinter(PrinterBluetooth(
        flutterBluetoothBasic.BluetoothDevice.fromDocument(printerName, printerAddress, 0,true)));

Hope it helps!

luissouza avatar Apr 04 '20 02:04 luissouza

Hii I'm working on social distancing app I'm facing same issue couldn't get any mobile devices in scanresult

Akilesh30 avatar Aug 06 '20 15:08 Akilesh30

I Have the same problem ! When I start the scanning, the stream scanResults don't return anything... This feature is the most basic and don't work ! Any idea ?

javiervalero31 avatar Sep 04 '20 22:09 javiervalero31

@javiervalero31, i think, is not return anything because all the devices that you are looking for are not BLE, and this plugin just show BLE devices.. Look in play store for BLE app, this app shows to you if your device is BLE (Bluetooh low energy).

luissouza avatar Sep 14 '20 02:09 luissouza

I have the same problem before and all I did is turning on the location/ GPS and try to re-scan again and it works for my ESP32 BLE!

nadjwarazali avatar Sep 14 '20 11:09 nadjwarazali

I'm facing same problem too. It works on many device to connect my thermal printer. e.g. iphone, ipad, redmi, huewei p30. But it's not working for my samsung note10lite and note10+. Any idea?

NongBritee avatar Sep 18 '20 16:09 NongBritee

@nadjwarazali Thank you it worked

Detlev1 avatar Sep 26 '20 20:09 Detlev1

Had the same problem with https://github.com/lupyuen/flutter-blue-sample example (based on pauldemarco's) and as others mentioned, turning on GPS (as well as bluetooth) solved this problem. I find it odd that you need location ON in order to find bluetooth devices. Anyone knows why?

afarre avatar Oct 19 '20 14:10 afarre

Google made it a requirement for using BLE in Android. https://www.polidea.com/blog/a-curious-relationship-android-ble-and-location/

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Libre de virus. www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

El lun., 19 oct. 2020 a las 9:01, afarre ([email protected]) escribió:

Had the same problem with https://github.com/lupyuen/flutter-blue-sample example (based on pauldemarco's) and as others mentioned, turing on GPS (as well as bluetooth) solved this problem. I find it odd that you need location ON in order to find bluetooth devices. Anyone knows why?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pauldemarco/flutter_blue/issues/336#issuecomment-712177646, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVNZAGU6AN5KBMBD2ID63LSLRBDPANCNFSM4IKMZMXA .

-- Javier Alejandro Velasco

alejo9719 avatar Oct 19 '20 14:10 alejo9719

Turn on GPS it will work fine...!!!

ganeshlg avatar Oct 28 '20 05:10 ganeshlg