Git Product home page Git Product logo

Comments (5)

katyo avatar katyo commented on August 19, 2024 7

I have same issue when I attempt to set SerialPortConfig on Linux:

port.config.baudRate = 9600;
No such file or directory, errno = 2

When the exception was thrown, this was the stack:
#0      Util.call (package:libserialport/src/util.dart:39:7)
#1      _SerialPortImpl.config (package:libserialport/src/port.dart:335:12)
...
var config = SerialPortConfig();
config.baudRate = 9600;
port.config = config;
No such file or directory, errno = 2

When the exception was thrown, this was the stack:
#0      Util.call (package:libserialport/src/util.dart:39:7)
#1      _SerialPortImpl.config= (package:libserialport/src/port.dart:347:10)
...

UPD: As I seen in libserialport examples, seems the config should be set after opening the port.

from flutter_libserialport.

VinayakaKS avatar VinayakaKS commented on August 19, 2024 5

Hi, I may be late to answer to this, but thinking it will help others who end up at this problem.
The port.config needs to be set only after opening the port.

  SerialPort port = SerialPort(availablePorts[widget.comPort]);

  final portconfig = SerialPortConfig();
  portconfig.baudRate = 115200;
  
  SerialPortReader reader = SerialPortReader(port, timeout: 10000);
 
  port.openReadWrite();
  port.config = portconfig;

from flutter_libserialport.

mortenboye avatar mortenboye commented on August 19, 2024 2

Thanks @katyo for sharing that discovery. Setting the config after opening the port, solve my issue also. Great!

from flutter_libserialport.

lucafabbri avatar lucafabbri commented on August 19, 2024

Thanks @VinayakaKS I'll check it further to avoid issues when config is set before opening

from flutter_libserialport.

dropik avatar dropik commented on August 19, 2024

That's weird, but it indeed works if setting config takes place after .openReadWrite(), not before.

from flutter_libserialport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.