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

[error -6] on Ubuntu 16.04 #42

Open
botcs opened this issue Jun 6, 2016 · 12 comments
Open

[error -6] on Ubuntu 16.04 #42

botcs opened this issue Jun 6, 2016 · 12 comments

Comments

@botcs
Copy link

botcs commented Jun 6, 2016

Worked well on 14.04 but after upgrading:
ipad_charge: unable to claim interface: error -6
ipad_charge: Resource busy
ipad_charge: error setting charge mode
ipad_charge: no such device or an error occured

I have iPad mini 1

@jameslovallo
Copy link

I get the same error on mine with an iPad Air 2. Have you found a workaround?

@botcs
Copy link
Author

botcs commented Aug 16, 2016

not yet :\

@nitsanw
Copy link

nitsanw commented Aug 23, 2016

Had the same issue, after some digging around came up with following solution:

       // hacked into set_charging_mode, replace the claim_interface block with this
       // Resource Busy issue is caused because kernel is attached to device, so enable auto detach
        if ((ret = libusb_set_auto_detach_kernel_driver(dev_handle, 1)) < 0) {
                fprintf(stderr, "ipad_charge: set auto detach failed: error %d\n", ret);
                fprintf(stderr, "ipad_charge: %s\n", libusb_strerror(ret));
                return ret;
        }

        // Original code assumes the bInterfaceNumber is always 0, for me it turned out to be 2.
        // You can use lsusb to find out which interface numbers are available
        if ((ret = libusb_claim_interface(dev_handle, 2)) < 0) {
                fprintf(stderr, "ipad_charge: unable to claim interface: error %d\n", ret);
                fprintf(stderr, "ipad_charge: %s\n", libusb_strerror(ret));
                goto out_close;
        }

I am running Ubuntu 16.04 on an MBP 11,1 and charging and iPad4. Seems to work now.

To find the bInterfaceNumber I used lsusb -v which give you much gory detail.
Hope this helps

@JanUmbhau
Copy link

Hi nitsanw! I'm new to Linux and am having the same problem. Where exactly do I insert and/or create a new file with the content you posted above? I'm a little reluctant to type anything into the Terminal, without verifying beforehand that that's where the code should go :) Thanks in advance!

@nitsanw
Copy link

nitsanw commented Sep 28, 2016

The fix is now on a fork:
https://github.com/nitsanw/ipad_charge
I need to further test it and I will submit as PR.

@JanUmbhau
Copy link

Thanks!

@nitsanw
Copy link

nitsanw commented Sep 28, 2016

@botcs @JanUmbhau WFM :), try the PR and report back

@botcs
Copy link
Author

botcs commented Nov 18, 2016

make succesful, but still not WFM.

when iPad mini connected, returns the following:
./ipad_charge
ipad_charge: no such device or an error occured

However my iPad charges... a bit nasty, I don't know where could be actually the problem

@0ki
Copy link

0ki commented Jan 20, 2017

Thanks, @nitsanw!
Your patch worked for me.
Here is a compiled version of ipad_charge as patched: http://02.lv/f/2017/01/21/ipad_charge

@freeRain19
Copy link

freeRain19 commented Dec 14, 2017

@0ki , thanks a lot. This file help me.

@jeffsturgis
Copy link

Thanks @nitsanw! Patch works great!

@Silfalion
Copy link

it worked for me too, thanks a lot!

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

8 participants