Android Question Serialport permission

meggyi

New Member
Licensed User
Longtime User
Hi all, I need to give permission in B4A for a serialport on ODROID C2.
From a terminal this process is easy:

su
cd /
cd dev
chmod 777 ttyS1

but I can't find solution in B4A. I tried it several ways (b4aRootCmd, SuCommand, etc.) with no success. Can anyone helps?
 

meggyi

New Member
Licensed User
Longtime User
Thank you Erel for the answer. I have tried Phone.Shell earlier but unfortunately not working. If I enable serialport from Terminal Emulator with script above, my code - and any other that use this port - working well. It seems can't change permission from my code. I know should use USB to serial converter easier but I want to use the built-in serialport of ODROID instead. Is another solution or need to give up?
 
Upvote 0

meggyi

New Member
Licensed User
Longtime User
I noticed that my app has no Superuser access. I put the line "android.permission.ACCESS_SUPERUSER" to the manifest and works perfect with this line:

rc.execRootCmd("chmod 777 /dev/ttyS1")

I use the UART library by Rui Cardoso. Thank you Erel and Rui, I hope it helps others at same problem.
 
Upvote 0
Top