-
Notifications
You must be signed in to change notification settings - Fork 140
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
Drivers not detected due to permission error in android 11? #20
Comments
Right, cannot open /dev/tty: Permission denied. As mentioned above, #FAQ This library does not provide ROOT permissions, please open the serial port '666' permissions yourself. I think it's because you have broken permissions for that device file. See which UARTs are detected in # cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:0 rx:0
1: uart:16550A port:000002F8 irq:3 tx:111780 rx:1321 RTS|DTR|DSR
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3 If something is connected and driving the CTS, DSR or CD lines (those are input lines), you can even be sure that something is there... same goes for rx-byte-count. There is also a command # setserial -g /dev/ttyS[0123]
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 You can confirm that this device file is accessible like this. crw-rw-rw- system system 4, 64 1970-01-01 08:00 ttyS0
crw-rw-rw- system system 4, 65 1970-01-01 08:00 ttyS1 |
Hi @xmaihh The same reference code is tested in a device having Android 7 and the device is not rooted. The device is logging the detected drivers as below:-
The detection of drivers is done in the older version of Android (7.0 – Nougat) but not detecting the drivers in Android 11 which we need to do. Detection of the driver is possible only till Android SDK version 25 (Android version 7 - Nougat). After Android SDK version 26 (Android version 8.0 - Oreo), it’s not working and generating the permission denied error. I also tried the commands by making the app a system app, but I still, have the same permission issue in Android 11. Are there any known issues with Android 11? |
Thank you for sharing @NikhilUsadadiya, I didn't find the proper solution yet, I didn't test in Android 11 environment now. On an Android 11 device your app only has access to its own files and to general mediafies in public directories. You have options to read the file. Request Regards, X. |
Yes, @xmaihh, I have added the request permission in the manifest file also and tried to change the permission and detection of drivers in android 11, but fails to do so. Also, the Request MANAGE_EXTERNAL_STORAGE in the manifest will only allow the user to access the public directories right. It will not allow access or change the value in the root directories right? |
@NikhilUsadadiya I'm facing the same issue. Did you solve it? |
请问下,这个有啥简单的解决方法不? |
Hi,
First of all thanks for this library reference to understand the Android UART. Actually facing an issue with this is whenever I run the app then it wasn't able to read the drivers.
Exception:- java.io.FileNotFoundException: /proc/tty/drivers: open failed: EACCES (Permission denied)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
I am using this in the rooted device. Can you please help with some guidance for this? Thanks @xmaihh
The text was updated successfully, but these errors were encountered: