Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[linux] Example - SerialPortError 22 then 2 #81

Open
jwinarske opened this issue Oct 24, 2023 · 2 comments
Open

[linux] Example - SerialPortError 22 then 2 #81

jwinarske opened this issue Oct 24, 2023 · 2 comments

Comments

@jwinarske
Copy link

Running example on Linux (Fedora 38) I am seeing:

SerialPortError: Invalid argument, errno = 22
See also: https://flutter.dev/docs/testings/errors

I get two drop down combo boxes that do list valid serial ports.

Hit refresh button, and I see:

SerialPortError: No such file or directory, errno = 2
See also: https://flutter.dev/docs/testing/errors

VM output:

Another exception was thrown: The Scrollbar's ScrollController has no
ScrollPosition attached.
Another exception was thrown: The Scrollbar's ScrollController has no
ScrollPosition attached.
Another exception was thrown: SerialPortError: No such file or directory, errno
= 2
Another exception was thrown: The Scrollbar's ScrollController has no
ScrollPosition attached.

Running C test code on the same machine listing ports works without error:

$ ./test
Found port: '/dev/ttyUSB3'
Found port: '/dev/ttyUSB1'
Found port: '/dev/ttyS0'
Found port: '/dev/ttyACM0'
Found port: '/dev/ttyUSB2'
Found port: '/dev/ttyUSB0'
Found port: '/dev/ttyACM1'

Opening port '/dev/ttyUSB2' 
Bytes waiting 1
�
@jwinarske
Copy link
Author

It's having an issue with /dev/ttyS0

@rohit-arctano
Copy link

rohit-arctano commented May 10, 2024

final port = SerialPort(address);
port.openReadWrite();
port.config = SerialPortConfig()
..baudRate = 115200
..bits = 8
..stopBits = 1
..parity = SerialPortParity.none
..setFlowControl(SerialPortFlowControl.none);
SerialPortReader reader =SerialPortReader(port, timeout: 10000);
reader.stream.listen((data) {
print(
'received data: ${String.fromCharCodes(data)}');
});
Reference link:(jpnurmi/flutter_libserialport#29 (comment))
This is working fine for me i have tested on raspberry pi and linux mint correctly without any error.I have also faced same error.

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

No branches or pull requests

2 participants