techknight Well-Known Member Licensed User Longtime User Nov 21, 2019 #1 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2019 #2 What do you see with this program: https://www.b4x.com/android/forum/threads/usb-host-library.11290/#post-63127 ? Upvote 0
What do you see with this program: https://www.b4x.com/android/forum/threads/usb-host-library.11290/#post-63127 ?
techknight Well-Known Member Licensed User Longtime User Nov 21, 2019 #3 Its missing some kinda of media something another library. Upvote 0
techknight Well-Known Member Licensed User Longtime User Nov 21, 2019 #4 It compiled anyways. But it pops up, Oops, no device attached. But yet the mouse works. Go figure. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2019 #5 It is possible that your Android device recognizes HID devices and doesn't recognize other devices. If the device is rooted then it might be possible to fix it. You can try this: https://play.google.com/store/apps/details?id=eu.chainfire.usbhostdiagnostics&hl=en Upvote 0
It is possible that your Android device recognizes HID devices and doesn't recognize other devices. If the device is rooted then it might be possible to fix it. You can try this: https://play.google.com/store/apps/details?id=eu.chainfire.usbhostdiagnostics&hl=en
techknight Well-Known Member Licensed User Longtime User Nov 21, 2019 #6 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
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.
Erel B4X founder Staff member Licensed User Longtime User Nov 21, 2019 #7 Look for /dev/tty folder or file. If you see one then you can use the standard File methods to interact with it. Upvote 0
Look for /dev/tty folder or file. If you see one then you can use the standard File methods to interact with it.
techknight Well-Known Member Licensed User Longtime User Nov 21, 2019 #8 Funny you mention that. I did a scan, and I found these: Code: Copy (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
Funny you mention that. I did a scan, and I found these: Code: Copy (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]
techknight Well-Known Member Licensed User Longtime User Nov 21, 2019 #9 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 Nov 21, 2019 #10 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: Code: Copy [ 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: Nov 21, 2019 Upvote 0
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: Code: Copy [ 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...
techknight Well-Known Member Licensed User Longtime User Nov 21, 2019 #11 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
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.