acemind / usb-serial-for-android

Automatically exported from code.google.com/p/usb-serial-for-android
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Support for PL2303 devices #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Would it be possible to add support for PL2303 USB to serial devices to your 
library? I found some sourcecode for PL2303 devices in this project:
https://code.google.com/p/indiserver/source/browse/INDIserver/branches/version2#
version2%2Fsrc%2Fde%2Fhallenbeck%2Findiserver%2Fcommunication_drivers

Original issue reported on code.google.com by david.ma...@gmail.com on 27 Jul 2012 at 2:36

GoogleCodeExporter commented 9 years ago
Can you recommend or provide a sample PL2303 device?  While I can't guarantee 
when I'll get to it, having a sample device would be a prerequisite.

Original comment by mike.wak...@gmail.com on 27 Nov 2012 at 4:57

GoogleCodeExporter commented 9 years ago
For instance you can use this PL2303 serial port adapter: 
http://www.aten.com/products/productItem.php?model_no=UC232A
But every adapter with the PL2303 chip should work also.

Original comment by david.ma...@gmail.com on 27 Nov 2012 at 5:53

GoogleCodeExporter commented 9 years ago
I'm trying to interface an ND-100S GPS dongle which contains a PL2303, so I 
would be very happy to test support for this USB to serial device.

Original comment by bmb6...@gmail.com on 12 Jan 2013 at 4:27

GoogleCodeExporter commented 9 years ago
Update: I have a PL2303 device on order.  I will update this bug when I have a 
chance to write/test drivers (probably in the next week or so).

Original comment by mike.wak...@gmail.com on 15 Jan 2013 at 11:06

GoogleCodeExporter commented 9 years ago
I am looking forward for your update... currently, I am trying to read data 
from a gps dongle too, but I am not able to read from the device.

Original comment by jeens...@gmail.com on 22 Jan 2013 at 9:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Would be great if Prolific chips will be supported! How's the update going?

Original comment by pieterot...@gmail.com on 25 Feb 2013 at 8:37

GoogleCodeExporter commented 9 years ago
+ 1 on PL2303 devices

Original comment by fxmul...@gmail.com on 15 Mar 2013 at 3:21

GoogleCodeExporter commented 9 years ago
http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=230&pcid=41

Original comment by jeens...@gmail.com on 5 Apr 2013 at 11:10

GoogleCodeExporter commented 9 years ago
Prolific support would be great, many serial port adapter use this chip.

Original comment by hugo.vio...@gmail.com on 24 Apr 2013 at 5:33

GoogleCodeExporter commented 9 years ago
Any news on the subject?

Original comment by teufe...@gmail.com on 15 May 2013 at 11:48

GoogleCodeExporter commented 9 years ago
The python library "pyftdi" contains a PL2303 driver (LGPL license):
https://github.com/eblot/pyftdi/blob/master/pyftdi/pyprolific/prolific.py

Are you working on a driver? If not, I would volunteer for porting the pyftdi 
prolific driver to usb-serial-for-android.

Original comment by felix.ha...@gmail.com on 15 May 2013 at 9:57

GoogleCodeExporter commented 9 years ago
Check the project clones.
https://code.google.com/p/usb-serial-for-android/source/clones

I believe PL2303 are already implemente on some of them like :
https://code.google.com/r/serge-usb-serial-for-android/

I havent tested yet, but I will give it a shot next week.

Original comment by hugo.ros...@zonesoft.org on 17 May 2013 at 4:59

GoogleCodeExporter commented 9 years ago
I looked at the PL2303 file. There is no implementation of the read/write logic

Original comment by ada...@gmail.com on 21 May 2013 at 2:44

GoogleCodeExporter commented 9 years ago
I ported the pyftdi driver to usb-serial-for-android in my clone:
https://code.google.com/r/felixhaedicke-usb-serial-for-android

It is in an early development stage, but it works for me. Feedback is 
appreciated.

Original comment by felix.ha...@gmail.com on 21 May 2013 at 11:00

GoogleCodeExporter commented 9 years ago
Cool. I'll give it a spin. Any idea if older Prolific chipsets are supported?

Original comment by ada...@gmail.com on 22 May 2013 at 9:31

GoogleCodeExporter commented 9 years ago
There is now a branch in this repository, "device-pl2303", which incorporates 
Felix's changes.  Please give it a try.

Original comment by mike.wak...@gmail.com on 22 May 2013 at 9:42

GoogleCodeExporter commented 9 years ago
Hi Felix, I tried your port but I get an error. I will try to get the log. 
I have only one USB on my tablet, so I can't connect it to my pc for debugging 
and usb-serial at the same time.

Original comment by poles...@gmail.com on 25 May 2013 at 12:41

GoogleCodeExporter commented 9 years ago
Hi
You could try debugging over tcp: 
http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb
-over-tcp

Original comment by roland.s...@gmail.com on 25 May 2013 at 8:10

GoogleCodeExporter commented 9 years ago
Thanks, I did it. Was a permission problem.
The version from Felix is working fine with a cheap USB-Serial PL2303 converter 
from China.
Thank you very much!

Original comment by poles...@gmail.com on 25 May 2013 at 10:27

GoogleCodeExporter commented 9 years ago
The implementation should work with non-HX PL2303 devices. Unfortunately I do 
not have such a device. So if someone here has such a device - I am very 
interested if if works or not.

Original comment by felix.ha...@gmail.com on 26 May 2013 at 1:47

GoogleCodeExporter commented 9 years ago
@Felix - works for me. Thanks a lot!

Original comment by vai...@gmail.com on 29 May 2013 at 9:07

GoogleCodeExporter commented 9 years ago
To Felix
(I am new to everything:-)
I cloned your clone 
https://code.google.com/r/felixhaedicke-usb-serial-for-android/
but gets the following errors when try to build(imported into intelij):

1.In the example app: 
java: method probeSingleDevice in enum 
com.hoho.android.usbserial.driver.UsbSerialProber cannot be applied to given 
types;
  required: android.hardware.usb.UsbDevice
  found: android.hardware.usb.UsbManager,android.hardware.usb.UsbDevice
  reason: actual and formal argument lists differ in length
2. In the library:
java: cannot find symbol
  symbol:   method close()
  location: variable sDriver of type com.hoho.android.usbserial.driver.UsbSerialDriver
---
I have no problem running the original from Mike

Any idea ?

Original comment by i...@alpiron.com on 12 Jun 2013 at 4:31

GoogleCodeExporter commented 9 years ago
I am getting similar errors with freshly imported code, not sure how to deal 
with it...

Original comment by ajaymi...@gmail.com on 18 Jun 2013 at 9:10

GoogleCodeExporter commented 9 years ago
I agree/ +1 on supporting prolific devices.

Prolific them selves have already released Android driver, It shouldn't be to 
hard to Incorporated

http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=230&pcid=41

Original comment by zapotech...@gmail.com on 26 Jun 2013 at 10:12

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I was able to get Felix's PL2303 code working with a small fix in the library 
(an error with thowing an exception picked up by Eclipse) and with several 
changes to the sample program to change sDriver.open() to 
sDriver.getPort(0).open() [and the same changes for .close and .setParameters] 
and the passing in of UsbManager to Open().

These changes seem to be from the Multiport refactoring.

Original comment by RogerHar...@gmail.com on 27 Jun 2013 at 7:10

GoogleCodeExporter commented 9 years ago
For anyone using Aten UC232A. This converter works with the prolific driver and 
the felix clone but it has a different Vendor and PID. If you want to use this, 
you should make a few changes to the library. 

On UsbId.java you must add the Aten VID and PID

    public static final int VENDOR_ATEN = 0x0557;
    public static final int ATEN_UC232A = 0x2008;

On ProlificSerialDriver.java you must add this VID and PID to the supported 
devices.

    public static Map<Integer, int[]> getSupportedDevices() {
        final Map<Integer, int[]> supportedDevices = new LinkedHashMap<Integer, int[]>();
        supportedDevices.put(Integer.valueOf(UsbId.VENDOR_PROLIFIC),new int[] { UsbId.PROLIFIC_PL2303, });
        supportedDevices.put(Integer.valueOf(UsbId.VENDOR_ATEN),new int[] { UsbId.ATEN_UC232A, });
        return supportedDevices;
    }

On your project device_filter.xml you should add the VID and PID

    <!-- 0x0557 / 0x2008: Aten UC232A -->
    <usb-device vendor-id="1367" product-id="8200" />

Original comment by hugo.ros...@zonesoft.org on 11 Jul 2013 at 11:11

GoogleCodeExporter commented 9 years ago
Hi Hugo,

I made all the changes that you suggested but the example is crashing when I 
tap on the device entry in the list. I found that it crashes at 

sPort.open(mUsbManager);  //  line 135 examples/SerialConsoleActivity.java

Any idea what could be wrong? My device's vendor-id and product-id are same as 
you mentioned.

Original comment by shahdol...@gmail.com on 9 Aug 2013 at 3:11

GoogleCodeExporter commented 9 years ago
moved to github: https://github.com/mik3y/usb-serial-for-android/issues/2

Original comment by mike.wak...@gmail.com on 13 Sep 2013 at 4:35