I have written a kivy app for Android that used WiFi to send and receive data through the USB-C port of the device. Using glob.glob('/dev/tty*')
, I am able to list the available ports (I think) but trying:
serial.Serial(<port_name>)
fails with the error:
serial.serialutil.SerialException: [Errno 13] could not open port <port_name>: [Errno 13] Permission denied: '<port_name>'
I expect I need to manually add the permission somehow (similar to ACCESS_NETWORK_STATE
), but so far I have not been able to figure out the correct way to do this.
I have tried to manually add the permission through the buildozer.spec file
. I am not sure that the permission to do this directly exists. If it does I was unable to find one that worked.
I tried the solution posted here: How to find USB devices and communicate with them using pySerial in Android?
But I was unable to get it to work. This could definitely be due to me being borderline useless at Java, though.
What is the correct way to do this?