Android Question Struggle with UART

Blueforcer

Well-Known Member
Licensed User
Longtime User
I hava a Android 9 industrial HMI.
i need to write/read the /dev/ttyS3 serialport
The HMI is rooted.

via ADB i can send data, the receiving LED is blinking, so the port is working
B4X:
adb shell 'echo -ne "\x00\x11\x30\x20\x61\x0d" > /dev/ttyS3'

but cant Write/read with my B4A applicaiton:

B4X:
Dim su As SuShell
su.Execute("chmod 777 " & port)
su.Execute("stty -F " & port &" " & baud)

Dim sinp As InputStream = File.OpenInput(port,"")
Dim sout As OutputStream = File.OpenOutput(port,"", True)

Dim AStream As AsyncStreams
AStream.Initialize(sinp, sout, "astream")
 
Dim data() As Byte = Array As Byte(0x00, 0x11, 0x30, 0x20, 0x61, 0x0d)
AStream.Write(data)


i also tried the UART and the SerialLibJab libary, but with these i always get the error
B4X:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/de.dinotec.netplus-gR5Z90JQpkg1sa46p8paWw==/base.apk"],nativeLibraryDirectories=[/data/app/de.dinotec.netplus-gR5Z90JQpkg1sa46p8paWw==/lib/arm, /data/app/de.dinotec.netplus-gR5Z90JQpkg1sa46p8paWw==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libUART.so"
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
it doesn´t have a libUART.so file for your devices architecture inside i guess.

Ask the author to create a new release implementing your devices arch too.

I just renamed the folder from lib\armeabi to lib\armeabi-v7a and now its working
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…