WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: ipheth  (Read 22708 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
ipheth
« on: April 22, 2011, 06:30:25 AM »
Thread started to allow testing of ipheth.

Since apple/local telco have blocked internet tethering/personal hotspot on my iphone, I cannot test these extensions fully, but here's what I've done so far:
Code: [Select]
$ tce-load -i ipheth-pair
libusb.tcz: OK
libxml2.tcz: OK
glib2.tcz: OK
libplist.tcz: OK
usbmuxd.tcz: OK
libtasn1.tcz: OK
libgpg-error.tcz: OK
libgcrypt.tcz: OK
gnutls.tcz: OK
libimobiledevice.tcz: OK
ipheth-2.6.33.3-tinycore.tcz: OK
ipheth-pair.tcz: OK

Next connect your iphone via the usb cable, the ipheth kernel module should load, the usbmuxd daemon should start and ipheth-pair should run:
Code: [Select]
$ lsmod
Module                  Size  Used by    Not tainted
ipheth                  3560  0

$ dmesg
usb 1-7: new high speed USB device using ehci_hcd and address 4
ipheth 1-7:4.2: Apple iPhone USB Ethernet device attached
usbcore: registered new interface driver ipheth

$ sudo /lib/udev/ipheth-pair --list
7d873f0ce2c59d19897f1c49f61dbeee64086a1d juanito's iPhone

$ ps aux | grep usbmuxd
 2998 tc       /usr/local/sbin/usbmuxd -u -U tc

According to http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver this should create a network interface eth1 (or possibly wwlan0), but this does not happen for me - perhaps because settings/general/network/personal hotspot cannot be enabled on my iphone.

If anybody would like to test this further, please be my guest
« Last Edit: April 22, 2011, 06:34:22 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: ipheth
« Reply #1 on: April 23, 2011, 01:35:35 AM »
with a non-jailbroken iphone, I can mount the phone's filesystem with ifuse:
Code: [Select]
$ sudo mkdir /mnt/iphone
$ sudo chown tc:staff /mnt/iphone
$ ifuse /mnt/iphone
$ ls /mnt/iphone
ApplicationArchives/                 Photos/                              Safari/
Books/                               Podcasts/                            com.apple.dbaccess.lock
DCIM/                                PublicStaging/                       com.apple.itdbprep.postprocess.lock
Downloads/                           Purchases/                           com.apple.itunes.lock_sync
PhotoData/                           Recordings/

Offline knightrous

  • Newbie
  • *
  • Posts: 12
Re: ipheth
« Reply #2 on: April 24, 2011, 12:59:04 PM »
Installed and tested.
No tethering working so far. I have no issues with tethering on my carrier (Telstra) and was able to tether my iphone sucessful just a couple of minutes prior to testing in TC.
I was able to mount my iphone with ifuse, so that side is working great :)

Thanks for looking into this request so quick Juanito!
I look forward to testing and providing as much information as possible.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: ipheth
« Reply #3 on: April 27, 2011, 09:42:31 AM »
I discovered the udev rule file in the ipheth-pair extension was corrupted.

I don't think this will change anything in terms of tethering, but you could try deleting your local copy and downloading a new copy from the repo.

Otherwise, I'm still trying to figure out why a network interface is not created... 

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: ipheth
« Reply #4 on: April 28, 2011, 03:35:11 AM »
I'd been looking for the ipheth internet interface with ifconfig, but discovered that one had been created with iwconfig - "eth1".

Here's what I get:
Code: [Select]
$ sudo udhcpc -i eth1

dmesg
..
ipheth 1-7:4.2: Apple iPhone USB Ethernet device attached
usbcore: registered new interface driver ipheth
------------[ cut here ]------------
WARNING: at net/sched/sch_generic.c:255 0xc034f714()
Hardware name: Latitude D430                  
NETDEV WATCHDOG: eth1 (ipheth): transmit queue 0 timed out
Modules linked in: ipheth squashfs scsi_wait_scan ramzswap loop pcmcia yenta_socket sdhci_pci dell_wmi video sdhci rsrc_nonstatic backlight
 wmi battery pcmcia_core ac output mmc_core tg3 ssb libphy
Pid: 0, comm: swapper Not tainted 2.6.33.3-tinycore #2012
Call Trace:
 [<c0128285>] ? 0xc0128285
 [<c034f64d>] ? 0xc034f64d
 [<c01282ca>] ? 0xc01282ca
 [<c034f714>] ? 0xc034f714
 [<c013a661>] ? 0xc013a661
 [<c01242b2>] ? 0xc01242b2
 [<c01138e2>] ? 0xc01138e2
 [<c0113ab5>] ? 0xc0113ab5
 [<c01402ff>] ? 0xc01402ff
 [<c012faa4>] ? 0xc012faa4
 [<c012fbb4>] ? 0xc012fbb4
 [<c012c1af>] ? 0xc012c1af
 [<c012c252>] ? 0xc012c252
 [<c012c5d4>] ? 0xc012c5d4
 [<c0114204>] ? 0xc0114204
 [<c03bd06a>] ? 0xc03bd06a
 [<c026ce02>] ? 0xc026ce02
 [<c032a7bd>] ? 0xc032a7bd
 [<c01017e9>] ? 0xc01017e9
---[ end trace debb96b4aa274556 ]---
ipheth: ipheth_tx_timeout: TX timeout

As said, internet tethering is blocked on my iphone, but I borrowed a friend's iphone with internet tethering enabled and got the same result.

Maybe you could give it a try?

Edit: as per google, several others have this message. The libimodiledevice devs are saying that, since the ipheth driver is accepted into the kernel as from 2.6.34, any problems like this need to be posted on the kernel mailing lists. It's almost certain that we would be told to upgrade to the latest stable kernel if we post this issue on the kernel mailing list...
« Last Edit: April 28, 2011, 06:08:11 AM by Juanito »

Offline knightrous

  • Newbie
  • *
  • Posts: 12
Re: ipheth
« Reply #5 on: May 24, 2011, 01:42:45 AM »
Belated reply, but today I got ipheth working in tinycore!

I'm not exactly sure, but I installed it fresh on a second laptop, ensured ipheth-pair, usbmuxd, ipheth modules and ifuse were set to OnBoot and it seems to work following the commands you've listed in this thread.

About to head to a motel for the night and will try it again to confirm it works reliably :) anyway we can bind the commands to a key to toggle the service on and off?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: ipheth
« Reply #6 on: May 24, 2011, 03:18:30 AM »
Good to hear progress is (hopefully) being  made  :)

I'm guessing this is due to the updated libimobiledevice I posted (I can now play music from an iphone using rhythmbox as well).

As mentioned earlier, internet tethering/personal hotspot is blocked on my hardware so I can't give too many recommendations on how to use it.

To turn things off/on I guess you could either disable internet tethering/personal hotspot on your iphone or kill the udhcpc process - I'm not sure how you could bind this to a key press though.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: ipheth
« Reply #7 on: May 24, 2011, 03:22:14 AM »
actkbd :)
The only barriers that can stop you are the ones you create yourself.

Offline knightrous

  • Newbie
  • *
  • Posts: 12
Re: ipheth
« Reply #8 on: May 24, 2011, 05:05:19 AM »
Okay,

I've had more time to fiddle with this, it's a little funky but I've worked out how to get it to work.

First off, if I disconnect my iphone after tethering, it will not tether again without a reboot.
Once I have plugged my phone in, I run a custom iphone.sh which has
Code: [Select]
sudo /lib/udev/ipeth-pair --list
ifuse /home/tc/iphone
sudo udhcpc -i eth1

I think the unplugging, no re-tethering thing might be fixed by unmounting the phone using ifuse.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: ipheth
« Reply #9 on: May 24, 2011, 06:57:51 AM »
I don't think mounting the iphone file system with ifuse would have any bearing on the successful outcome (or not) of internet tethering.

..and I wouldn't recommend unplugging the iphone with the file system still mounted (use "sudo umount /home/tc/iphone" first).
« Last Edit: May 24, 2011, 07:00:44 AM by Juanito »

Offline knightrous

  • Newbie
  • *
  • Posts: 12
Re: ipheth
« Reply #10 on: May 24, 2011, 08:05:02 AM »
I don't think mounting the iphone file system with ifuse would have any bearing on the successful outcome (or not) of internet tethering.
Unfortunately, it does. Refuses to tether without mounting it with ifuse.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: ipheth
« Reply #11 on: May 24, 2011, 09:32:37 AM »
Hmm - that doesn't seem to make logical sense.

One thing I noticed is that you used "sudo /lib/udev/ipeth-pair --list", which should just list available devices:

A. Your device should be paired anyway since the udev rule included in the ipheth-pair extension should pair your iphone as soon as you plug it in.
B. The command to pair is "sudo /lib/udev/ipeth-pair" (without the "--list")

If you have the time and inclination, it would be interesting to see if using "sudo idevicepair --pair" instead of "sudo /lib/udev/ipeth-pair" works. If it does work, then maybe I should rework things to drop the ipheth-pair extension.

Offline knightrous

  • Newbie
  • *
  • Posts: 12
Re: ipheth
« Reply #12 on: May 24, 2011, 07:59:00 PM »
One thing I noticed is that you used "sudo /lib/udev/ipeth-pair --list", which should just list available devices

I actually just use it to confirm the device is indeed paired. I'll be removing it from the .sh once this becomes stable :) WRT the ifuse part, when I get home, I'll do up a video showing what happens. I'll also try out the "sudo idevice-pair" command today when I get a chance.