Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection doesn't open #8

Open
Duncro opened this issue May 11, 2014 · 35 comments
Open

Connection doesn't open #8

Duncro opened this issue May 11, 2014 · 35 comments

Comments

@Duncro
Copy link

Duncro commented May 11, 2014

I am trying to convert project using the old FTDriver library to the Physicaloid library but i cannot get it to open a connection. USB permission pops up for the app and select allow but it never opens the connection to the attached device. Also, none of the tutorials will connect to my Arduino either when compiled with the Physicaloid library.

I have even tried compiling the Serial monitor lite with the Physicaloid library downloaded from here, also won't connect to the Arduino ("Cannot connect") . Though when I try the one from the app store it works fine.

Not sure if this is due to the latest library update?

@adriangradinar
Copy link

Unfortunately, it is the library update that is causing this error. I've been trying to make it work for a couple of days now and lucky I found an older version of the library stored away. The moment I've plugged it in, it just started working with no issues whatsoever.

@Duncro
Copy link
Author

Duncro commented Jun 17, 2014

Thanks Adrian. Any chance you can link the file?

@adriangradinar
Copy link

Hey,
Here it is, let me know if it worked and solved your issues ;)

https://www.dropbox.com/s/fm4kn5avkgy9ghv/physicaloidlibrary.jar

@Duncro
Copy link
Author

Duncro commented Jun 18, 2014

Thanks Adrian!

@adriangradinar
Copy link

Cool. No worries ;)

@ralexmen
Copy link

Hi,
How can i connect library https://www.dropbox.com/s/fm4kn5avkgy9ghv/physicaloidlibrary.jar to my project. I tried: Properties->Java Build path->Libraries->Add external JARs. But when I compiled it - error. Could you share the source cod of true library. Thank you.

@josejuansanchez
Copy link

@adriangradinar The link seems to be broken. Would you mind sharing it again?

Thanks!

@kwaka1208
Copy link

I put the jar file that has been downloaded here.
https://drive.google.com/file/d/0B92YYJtXXd45OU1hakxOSkVhWDg/edit?usp=sharing

I wish this helps you.

@josejuansanchez
Copy link

@kwaka1208 Thanks!

@patangova
Copy link

Hello,
I am facing the same problem as Duncro :when I use the USB serial monitor lite app from playstore it works fines(it reads data from my device) but when I downloaded the sourcecode from https://github.com/ksksue/Android-USB-Serial-Monitor-Lite and added the physicaloid library from here
https://github.com/ksksue/PhysicaloidLibrary a USB permission pops up for the app and select allow which then shows "cannot open".

From above conversation I understood that I need to use physicaloid library from here https://drive.google.com/file/d/0B92YYJtXXd45OU1hakxOSkVhWDg/edit?usp=sharing.

I added the downloaded jar as shown in the below image

adding_jar

but when I launch the app it says "unfortunately, Android-USB-Serial-Monitor-Lite has stopped" and the logcat has this messages as shown in the image

logcat

Can someone help me in fixing this issue.
Thanks

@ylemkimon
Copy link

in PhysicaloidLibrary/src/com/physicaloid/lib/usb/UsbCdcConnection.java

                                     if(mUsbAccess.openDevice(devNum,intfNum,ch)) {
                                         if(DEBUG_SHOW){ Log.d(TAG, "Find VID:"+Integer.toHexString(usbdev.getVendorId())+", PID:"+Integer.toHexString(usbdev.getProductId())+", DevNum:"+devNum+", IntfNum:"+intfNum); }
                                         mUsbConnectionEp.put(ch,new UsbCdcConnectionEp(mUsbAccess.connection(ch), getEndpoint(devNum, intfNum, UsbConstants.USB_DIR_IN), getEndpoint(devNum, intfNum, UsbConstants.USB_DIR_OUT)));
-                                        mCdcAcmInterfaceNum = intfNum;
+                                        mCdcAcmInterfaceNum = intfNum - 1;
+                                        if (mCdcAcmInterfaceNum < 0)
+                                            mCdcAcmInterfaceNum = 0;
                                         return true;
                                     }
                                 }

@prabodh1194
Copy link

The library currently supplied is bad! I used the one by @kwaka1208 . Thanks. @ksksue Please look into this.

@hedoluna
Copy link

Thanks, @ylemkimon

@fahadjahangir
Copy link

@patangova I followed the same steps as u did, and have the same problem.. Did you find any solution?

@dhananjayharel
Copy link

Guys I am also facing the same issue..
tried all suggestions but no luck..
Is there any workaround for this??

@socodeit
Copy link

My arduino vender id is 0x2a03 where as in your code it is set to 0x2341.
Can this be reason for not opening of connection.
mik3y/usb-serial-for-android#127

@ajumalp
Copy link

ajumalp commented Apr 10, 2018

Hi. Great work. Very helpful package. Thanks a lot.

I just noticed that the issue is in the latest commit bug fix CDC-ACM. The interface index used is not correct I think. When I rollback When I replaced mCdcAcmInterfaceNum = intfNum; with mCdcAcmInterfaceNum = 0; it is working.

@Maesltrom
Copy link

Hi. Great work. Very helpful package. Thanks a lot.

I just noticed that the issue is in the latest commit bug fix CDC-ACM. The interface index used is not correct I think. When I rollback When I replaced mCdcAcmInterfaceNum = intfNum; with mCdcAcmInterfaceNum = 0; it is working.

How you got this library to work in new gradle version? If you dont mind, you can give me your physicaloidlibrary.jar and d2xx.jar?

@ajumalp
Copy link

ajumalp commented Sep 24, 2018

Hi. Great work. Very helpful package. Thanks a lot.
I just noticed that the issue is in the latest commit bug fix CDC-ACM. The interface index used is not correct I think. When I rollback When I replaced mCdcAcmInterfaceNum = intfNum; with mCdcAcmInterfaceNum = 0; it is working.

How you got this library to work in new gradle version? If you dont mind, you can give me your physicaloidlibrary.jar and d2xx.jar?

Hi,

I have a copy/fork with my fix, you can find it here
https://github.com/ajumalp/Android-Hex-Uploader

I've compiled my project with this code 1 week before also with Android Studio.
I'll try to provide the jar file soon. I remember I downloaded the latest d2xx.jar from some site. If possible I'll provide the link too.

@ajumalp
Copy link

ajumalp commented Sep 24, 2018

Hi @Maesltrom
I'm not sure I can copy the path to those files here. If you want please contact me I'll provide more details.

Contact me by Mail [email protected] or ping me through My Homepage

@bdureau
Copy link

bdureau commented Sep 15, 2019

hello
I have tried all solutions above but cannot get it to work.
Can you help please

@xxxajk
Copy link

xxxajk commented Sep 17, 2019

This account is dead. A working version can be found here:
https://github.com/xxxajk/PhysicaloidLibrary/

@bdureau
Copy link

bdureau commented Sep 19, 2019

I have tried your version also and it does not work. Do you have a jar file that I could use? I mean an already compiled lib

@xxxajk
Copy link

xxxajk commented Sep 19, 2019

Do any of the demos work? If so, then your code is to blame.
As far as a pre-compiled jar, Yeah, I can send you a link. Email me.

@bdureau
Copy link

bdureau commented Sep 19, 2019 via email

@bdureau
Copy link

bdureau commented Dec 20, 2019

I found what my issue was, I am using a ttl cable with a pl2303 chipset which is not supported

@bdureau
Copy link

bdureau commented Dec 21, 2019

I have added support for PL2303. I will fork the Physicaloid lib to publish my changes

@bdureau
Copy link

bdureau commented Dec 21, 2019

My changes can be found here
https://github.com/bdureau/PhysicaloidLibrary

@bdureau
Copy link

bdureau commented Dec 26, 2019

I have debugged it and got it working. the endpoints were causing troubles
Next I would like to debug the CdcACM so that it works with Maple usb (so far can wrte but cannot read data)

@xxxajk
Copy link

xxxajk commented Dec 27, 2019

All of this (and more!) has been done already in my fork.

@bdureau
Copy link

bdureau commented Dec 27, 2019

not everything has been done or is fully working because I have forked the code from your fork

@xxxajk
Copy link

xxxajk commented Dec 28, 2019

ahh!

@zr0n
Copy link

zr0n commented Jan 25, 2022

My changes can be found here https://github.com/bdureau/PhysicaloidLibrary

How do I create a .jar file of it?

@bdureau
Copy link

bdureau commented Jan 25, 2022 via email

@xxxajk
Copy link

xxxajk commented Jan 26, 2022

@zr0n well, with @bdureau 's fork, or mine you have two options.

I use apache ant, so you change directory into the PhysicaloidLibrary/PhysicaloidLibrary directory and type ant release.

The other option is to use gradle, but good luck with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests