Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unhandled Exception: PlatformException(UsbSerialPortAdapter, Not an Serial device., null, null) #372

Open
chituanh opened this issue Jun 26, 2024 · 1 comment

Comments

@chituanh
Copy link

I can connect this device on windows but it gives me this error when I connect to android

[UsbDevice: /dev/bus/usb/002/003, 1ac2-f DESKO USB DEVICE, DESKO GmbH 00000017]

Unhandled Exception: PlatformException(UsbSerialPortAdapter, Not an Serial device., null, null)

Future.delayed(Duration.zero, () async {
List devices = await UsbSerial.listDevices();

  print(devices);
  final port = await devices.first.create();
  await port?.setDTR(true);
  await port?.setRTS(true);
  port?.setPortParameters(9600, UsbPort.DATABITS_8, UsbPort.STOPBITS_1, UsbPort.PARITY_NONE);
  port?.setFlowControl(UsbPort.FLOW_CONTROL_OFF);

  await port?.open();
  port?.inputStream?.listen((event) {
    print(event);
  });
});
@chituanh
Copy link
Author

I want to receive data from a qr code scanning device but it displays the same error code. I don't know if it's due to the device or the way I installed it

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant