B4A Library UsbSerial library 2.0 - supports more devices

mrodriguez

Member
Licensed User
Longtime User
What happens when the program crashes? Can you post the logs?


Maybe your program is getting low on memory? What are you doing with the data?

It was device problem, I'm using an android mini-pc. It works on galaxy s4. Thanks!!
 

ernschd

Active Member
Licensed User
Longtime User
I've a question about "RequestPermission": in my opinion there should be always a dialog when calling this function (without adding the changes to the manifest). But when I open the FTDI UART Terminal App, which is requesting permission too, my App doesn't shows the dialog any more. The FTDI App asks every time. Do I have to change something for calling this each time too?
 

pixelpop

Active Member
Licensed User
Longtime User
I am just getting started with this lib, but have a couple of quick questions.

1. The readme file in the 2.3 zip file says "Move both jars and the xml file...." but there is only one jar file in the zip file. This may be because, as stated in post #1, "The library is based on...but no longer needs a separate jar file as the project source code is incorporated in the library." Please confirm.

2. If usb-serial-for-android-v010.jar is no longer needed for this library, should it be deleted from the additional libraries directory?

Thanks...
 

pixelpop

Active Member
Licensed User
Longtime User
I am trying to connect a postal scale to a small Android device. The scale is a "DYMO Pelouze M10 Digital USB Postal Scales, 10lb, USB Connect, PC/Mac Compatible (1772057)" and the device is a "Coby Kyros 4.3-Inch Android 4.0 4 GB Internet Tablet 16:9 Capacitive Multi-Touch Widescreen, Black (MID4331-4)". Of course, to connect the scale to the device I use a female-female adapter to connect the cable from the scale to the cable attached to the device. Both the scale and device are recognized by Windows (without the need for the adapter).

I installed Bridge on the device and compiled the example USB Serial app. However, when I run the app, and click Start, I get the message "No USB device or accessory detected!" I don't even know where to start to get this working, so any help would be greatly appreciated. Thanks!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

pixelpop

Active Member
Licensed User
Longtime User
Erel,

Fantastic! I rooted the device and made the mods suggested in the post you referenced. Success!

You may want to edit that post due to a small error. In step 3, the instruction is to add the entry <feature name="android.hardware.usb.host"> to the xxx_core_hardware.xml file. I think the entry is missing a "/" before the closing ">" character. The line I added was <feature name="android.hardware.usb.host" />.

You may want to fix this for anyone following in my footsteps.

Thanks again!!!
 

pixelpop

Active Member
Licensed User
Longtime User
Agreed...but <feature...> is not closed properly in step 3).

"3 - open in /system/etc/permissions file named handheld_core_hardware.xml or tablet_core_hardware.xml and add <feature name="android.hardware.usb.host"> into <permissions> section"

Wrong: <feature name="android.hardware.usb.host">
Correct: <feature name="android.hardware.usb.host" />
 

pixelpop

Active Member
Licensed User
Longtime User
I have hit the Realtek WiFi vs. USB wall that has been discussed here and elsewhere. When I began, the USB port was not recognized by the USBSerial 2.3 demo app. I rooted the device and applied the mods suggested above. Now the app recognizes the port, but as a Realtek WLAN.

Has anyone been able to come up with a work-around for this issue? Also, there are many 4.3" and 7" minis in the market. Has anyone had success using USB with any of these other devices (Chromo, Dragon, ProntoTec, etc.)?

Thanks!

Edit: Just for grins, I tried the USBSerial demo app on a Galaxy S3 and old Galaxy 10.1 tablet I had laying around. Both failed (no USB device attached). I didn't bother rooting either of them. The device I am trying to read is a Dymo postal scale with USB output. I'm starting to think my project is dead before it even got started. :-(

Edit2: I installed USB Host Diagnostics app. The results are mixed:

Android API
Claims support - Yes
Classes found - Yes
Device detected - No

Rooted API
Claims support - Yes
Device detected - Yes

Kernel
Claims support - Yes
Device detected - No

Verdict
OS support - No
3rd party apps - No

Any clues here?
 
Last edited:

ernschd

Active Member
Licensed User
Longtime User
Hello Agraham,

after communicating with FTDI i have to enable RTS/CTS Flow Control for my Device to have a proper setup.
Do you have a suggestion how i can activate this parameter with your library?

Thank you and regards.
 

mrodriguez

Member
Licensed User
Longtime User
Hi, is there any way to control 2 ftdi usb2serial modules on the same android device?
I have attached 2 ftdi usb2serial modules to 1 android minipc, just need to send different serial data to each one at the same time.
I dont find the reference to a ftdi module on the code.
Thanks
 

mrodriguez

Member
Licensed User
Longtime User
Agraham might correct me, but I believe that this library uses the first connected USB device that it founds. This means that it will not work with two different USB devices.
Thanks Erel, may be for the next release.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…