mkorenkov / ipad_charge

charge Apple devices under Ubuntu Linux
GNU General Public License v2.0
258 stars 72 forks source link

Make utility work in the face of 2 issues found on Ubuntu 16.04 #44

Open nitsanw opened 7 years ago

nitsanw commented 7 years ago

I hit 2 issues:

  1. Resource busy: need to set device to auto detach
  2. Interface number hardcoded to 0, but turned out to be 2 I also added some output to help future failures easier to diagnose (I think). Arguably those should be put behind a 'quiet' flag. While doing this I formatted the errors (for the better I believe). This fixed issues #42 (for me) and perhaps issue #34
jpptinsley commented 7 years ago

Not working for me, on Ubuntu 16.04. iPad starts to charge, but then is disconnected immediately and reattached. 645518.622571

Dmesg output; attach:

[645544.524004] usb 1-1.2: new high-speed USB device number 19 using ehci-pci
[645544.619859] usb 1-1.2: New USB device found, idVendor=05ac, idProduct=12ab
[645544.619862] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[645544.619864] usb 1-1.2: Product: iPad
[645544.619865] usb 1-1.2: Manufacturer: Apple Inc.
[645544.619866] usb 1-1.2: SerialNumber: 96e298e64b66d314bfcf732c6557e3309880e965
[645545.242317] ipheth 1-1.2:4.2: Apple iPhone USB Ethernet device attached
[645545.250896] ipheth 1-1.2:4.2 enp0s26u1u2c4i2: renamed from eth1

On using ipadcharge:

[645610.493810] ipheth 1-1.2:4.2: Apple iPhone USB Ethernet now disconnected
[645610.496005] ipheth 1-1.2:4.2: Apple iPhone USB Ethernet device attached
[645610.498969] ipheth 1-1.2:4.2 enp0s26u1u2c4i2: renamed from eth1
[645611.386749] ipheth 1-1.2:4.2: ipheth_rcvbulk_callback: urb status: -71
[645611.699106] usb 1-1.2: USB disconnect, device number 19
[645611.713936] ipheth 1-1.2:4.2: Apple iPhone USB Ethernet now disconnected
[645611.913944] usb 1-1.2: new high-speed USB device number 20 using ehci-pci
[645612.011752] usb 1-1.2: New USB device found, idVendor=05ac, idProduct=12ab
[645612.011757] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[645612.011760] usb 1-1.2: Product: iPad
[645612.011762] usb 1-1.2: Manufacturer: Apple Inc.
[645612.011764] usb 1-1.2: SerialNumber: 96e298e64b66d314bfcf732c6557e3309880e965
[645612.602942] ipheth 1-1.2:4.2: Apple iPhone USB Ethernet device attached
[645612.606385] ipheth 1-1.2:4.2 enp0s26u1u2c4i2: renamed from eth1

Error message I think is: ipheth 1-1.2:4.2: ipheth_rcvbulk_callback: urb status: -71

nitsanw commented 7 years ago

It seems like your ipad is setup for tethering and that a related failure is resulting in a disconnect. This fix is not geared at fixing this new issue. Is this patch an improvement on the current version?

jpptinsley commented 7 years ago

My iPad doesn't even have a cellular chip, it's a wifi-only one. No tethering options show up in the pad's settings. I can't test the patch, because my Pad refuses to charge with it. It does appear to be getting further than the current version, however, yes.

nitsanw commented 7 years ago

@jpptinsley can you please send the "lsusb -v" output from your setup with the ipad connected, maybe there's a clue there

Tatsh commented 6 years ago

I'm wondering if this has to do with usbmuxd or ipheth. My pull request #48 tries to solve this issue but I do not think it does quite yet. It waits for bConfigurationValue to be 1 before trying to charge.

DivineOmega commented 5 years ago

This fork worked fine for me. :+1:

Tatsh commented 5 years ago

Please follow my fork here: https://github.com/Tatsh/ipad_charge/

I will be supporting it.