Open schigabiga opened 1 year ago
For listing the serial ports, read access to /sys/dev/char
is required. You can try running chmod ugo+r /sys/dev/char
as the root user to grant everyone access to that folder. Though that may be a security problem. There's probably a reason why android doesn't grant the permission by default.
If you know the path of the serial port device, you can also try creating the serial port directly:
final port = SerialPort('/dev/ttyUSB0', 0, 0, '');
To read & write the serial port, you also need read&write access to the device node, so (in the example above) read & write permissions to /dev/ttyUSB0
Hello! I started to use https://pub.dev/packages/linux_serial this package, but after I run on Android 11 mobile and called the below function I got an error.
final ports = SerialPorts.ports; print(ports);
Error:
Directory listing failed, path = '/sys/dev/char/' (OS Error: Permission denied, errno = 13)
Stack:
I got the same error, when I used these packages: https://pub.dev/packages/libserialport , https://pub.dev/packages/flutter_libserialport
What kind of permission should I grant? Thank you in advance!
Flutter version: