Bluetooth Low Energy (BLE) In Flutter - BLE SCANNER

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии •

  • @gustavoalfonsorestrepomeji245
    @gustavoalfonsorestrepomeji245 11 месяцев назад +1

    Excellent work, we are waiting for you to create the video where it connects, sends data and also receives data. I am working on a project with an Arduino Mega and an HM-10 Bluetooth BLE module and this video and the following are very helpful to me. Thank you very much and blessings to your entire family.

    • @Grace-yc7ud
      @Grace-yc7ud 11 месяцев назад

      Agreed, really want to see a video on connecting and sending/receiving data!

  • @mehmetsinantatar1509
    @mehmetsinantatar1509 8 месяцев назад +1

    We would be very grateful if you could make a video about flutter_blue_plus this week. After adding the get package, I cannot import it. The same pattern applies to the flutter_blue package.

  • @pravinprince3221
    @pravinprince3221 Год назад +2

    Thank you for the wonderful video sir it is very useful for me and my team

    • @ProtoCodersPoint
      @ProtoCodersPoint  Год назад +1

      Welcome 🤗, if you want tutorial on any topic comment down 😁

  • @robertgao8866
    @robertgao8866 9 месяцев назад +2

    Sir, I was trying to follow your youtube to tryout the BLE coding in flutter! I have running into some issues please help: 1. both flutter_blue and flutter_blue_plus should work? I noticed there are some discrepancies in the code snippets on your website, not sure, which one that I should follow; 2. If I am using the flutter_blue_plus package, I got build error, complaining to this line of code in main.dart : "FlutterBluePlus flutterBlue = FlutterBluePlus.instance;" the msg reads: "This expression has a type of 'void' so its value can't be used.
    Try checking to see if you're using the correct API; there might be a function or call that returns void you didn't expect. Also check type parameters and variables which might also be void." Please help..., Thanks...

  • @ua9lif
    @ua9lif Год назад +3

    Thank you, waiting a video on how to connect to bluetooth

    • @ProtoCodersPoint
      @ProtoCodersPoint  Год назад

      glad to hear it was helpful for you, will upload the next video as soon as possible

  • @kirtishbarmecha9072
    @kirtishbarmecha9072 10 месяцев назад

    Would like to see connect to a ble peripheral and read data in to a service and characteristics.
    And My main hard stop for now is how I can keep the connection active and keep receiving data in the app.

  • @thaytung-daylaixe5930
    @thaytung-daylaixe5930 Год назад +1

    How to transfer text or data, after connected multi device, can you help me ?

  • @mustafayildirim4087
    @mustafayildirim4087 11 месяцев назад +3

    not working scan results is empty

  • @deepanshualuria8081
    @deepanshualuria8081 8 месяцев назад +2

    It is not workin in my case plus you didn't show complete library of your main.dart in video and the website has two code and sinnepts which is not like how professionals make videos for beginners.

    • @ProtoCodersPoint
      @ProtoCodersPoint  8 месяцев назад

      The complete source code is given in my website
      Can you tell you exactly what issue you are facing ( show the error log )

    • @deepanshualuria8081
      @deepanshualuria8081 8 месяцев назад +3

      @@ProtoCodersPoint
      import 'package:flutter_ble/ble_controller.dart is the first error it says flutter_ble is not compatible with dart 3.0.0 or above it tried to reduce the environment also but that didn't work.
      Second you have two procedure of your website one using flutter_blue_plus and other is flutter_blue
      . Flutter_blue have complete source code ( which didn't work for me ) second have not complete source code which i can copy paste and see the results to be honest i didn't use flutter_blue before so don't know how to follow those snippets and source code has the error i mentioned.

  • @tusharpatel764
    @tusharpatel764 Год назад +1

    how fetch the services and characteristics data from BLE and show to mobile screen ??
    please make video for this.

  • @harishpenta9876
    @harishpenta9876 7 месяцев назад +1

    will this work for ios app as well?

  • @justEngineeringThings
    @justEngineeringThings 11 месяцев назад +1

    Instance feature is deprecated error showing,what i should do now

  • @yuen3771
    @yuen3771 Год назад

    i have donbe the same exact code in flutter in android Studio Interface but I'm facing Bluetooth privilege issues since it doesn't allow for third-party apps. Any recommendations?

  • @mserif
    @mserif Год назад

    hi sir.When will you upload connect and data sharing part

  • @faheemahmad5853
    @faheemahmad5853 5 месяцев назад +1

    can we show the names of the devices??? also CONNECT them... to get thier mac adfress etc

  • @faizi2895
    @faizi2895 9 месяцев назад

    How to do ota update over ble in flutter

  • @AryanBarewar
    @AryanBarewar 5 месяцев назад

    how to connect specific ble device . Please make a video

  • @lokeshpuri3821
    @lokeshpuri3821 4 месяца назад

    All the bluetooth devices are discovering, but ESP32 BLE device is not showing what can i do??

    • @meliherdogan
      @meliherdogan 4 месяца назад

      hello my friend, you're luckier than me, your some devices are discovered at least. I can't discover any devices around me. Could you plz send me your flutter project to compare with myself? Maybe I couldn't see some points in this video.

  • @carbonneauolivier6000
    @carbonneauolivier6000 8 месяцев назад

    i copied the code you provided. the app is working but when i click scan, no bluetooth devices is shown. Permission has been added and all... ? any idea ?

    • @ProtoCodersPoint
      @ProtoCodersPoint  8 месяцев назад +1

      This video is for BLE devices not to scab normal Bluetooth devices like earphone, laptop or any other
      This will just show the BLE DEVICES

    • @carbonneauolivier6000
      @carbonneauolivier6000 7 месяцев назад

      @@ProtoCodersPoint thanks, i will redo it with a ble devices. what would you suggest to use if i want to work with claissic bluetooth ?

  • @purplemoon1741
    @purplemoon1741 Год назад

    The code that you gave in the web site is not working.

  • @24.nguyenvanthanh37
    @24.nguyenvanthanh37 5 месяцев назад

    Pub failed to delete entry because it was in use by another process.
    This may be caused by a virus scanner or having a file
    in the directory open in another application. When running the yaml file, it looks like this, please tell me how to fix it

    • @DanielMoreno-lc9bx
      @DanielMoreno-lc9bx 5 месяцев назад +1

      Once you push enter, it will install the package Flutter_blue, but it will keep giving you that warning, but the App should run, if not, try to restart your pc.

    • @bhavadharani609
      @bhavadharani609 2 месяца назад

      Hey hi!! I don't know whether you have resolved the issue or not. But this problem can be solved by running your android studio or visual studio as administrator. Hope it helps someone✨

  • @SachinBansal-n1i
    @SachinBansal-n1i 9 месяцев назад

    how to connect to a bluetooth low energy

  • @supersaiyan2344
    @supersaiyan2344 Год назад

    But isn't flutter blue deprecated? When i try to run app it gives a warning of it using deprecated API

    • @ProtoCodersPoint
      @ProtoCodersPoint  Год назад

      In place of flutter_blue
      You can use flutter_blue_plus
      The code syntax will be same…

    • @supersaiyan2344
      @supersaiyan2344 Год назад

      @@ProtoCodersPoint hi, I tried the code as you suggested but it is not showing me any nearby devices, I debugged everything the scanner is starting properly and everything is fine but not devices are being shown, can you please help me? (Also I wanted to know does flutter blue plus show classic devices as well as ble devices?)
      Here is my code (it is one page only) to scan and list the nearby devices.
      /// Code starts
      code for the screen:
      import 'dart:developer';
      import 'package:flutter/material.dart';
      import 'package:flutter_blue/flutter_blue.dart';
      import 'package:lottery/widgets/snackbar_widget.dart';
      import 'package:permission_handler/permission_handler.dart';
      class FBPlusScreen extends StatefulWidget {
      const FBPlusScreen({super.key});
      @override
      State createState() => _FBPlusScreenState();
      }
      class _FBPlusScreenState extends State {
      FlutterBlue flutterBlue = FlutterBlue.instance;
      Future scanDevices() async {
      var blePermission = await Permission.bluetooth.status;
      var bleConperm = await Permission.bluetoothConnect.status;
      var bleScanperm = await Permission.bluetoothScan.status;
      log("bluetooth status: $blePermission, bluetooth connect status: $bleConperm, scanning permission: $bleScanperm");
      showCustomSnackbar(context, "Success",
      "bluetooth status: $blePermission, bluetooth connect status: $bleConperm, scanning permission: $bleScanperm");
      if (blePermission.isDenied) {
      log("in req permission case");
      if (await Permission.bluetoothScan.request().isGranted) {
      if (await Permission.bluetoothConnect.request().isGranted) {
      flutterBlue.startScan();
      await Future.delayed(const Duration(seconds: 10));
      flutterBlue.stopScan();
      }
      }
      } else {
      // if permissions are granted
      log("in granted permission case");
      flutterBlue.startScan();
      await Future.delayed(const Duration(seconds: 10));
      flutterBlue.stopScan();
      showCustomSnackbar(context, "Success", "${getScanResults.toString()}");
      }
      }
      Stream get getScanResults => flutterBlue.scanResults;
      @override
      Widget build(BuildContext context) {
      return Scaffold(
      appBar: AppBar(
      title: const Text("BLE eg"),
      ),
      body: Center(
      child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
      const SizedBox(
      height: 15,
      ),
      StreamBuilder(
      stream: getScanResults,
      builder: (context, snapshot) {
      if (snapshot.hasData) {
      // Access the scan results from the snapshot.data
      List scanResults = snapshot.data!;
      return ListView.builder(
      shrinkWrap: true,
      itemCount: scanResults.length,
      itemBuilder: (context, index) {
      final data = scanResults[index];
      return Card(
      elevation: 2,
      child: ListTile(
      title: Text(data.device.name),
      subtitle: Text(data.device.id.id),
      trailing: Text(data.rssi.toString()),
      ),
      );
      },
      );
      } else {
      return const Center(
      child: Text("No Device Found"),
      );
      }
      }),
      ElevatedButton(
      onPressed: () => scanDevices(), child: const Text("Scan")),
      const SizedBox(
      height: 15,
      ),
      ],
      ),
      ),
      );
      }
      }
      ///Code ends
      ///Logs start
      Main error here it shows could not find callback wrapper
      logs:
      D/EGL_emulation( 6763): app_time_stats: avg=115.66ms min=5.03ms max=1708.82ms count=18
      [log] bluetooth status: PermissionStatus.granted, bluetooth connect status: PermissionStatus.granted, scanning permission: PermissionStatus.granted
      D/BluetoothAdapter( 6763): isLeEnabled(): ON
      [log] in granted permission case
      2
      [log] Scan results received: []
      D/BluetoothLeScanner( 6763): onScannerRegistered() - status=0 scannerId=4 mScannerId=0
      3
      [log] Scan results received: []
      D/EGL_emulation( 6763): app_time_stats: avg=96.04ms min=7.35ms max=1922.53ms count=26
      2
      D/BluetoothAdapter( 6763): isLeEnabled(): ON
      D/BluetoothLeScanner( 6763): could not find callback wrapper
      D/EGL_emulation( 6763): app_time_stats: avg=510.39ms min=4.62ms max=7495.73ms count=15
      ///Logs end

  • @manohar.acharya
    @manohar.acharya Год назад +1

    yes sir please make a video on how to connect to bluetooth

  • @pedrodiaaz
    @pedrodiaaz Год назад

    The available devices do not appear :( Help meee pls

  • @talhashoaib8171
    @talhashoaib8171 Месяц назад

    Getting namespace error while using this library

    • @ProtoCodersPoint
      @ProtoCodersPoint  Месяц назад +1

      Share the error on my email
      Let me check

    • @talhashoaib8171
      @talhashoaib8171 Месяц назад

      @@ProtoCodersPoint and your email?

    • @talhashoaib8171
      @talhashoaib8171 Месяц назад

      @@ProtoCodersPoint how can i get you email

    • @timo-vincenttenhagen3282
      @timo-vincenttenhagen3282 15 дней назад

      I've got the same error, did you find a solution?

    • @talhashoaib8171
      @talhashoaib8171 15 дней назад

      @@timo-vincenttenhagen3282 open build.gradle file of library and add namespace

  •  9 месяцев назад

    its not working

    • @ProtoCodersPoint
      @ProtoCodersPoint  9 месяцев назад

      Have you added the Bluetooth permission in androidManifest.xml file ?