flutter_libserialport icon indicating copy to clipboard operation
flutter_libserialport copied to clipboard

Example or tutorial needed

Open dariocavada opened this issue 4 years ago • 3 comments

First of all thank you for this package.

Would like to know if it's possible to have an example for reading data from a serial port using flutter.

My goal is to use the serial port on an Android Set Top Box (N1 Max) capable of reading data from Arduino.

dariocavada avatar Jan 02 '21 17:01 dariocavada

Yes, you are absolutely right that there should be better examples. Do you have a suggestion for what the examples could read and write? The typical problem with serial port examples - should one assume dummy echoes, a certain protocol, or something else? :) Anyway, one option could be to adapt/port the dummy examples from libserialport.

jpnurmi avatar Jan 05 '21 16:01 jpnurmi

This is a Flutter component, so some example with widgets and business logic would be very useful:

A typical read and write from/to Arduino for exampe... And eventually a complete example (in the example folder) that shows how:

  1. Configure the port (velocity, parity, ...)
  2. Select the port from a dropdown
  3. A button to connect
  4. If success start to listen to the serial port, if you receive a string show the string in a list
  5. If error, shows an error (and eventually retry to connect after a while)
  6. a text field + a button to send a string to Arduino

dariocavada avatar Jan 15 '21 09:01 dariocavada

@dariocavada You could see this site for more examples. It is same. https://pub.dev/packages/dart_serial_port

rty813 avatar Feb 03 '21 03:02 rty813