How to read and write through a serial port with Flutter

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

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

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

    Thank you for posting this video. It was a great help. I thing i will mention that caused me some trouble. You can only set the configuration (baud rate, etc) once the port is open.

    • @ahmed-mannai
      @ahmed-mannai  Год назад

      Thank you, buddy, for the information

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

      @@ahmed-mannai You're welcome but i think i was a little premature. i've since been experiencing some trouble getting the baud rate to change. I have to open and close the port a few times, or set the port up in another serial program. I'm using macOS. Have you experienced anything like that?

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

      I am having this problem too, I need to change it to 57600 baud rate but I haven't been able to, did you find a solution for this ?@@damoshelto

  • @egrabhishek
    @egrabhishek 3 месяца назад

    Thank You for Sharing Buddy. Saved a lot of my time. Thanks Again.

  • @abdoumaiza4268
    @abdoumaiza4268 2 года назад +1

    I find this so interesting, thank you for your efforts and I hope you succeed

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

    Awesome man :) Thank you so much!

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

    Poderia citar as versões das ferramentas utilizadas, como versão do flutter, dart, lib e android. So recebo o erro de permissão negada 13

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

    Thank you so much bro.

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

    keep it up

  • @webghost2009
    @webghost2009 2 года назад +1

    Great it what I am looking for.

  • @krisd9506
    @krisd9506 3 месяца назад

    Reads bytes ok, but keep getting '0' for the written bytes.

  • @armellotaku2533
    @armellotaku2533 2 года назад +3

    Brother, if I use an arduino connected to the USB port of my laptop and send the data with SerialPrintln, the data is not sent to my Flutter application, please help me.

    • @ahmed-mannai
      @ahmed-mannai  2 года назад +1

      Email me we will fix the problem

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

      pro, do you find a solution of your problem?

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

      if you have i want to talk with you, give me your email please

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

    getting this error ''Unhandled Exception: SerialPortError: The operation completed successfully., errno = 0 ''

    • @ahmed-mannai
      @ahmed-mannai  Год назад

      This error is thrown when you have written and things went successfully i guess

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

      @@ahmed-mannai SerialPortReader reader = SerialPortReader(port1);
      Stream upcommingData = reader.stream.map((data) {
      return String.fromCharCodes(data);
      });
      upcommingData.listen((data) {
      print("read data $data");
      });
      it doesnt print anything...any idea?

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

      any solution for this?

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

    Is there anything special that needs to be done when sending/receiving ASCII versus pure binary/hex?
    Any tips on making the application responsive, even as it is waiting for data from a serial device?
    For example, I'd like to send a command to a multimeter to get the voltage, but because it often takes a few hundred milliseconds before it returns the data.
    And could the same code be built for an (Android) device, which uses the classic Bluetooth SPP (Serial Port Profile) to talk to a computer with a Bluetooth USB dongle (also running SPP)?

    • @ahmed-mannai
      @ahmed-mannai  Год назад

      My next video will showcase how to make a responsive app and how to listen constantly to upcoming data.
      - The app should work fine on android also because the package supports android
      - when it comes to using hex over asci mainly because Hex uses less memory and that makes input and outputs operations perform faster

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

    hi i need some help, i have a balance and i need get weight from her, but when i put upcoming.listen((data){
    print(data)}
    nothing is printed

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

    I want to connect a tablet to a weighter via a COM-USB connection in the usb port of the tablet. Is it possible to accomplish this using this package?

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

    grateful my friend 👍

  • @NF_160
    @NF_160 3 месяца назад

    i am using android device latest version, i tried with Linux, it read and write perfectly. but when i run it in android said: SerialPortError: Permission denied, errno = 13 , i tried to give all permission in my androidManifest but no solution. also, give my android device primitive to accept all permission but still same issue. i tried using a chip using Arduino and it send messages but in my android device is note working!
    pls help

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

    How to set the baudrate of serial port, I can't see it

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

    how can we use this package to send Hex data through USB port on an Android device?

    • @ahmed-mannai
      @ahmed-mannai  10 месяцев назад

      Do you mean send data from PC to Android? Then yes you can

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

    Is it possible to communicate with Bluetooth and Wi-Fi ?

    • @ahmed-mannai
      @ahmed-mannai  10 месяцев назад

      Tbh I don't know
      I haven't tried it

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

    Hello, I have an interesting task, the program works on both Linux and Mac but does not work on Windows, there are no error messages, but I just need to run the ArduinoIDE and run any command in the serial port, my program works until the first restart of the computer, we met Are you in this situation and do you have half an hour to solve it

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

    Hey man, I'm currently writing a program where I ask for the status of a printer connected through the serial port by sending some hex codes and then I send the info so I can print it.
    And everything's good but I want to ask the printer its status AGAIN after I print the data, and I can't seem to get it to work, do you know how I can use the reader to listen to another message after my listener already listened to 1 message? Thanks in advance.

  • @sidahmedaboura5927
    @sidahmedaboura5927 2 года назад +1

    i have this error if you have a solution
    The following SerialPortError was thrown building Builder:
    Permission denied, errno = 13

    • @ahmed-mannai
      @ahmed-mannai  Год назад

      I cannot see what cause the problem.
      but you can check for solutions to solving the permission denied problem here
      🔗LINK: github.com/jpnurmi/libserialport.dart/issues/3

  • @aagamshah4216
    @aagamshah4216 2 года назад +1

    Im trying this on android device, its throwing this error
    SerialPortError: Permission denied, errno = 13
    Any ideas how to solve this?

    • @ahmed-mannai
      @ahmed-mannai  2 года назад

      Take a look at this github.com/jpnurmi/libserialport.dart/issues/3 this Issues is open for now I think soon it will be fixed

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

    can i use this and see the data on the docklight when flutter app running?

    • @ahmed-mannai
      @ahmed-mannai  2 месяца назад

      I dont understand exactly your case
      But I suppose yeah you can

  • @mouazfmb
    @mouazfmb 11 месяцев назад

    I am encountering an error related to a permission whenever I use any serial port library with flutter, the error is like:
    SerialPortError: Permission denied, errno = 13
    can you help me, I just want to build the same app that you have built and run it using the mobil's serial port ( USB port).

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

      I'm getting the same error. Did you find a solution?

  • @kausikmr
    @kausikmr 2 года назад +1

    flutter_libserialport throws error in mac

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

    hey there , how I can read entire serial line in this flutter libserial_port ??

    • @ahmed-mannai
      @ahmed-mannai  2 месяца назад

      Yes I think thats a bit of a challenge
      You need to stay listening for upcoming data and save them in a buffer then print the line if you encounter "
      " new line character

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

    its run on androind?

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

    Can I use this package for communicating with RS232?

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

      very interesting question, I need to implemet it as well.

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

    I not get any available port

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

    i am getting permission denied error 13

  • @hunganhtang467
    @hunganhtang467 2 года назад +1

    im not using this video on macos application

    • @ahmed-mannai
      @ahmed-mannai  2 года назад

      You can use this for building a mac os app because the flutter_libserialport package works on macOS, Windows, Linux, and Android devices.

    • @hunganhtang467
      @hunganhtang467 2 года назад

      @@ahmed-mannai I have fixed the error. Turns out I didn't install automake libtool

    • @hunganhtang467
      @hunganhtang467 2 года назад

      but when read data i get error
      [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: SerialPortError: Undefined error: 0, errno = 0

    • @ahmed-mannai
      @ahmed-mannai  2 года назад

      Try closing the port after using it
      I think that will fix it

  • @botmatth9816
    @botmatth9816 3 месяца назад

    Work for android build ?

    • @ahmed-mannai
      @ahmed-mannai  2 месяца назад

      Yes I havent tried it but it supposed to work on android also