Android Question USB Serial

techknight

Well-Known Member
Licensed User
Longtime User
Is there a way to use a usb serial library and list the USB devices attached to the system?

I tried 2 different libraries, and guessed if it was device 0, or 1, or 2, etc. but no devices are ever found. I am using an android single board computer type setup.

I can plug a mouse into the USB port, and it works fine, so i know the USB works.

the Android version is 4.4 BTW.

any thoughts? thanks.
 

techknight

Well-Known Member
Licensed User
Longtime User
It compiled anyways. But it pops up, Oops, no device attached. But yet the mouse works. Go figure.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Yea, you may be right on that.

It also has on-board TTL serial port headers, but I dont know how to use those in android.

Also the device has no input devices. No touchscreen or anything, its meant to run an LED sign. So its not like I can go download an app from the play store and interact with it, it isnt possible.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Funny you mention that. I did a scan, and I found these:

B4X:
(ArrayList) [/dev/ttyGS3, /dev/ttyGS2, /dev/ttyGS1, /dev/ttyGS0, /dev/ttyUSB6, /dev/ttyUSB5, /dev/ttyUSB4, /dev/ttyUSB3, /dev/ttyUSB2, /dev/ttyUSB1, /dev/ttyUSB0, /dev/ttySAC3, /dev/ttySAC2, /dev/ttySAC1, /dev/ttySAC0]
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
I got permission denied on everything except for the ttySAC lines. so im going to try that maybe.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Appears as if there is a USB Hub internal to the single board computer.

can the usb serial library work through a hub? can that be fixed? Turns out one of the on board TTL ports is actually the DMESG interface to the kernel.

So when I plug in the FTDI cable, I actually get this:

B4X:
[  132.487124] usb 1-1.3: new full speed USB device number 5 using s5p-ohci
[  132.604617] ftdi_sio 1-1.3:1.0: FTDI USB Serial Device converter detected
[  132.605619] usb 1-1.3: Detected FT232RL
[  132.605656] usb 1-1.3: Number of endpoints 2
[  132.605695] usb 1-1.3: Endpoint 1 MaxPacketSize 64
[  132.605737] usb 1-1.3: Endpoint 2 MaxPacketSize 64
[  132.606711] usb 1-1.3: Setting MaxPacketSize 64
[  132.615393] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB4
[  179.776135] RTL871X: rtw_issue_addbareq_cmd, p=0
[  179.776226] RTL871X: issue_action_BA, category=3, action=0, status=0
[  179.776288] RTL871X: BA_starting_seqctrl = 268 for TID=0
[  179.812170] RTL871X: OnAction_back
[  179.812215] RTL871X: OnAction_back, action=1
[  179.812252] RTL871X: agg_enable for TID=0

But if I try to open ttyUSB4 as a serial port in the App, I just simply get permission denied.

Edit: If I insert a USB Hub in between Then it works! Go figure...
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Never did figure it out. When rebooting, it wont open with permission denied errors. Soon as I unplug and plug the USB adapter back in, Works fine.

I gave up. I am now using the hardware serial port, which works fine.
 
Upvote 0
Top