libserialport.dart
libserialport.dart copied to clipboard
read with timeout always is blocking
Hello, I use buffer = sp.read(1, timeout: 5000); But I can't continue when time is out of 5000
Hi, which platform?
@jpnurmi ,Android.
this is the code: try{ sp = SerialPort('/dev/ttyS3'); sp.config.baudRate = 9600; var o = sp.openReadWrite() var r = sp.read(1, timeout: 2000); sp.close(); }catch(ex){ if (sp != null && sp.isOpen) { sp.close(); } print(ex); }
I didn't connect the device to serial port. so normal, the read will be failed. but it can't continu after sp.read(1,timeout:2000) I didn't catched error.
Interesting, on Linux it throws immediately:
SerialPortError: Input/output error, errno = 5
did you tested on android?
Hello, Do you have any suggestion?
Hi, I don't have a suitable Android device to test right now, but I'll try to find time to build an Android image for Raspberry Pi for testing.
Interesting, on Linux it throws immediately:
SerialPortError: Input/output error, errno = 5
What is solution for this error in Raspberrypi?