jpnurmi / libserialport.dart

Serial Port for Dart
https://pub.dev/packages/libserialport
GNU Lesser General Public License v3.0
86 stars 34 forks source link

data is not transfering #47

Closed chaitanya-mandala closed 2 years ago

chaitanya-mandala commented 2 years ago
    if (_port.productId == 8963 && _port.vendorId == 1659) {
        if (_port.openReadWrite()) {
          setState(() {
            isReceiverConnected = true;
          });
          _port.config.baudRate = 115200;
          _port.config.bits = 8;
          _port.config.parity = 0;
          _port.config.stopBits = 1;
          _port.config.dtr = 0;
          _port.config.rts = 0;
          _port.config.cts = 0;
          _port.config.dsr = 0;

} } _port.flush(); if (_port.isOpen) { _port.write(Uint8List .fromList("1\r\n" .codeUnits)); }

Serial port is opened without any error but data was not transfering.

workarounds: closed the port in flutter and once opened and closed the port in arduino serial monitior and then again opened the port with above same code in flutter its working.. everytime i need to open and close the arduino serial monitor to make it work in flutter.. any idea about this issue.

chaitanya-mandala commented 2 years ago

sloved: used this library https://pub.dev/packages/serial_port_win32 to open and close the port once before opening the port with libserialport library.. now its working fine.