Android Question Accessing built-in serial port (not via Bluetooth)

Didier9

Well-Known Member
Licensed User
Longtime User
This will be an odd question...
I bought (from China of course) a nice little 7" tablet advertised as a "in-wall background music player". The tablet is equipped with built-in 20Wx4 audio amplifiers, an RS-485 serial port, HDMI and Ethernet connectors. It has a built-in AC input power supply and no battery. It is clearly intended to be installed permanently in the wall (it comes with an enclosure that looks like an overgrown light switch box intended to be nailed to the in-wall studs and where the tablet conveniently locks in). The tablet has two rows of screw terminals on the back for speakers, audio input and output and the RS-485.
Audio sounds great through outside speakers (no built-in speakers but there is a microphone), the display is IPS and the finish is better than much of the cheap Chinese stuff you can find so it has a lot going for it. The processor is a little slow, not helped with the 1GB of RAM. I am considering using it as the hub for my home control system.

It runs Android (I think 7 but it's hard to tell) but does not have any of the usual Android Settings page. It is a very customized version of the OS. The first problem is, it has a proprietary launcher and it does not have the standard Android Settings app, it has a very limited settings page where I can only configure the WiFi. Even though it is advertised as unlocked and rooted, there is no way to run the debugger on it, or I have not found how.

I have been able to sideload my B4A apps via the web browser, and they seem to be running normally. They open and run over TCP sockets.

I would like to access the RS-485 port (my house is wired with RS-485 cables running a bunch of home control stuff) and I was wondering if anyone has a suggestion to access it, assuming there is a "generic" way of doing it with Android.

Any suggestion appreciated.
 

Didier9

Well-Known Member
Licensed User
Longtime User
I have found a Google sample app that at least lets you find out which serial ports are installed on the machine. I was able to install it via adb (getting adb running on that machine was an experience by itself but I eventually got it done...)
I was able to find that my tablet reports 7 serial devices. 5 are not accessible (permissions):
ttyGS0, ttyGS1, ttyGS2, ttyGS3 and ttyFIQ0
I have no idea what they may be used for.

However, 2 devices are accessible: ttyS0 and ttyS1

I was able to open ttyS0 and ttyS1 from my app and the tablet does receive data (sent from the PC) at port ttyS0 but does not transmit through ttyS1 (or ttyS0).
I have found (but cannot locate the link at the moment) that it is an SELinux issue that disables writes by default. I have not been able to find out how to permanently enable that. I do not get any error when opening the ports and requesting permission though.
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
For the sake of completeness, because it may be useful to others, here is how I was able to access a number of system settings.
I installed an app called "ShortCutter" which I had to sideload.
With that, I was able to turn adb and developer options on, so now I can install and debug B4A apps through the USB cable.
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
The particular model I bought is no longer available but there are similar models on AliBaba if you search for "7 inch background music player"
 
Upvote 0
Top