How to Write to Serial Port with Flutter and Dart

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

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

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

    I get error "SerialPortError: Device or resource busy, errno = 16" when hot reload

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

    Thanks for the video. If possible, can you please make a video on how to receive data as well.

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

      I will ping you in this comment when that video releases :)

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

      @@Chipsee Thank you

    • @Chipsee
      @Chipsee  10 месяцев назад +1

      Here it is! ruclips.net/video/VQrIEv66WFE/видео.html, I hope you find it useful.

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

      @@Chipsee Thanks a lot. Super useful

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

    Upload video for read port data also, i have 4 port for read and transmit the data at same time.

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

      It's out, here you go: ruclips.net/video/VQrIEv66WFE/видео.html.
      4 ports? You can have as many ports as you need, just change to `final port_2 = SerialPort('/dev/ttyS5')` or whatever your port name is in the OS.

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

      I want to transmit the data and read the data in same machine so i joined the transmit pin and read pin after this below errors
      denied { getattr } for path="/dev/ttysWK3" dev="tmpfs" ino=6666 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:device:s0 tclass=chr_file permissive=1
      denied { read write }
      denied { open }
      if the app closed while the port is open and you open again so the error we get is resource is busy - temp solution is restart the device@@Chipsee

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

      I've seen this issue happen multiple times! "Resource is busy". Later I found a way to solve this is to add some delay before init the port.
      For example, in initState(), you _initPort(), but instead of _initPort() immediately, you add a timer of 500ms delay: timer = Timer(const Duration(milliseconds: 500), () => _initPort());
      And when the widget is deactivate(), you @overried the deactivate(), and add
      @override
      void deactivate() {
      port.close();
      port.dispose();
      timer.cancel();
      super.deactivate();
      }
      You can try these and see if it helps. Take a look at the github repo, I open sourced it.

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

      Repo: github.com/printfinn/chipsee_serial_port_flutter

  • @cristianvelez-g4l
    @cristianvelez-g4l 10 месяцев назад

    Hello, Using the git code, I get this error.
    No such file or directory, errno = 2
    Thank u

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

      Did you change the port to your port?
      On the Chipsee RS485_4, it's /dev/ttyS4.
      Did you change this to your port? For example /dev/ttyAMA0? Or /dev/ttyUSB0 etc?

  • @Hariharan-t3y
    @Hariharan-t3y 10 месяцев назад

    Execution failed for task ':flutter_libserialport:buildCMakeDebug[arm64-v8a]'.

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

      Check this github.com/jpnurmi/flutter_libserialport/issues/81. Or check my source code: github.com/printfinn/chipsee_serial_port_flutter

  • @Hariharan-t3y
    @Hariharan-t3y 10 месяцев назад

    Permission denied, errno = 13

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

      I don't remember I encountered anything like this while developing. What device are you using? Are you using a Chipsee Android panel PC?

    • @ЕвгенийКадышев-ж6я
      @ЕвгенийКадышев-ж6я 10 месяцев назад

      I also get this error, I tried to connect the arduino to android.

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

      Can you try my source code on your device and see if it happens? github.com/printfinn/chipsee_serial_port_flutter

    • @robologautomation1801
      @robologautomation1801 6 месяцев назад

      got same error please support

    • @robologautomation1801
      @robologautomation1801 6 месяцев назад

      @@Chipsee got the same error, used your source code but not working