Android Question Rs232 access denied to /dev/ttyAMA1

Lello1964

Well-Known Member
Licensed User
Longtime User
I have an industrial Tablet with RS232 BUILT-IN

I must read data from RS232 : /dev/ttyAMA1 using

B4X:
    Dim sout As OutputStream ' serial out stream
    Dim sinp As InputStream ' serial in stream
    StdOut.Initialize ' initialize string builder for StdOut
    StdErr.Initialize ' initialize string builder for StdErr
    sinp = File.OpenInput("","/dev/ttyAMA1") ' open serial input
    sout = File.OpenOutput("","/dev/ttyAMA2",True) ' open serial output

when i try to open i have this message :

java.io.FileNotFoundException: /dev/ttyAMA1: open failed: EACCES (Permission denied)

I think havn't permissions to access to /dev/ttyAMA1 and root permission

Android Ver. 5.1.1

Any solution ?

Thanks

Raffaele Viglione
 

Peter Simpson

Expert
Licensed User
Longtime User
there is a solution ?

I believe that you need WRITE_EXTERNAL_STORAGE permission. So you need to use RuntimePermissions.GetSafeDirDefaultExternal("")

Just search the forum for it...
 
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
there is a solution ?
you would probably need to make your app a so-called "system app". not trivial. you can try researching here, but you'll probably end up at the big G
 
Upvote 0
Top