OpenWrt Forum Archive

Topic: Setup USB tethering with iPad

The content of this topic has been archived between 18 Apr 2018 and 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to setup USB tethering with an iPad and the router but I cannot seem to manage.
It is working fine using my android phone, but for the iPad not really.

I installed the following packages:
kmod-usb-net-ipheth
libimobiledevice
libimobiledevice-utils
libplist
libplist-utils
libusbmuxd
usbmuxd

for the package 'libimobiledevice' I had to --force-depends, as it depends on a 'libcrypto' package wich doesn't seem to exist (I do have 'libopenssl' installed and '/usr/lib/libcrypto.so.1.0.0' also exists).

ipheth seems to be correctly loaded:

root@OpenWrt:~# lsmod | grep ipheth
ipheth                  4896  0
root@OpenWrt:~#

although it seems weird that it doesn't appear in the 'usbcore' or 'usbnet' used by column...


When I plug in the ipad I only get this (I plugged it and then clicked to trust the pc on ipad):

root@OpenWrt:~# dmesg | tail -n 3
[  637.010000] usb 1-1: new high-speed USB device number 5 using ehci-platform
[  638.910000] usb 1-1: USB disconnect, device number 5
[  639.320000] usb 1-1: new high-speed USB device number 6 using ehci-platform
root@OpenWrt:~#

and no messages from ipheth...

ideviceinfo also tells me that no device is found.

I don't really know where to go from here. Anyone has an ipad or iphone USB tethering working on OpenWRT and can give some clues?

(Last edited by LuisGC on 11 Jan 2015, 16:14)

did you ever get this working? I'm about to start tackling this so I can setup a wireless router for my kids at our camp.

i tried to get this to work some weeks ago, i found very little information about htis on the net. and what i found seemed to be outdated.

If someone has gotten it to work id love to hear from that, if i get it to work i'll even update/make a wiki page about it big_smile

I've been trying for days to try and get this working and haven't had no luck. sad

When I plug-in either my iphone or ipad (with personal hotspot ON) I get a prompt to trust the device, however it doesn't trigger the USB tethering.
I know the usb-tethering works on my iDevices as I can connect them (individually) to a Windows 7 PC or Macbook and the usb-tethering works.

Somebody must have gotten this working somehow.. well I'm hoping anyways wink

i think the ipheth package does not work with the latest IOS versions...

I just installed RC1 since it contains libimobiledevice-utils_1.2.0-2 which is "supposed" to support newer ios, however I'm still getting the same results.

I also can't get usbmuxd installed and configured properly.

root@GateKeeper-OpenWrt:/etc# opkg install usbmuxd
Installing usbmuxd (1.1.1-3) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05-rc1/ramips/rt3883/packages/packages/usbmuxd_1.1.1-3_ramips_24kec.ipk.
Installing librt (0.9.33.2-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05-rc1/ramips/rt3883/packages/base/librt_0.9.33.2-1_ramips_24kec.ipk.
Installing libusb-1.0 (1.0.19-1) to root...
Downloading http://downloads.openwrt.org/chaos_calmer/15.05-rc1/ramips/rt3883/packages/base/libusb-1.0_1.0.19-1_ramips_24kec.ipk.
Configuring librt.
Configuring libusb-1.0.
grep: /usr/lib/opkg/info/libusb-1.control: No such file or directory
cat: can't open '/usr/lib/opkg/info/libusb-1.list': No such file or directory
Configuring usbmuxd.

Not sure if this is the issue w/ OpenWRT, but when tethering my iPhone 5/6 to Windows 7/8 Asus PC w/ USB, I have to connect the devices before turning on the hotspot feature on iphone.

brett2 wrote:

Not sure if this is the issue w/ OpenWRT, but when tethering my iPhone 5/6 to Windows 7/8 Asus PC w/ USB, I have to connect the devices before turning on the hotspot feature on iphone.

My guess is the newer libimobiledevice library files aren't compatible with iOS 8.3. I was going to try and revert back to a previous iOS version, however Apple has turned those off now! sad

As of Chaos Calmer RC3, iOS tethering is working just fine for me. You need to install the following packages: kmod-usb-net-ipheth libusbmuxd libimobiledevice usbmuxd (Though, just installing usbmuxd should take care of the lib* packages. You can also install lib*-utils if you want the optional utilities.)

Now, here's the key that took me forever to figure out: You have to actually start usbmuxd for the Ethernet interface to become available! Just type 'usbmuxd' to start it, plug in your iPhone (with tethering turned on) and you should see it register in the kernel logs. Now, add a new network device using the CLI or LuCI, assigning it to the iPhone's Ethernet device, restart networking and you're set.

Tested working on a TL-WR710N and HT-TM04 with an iPhone 5S running iOS 9 Beta 1 and on an iPhone 6 with iOS 8.

(Last edited by timb on 26 Jul 2015, 01:28)

timb wrote:

As of Chaos Calmer RC3, iOS tethering is working just fine for me. You need to install the following packages: kmod-usb-net-ipheth libusbmuxd libimobiledevice usbmuxd (Though, just installing usbmuxd should take care of the lib* packages. You can also install lib*-utils if you want the optional utilities.)

Now, here's the key that took me forever to figure out: You have to actually start usbmuxd for the Ethernet interface to become available! Just type 'usbmuxd' to start it, plug in your iPhone (with tethering turned on) and you should see it register in the kernel logs. Now, add a new network device using the CLI or LuCI, assigning it to the iPhone's Ethernet device, restart networking and you're set.

Tested working on a TL-WR710N and HT-TM04 with an iPhone 5S running iOS 9 Beta 1 and on an iPhone 6 with iOS 8.


do you know if this would work in BB as well ? i have some tiny bouards with 4MB flash and the packages dont fit (with luci on it as well, so might need to remove that) i know CC has a bigger footprint then BB (or AA for that matter) wondering if it would work on the older images...



edit: Checked myself, it also works on BB big_smile

(Last edited by yoyellow on 27 Jul 2015, 14:35)

yoyellow wrote:
timb wrote:

As of Chaos Calmer RC3, iOS tethering is working just fine for me. You need to install the following packages: kmod-usb-net-ipheth libusbmuxd libimobiledevice usbmuxd (Though, just installing usbmuxd should take care of the lib* packages. You can also install lib*-utils if you want the optional utilities.)

Now, here's the key that took me forever to figure out: You have to actually start usbmuxd for the Ethernet interface to become available! Just type 'usbmuxd' to start it, plug in your iPhone (with tethering turned on) and you should see it register in the kernel logs. Now, add a new network device using the CLI or LuCI, assigning it to the iPhone's Ethernet device, restart networking and you're set.

Tested working on a TL-WR710N and HT-TM04 with an iPhone 5S running iOS 9 Beta 1 and on an iPhone 6 with iOS 8.


do you know if this would work in BB as well ? i have some tiny bouards with 4MB flash and the packages dont fit (with luci on it as well, so might need to remove that) i know CC has a bigger footprint then BB (or AA for that matter) wondering if it would work on the older images...



edit: Checked myself, it also works on BB big_smile

Awesome! Good to know. smile

By the way, you can just add ‘/usr/sbin/usbmuxd’ to ‘/etc/rc.local’ to have it start on boot. Another thing I’ve found is that sometimes when plugging in the phone, despite ‘Personal Hotspot’ already being enabled, it won’t connect. In that case, you may have to toggle the hotspot off and on after the ‘Trust’ dialog pops up; after a few seconds the blue banner should appear on the phone and you’re good to go.

I’ve got a HT-TM04 (about the size of a TP-Link WR710N with build-in battery) setup with an interface called ‘iPhone’ that I’ve bridged the WiFi, Ethernet and iPhone interfaces together in. I created a hotplug script that enables a the WiFi interface (in AP mode) when the iPhone is plugged in, then automatically brings down it down when it’s disconnected. This gives me a portable iPhone-to-Ethernet/WiFi bridge I can use when working at remote sites. (I know the iPhone has a built-in WiFi hotspot, but I just disable that; this way the router keeps the phone charged while providing the WiFi, which along with the ethernet port is bridged to the iPhone, which provides the DHCP/NAT functionality.)

Here’s that hotplug script, for anyone who might find it useful:

###BEGIN:/etc/hotplug.d/iface/10-iPhone###

#!/bin/sh

if [ "$ACTION" = ifup ]; then
    if [ "$INTERFACE" = iPhone ]; then
        logger -t "$INTERFACE-$ACTION" Enabling Wireless AP...
        /sbin/uci set wireless.@wifi-iface[0].disabled=0
        /sbin/uci commit wireless
        /sbin/wifi
    fi
fi

if [ "$ACTION" = ifdown ]; then
        if [ "$INTERFACE" = iPhone ]; then
                logger -t "$INTERFACE-$ACTION" Disabling Wireless AP...
                /sbin/uci set wireless.@wifi-iface[0].disabled=1
                /sbin/uci commit wireless
                /sbin/wifi down
        fi
fi

###END:/etc/hotplug.d/iface/10-iPhone###

(Last edited by timb on 28 Jul 2015, 09:36)

nice script, works for me too.

I managed to get these packages sqeezed onto the 4MB BB image of my mr3020 together with luci, all i had to do was remove any PPP related packages..

timb wrote:

By the way, you can just add ‘/usr/sbin/usbmuxd’ to ‘/etc/rc.local’ to have it start on boot.

Thanks, working nice.

timb wrote:

Another thing I’ve found is that sometimes when plugging in the phone, despite ‘Personal Hotspot’ already being enabled, it won’t connect. In that case, you may have to toggle the hotspot off and on after the ‘Trust’ dialog pops up; after a few seconds the blue banner should appear on the phone and you’re good to go.

I've the same connect issue...
I'm not sure, but I think it is since I installed libimobile-uitls and paired the iPhone that I have to trust almost every connection ...
I do not know how but I was able to connect directly even with the iPhone locked.

As the connection is not always direct, I was wondering if we could modify your script to test if the internet connection is ok and if necessary disable then re-enable the interface "eth1" to simulate a connection?

yoyellow wrote:

I managed to get these packages sqeezed onto the 4MB BB image of my mr3020 together with luci, all i had to do was remove any PPP related packages..

Hi,

I am also interested to squeeze the packages needed on a MR3020 with 4MB flash.
Currently I use a modified WR703N with 16MB flash and 64MB RAM to do this.

After some hours (and days) of debugging,I've found that the folder who UUID.plist are stored /var/lib/lockdown is erased at each reboot...

So I've created a script to backup those files each minute and restore it at each boot.
https://www.dropbox.com/s/dgz14zmlae9uo … wn.sh?dl=0 [edit 04.10.15 v3.3]

I've also managed to fit all necessary on a 4MB size firmware but without LuCI.
It is based on the last OpenWRT 15.05 Chaos Calmer and all is pre-configured.

TL-MR3020
https://www.dropbox.com/s/zaqt9byp8kjxp … y.bin?dl=0 [edit 04.10.15 v3.3]

TL-WR703N
https://www.dropbox.com/s/67uhn3c7lpze5 … y.bin?dl=0 [edit 04.10.15 v3.3]

After many tests, the best way to connect an iPhone is:

1. Inactive Internet sharing
2. Connect iPhone via USB
3. At asked, "Trust" the device
4. Active internet sharing
5. The blue band will appears on the top of the screen
    (if not after 30sec, inactive and reactive internet sharing)
6. Leave all connected at least one minute so the script can do its job

To test if the file has been created, disconnect and reconnect the iPhone. If the dialog "Trust" appears, validate and wait one minute again. When the connection is automatic, you're gone.

At each reboot, the internet sharing will be automatically activated

A log is stored in /etc/lockdown/lockdown.log

(Last edited by jeko on 4 Oct 2015, 21:57)

jeko wrote:

After some hours (and days) of debugging,I've found that the folder who UUID.plist are stored /var/lib/lockdown is erased at each reboot...

So I've created a script to backup those files each minute and restore it at each boot.
https://www.dropbox.com/s/dgz14zmlae9uo … wn.sh?dl=0 [edit 04.10.15 v3.3]

I've also managed to fit all necessary on a 4MB size firmware but without LuCI.
It is based on the last OpenWRT 15.05 Chaos Calmer and all is pre-configured.

TL-MR3020
https://www.dropbox.com/s/zaqt9byp8kjxp … y.bin?dl=0 [edit 04.10.15 v3.3]

TL-WR703N
https://www.dropbox.com/s/67uhn3c7lpze5 … y.bin?dl=0 [edit 04.10.15 v3.3]

After many tests, the best way to connect an iPhone is:

1. Inactive Internet sharing
2. Connect iPhone via USB
3. At asked, "Trust" the device
4. Active internet sharing
5. The blue band will appears on the top of the screen
    (if not after 30sec, inactive and reactive internet sharing)
6. Leave all connected at least one minute so the script can do its job

To test if the file has been created, disconnect and reconnect the iPhone. If the dialog "Trust" appears, validate and wait one minute again. When the connection is automatic, you're gone.

At each reboot, the internet sharing will be automatically activated

A log is stored in /etc/lockdown/lockdown.log

The last version include support for Android device and the come back of LuCI, who simplify firmware change !

The firmware has now the default IP 192.168.0.254 like original.

openwrt-CC-USB_tethering_v4.4-tl-mr3020-v1-squashfs-factory.bin

openwrt-CC-USB_tethering_v4.4-tl-wr703n-v1-squashfs-factory.bin

Regarding Android, activate "USB Tethering" in the settings.
According to initial tests, only HTC is used to activate the function without connecting the smartphone and therefore have an automatic connection as for iOS.

Hi Jeko,

Thanks for your custom firmware, it's working for me with iPhone 5S on iOS 9.

However, can you build a new bin that includes WiFi (wireless) features of OpenWRT ?

In your last version, I'm not able to use MR3020 as a WiFi router.

Thanks.

pyts01 wrote:

Hi Jeko,

Thanks for your custom firmware, it's working for me with iPhone 5S on iOS 9.

However, can you build a new bin that includes WiFi (wireless) features of OpenWRT ?

In your last version, I'm not able to use MR3020 as a WiFi router.

Thanks.

Hi pyts01,

The MR3020 doesn't have any more memory to add wireless functionality with the necessary modules for iOS, that why I've build my own firmware....
If you have a router with at least 8MB of flash (like the modified WR703N) you can add iOS tethering manually.
All is explained in my Github page here: https://github.com/LeJeko/OpenWRT-USB-Tethering

Thanks for your answer Jeko.

If I understand well: iOS/Android tethering + WiFi + LuCI -> impossible on MR3020.

Is it possible if you remove LuCI ?

I tried your previous firmware without LuCI but I was not able to connect to SSH after setting root password via Telnet
-> I had to restore with your new firmware using Telnet and Python local HTTP server.

However, even it is possible to add Wireless if you remove LuCI, I don't really know how to configure WiFi without LuCI ...

(Last edited by pyts01 on 19 Jul 2016, 06:35)

pyts01 wrote:

Thanks for your answer Jeko.

If I understand well: iOS/Android tethering + WiFi + LuCI -> impossible on MR3020.

Is it possible if you remove LuCI ?

You well understand, with iOS tethering packages, I'd just the space to add LuCi in the 4 MB of flash.
Else you can buy this WR703N with 16MB flash here:
http://www.ebay.com/itm/SLBoat-The-TL-W … 1078954797

pyts01 wrote:

I tried your previous firmware without LuCI but I was not able to connect to SSH after setting root password via Telnet
-> I had to restore with your new firmware using Telnet and Python local HTTP server.

This is not normal...

pyts01 wrote:

However, even it is possible to add Wireless if you remove LuCI, I don't really know how to configure WiFi without LuCI ...

You can find all you want in the wiki of openwrt.org like this:
https://wiki.openwrt.org/doc/uci/wireless

(Last edited by jeko on 19 Jul 2016, 12:31)

pyts01 wrote:

Maybe this one :

https://www.amazon.fr/TP-Link-TL-WR810N … PM1Q8RE6MS

Seems to be good :

https://wiki.openwrt.org/toh/tp-link/tl-wr810n?s[]=tl&s[]=wr810n

Will your firmware built for WR703N be compliant with this model or a new firmware is needed ?

Thanks a lot !

Yes but be careful, this model is apparently only supported in the last development build, as is not referenced in the last release 15.15.1 and before.

As this model as 8 MB of flash you can simply install openwrt firmware to have all functionality like wi-fi.
Next, setup an internet connexion then install my script and it will download and install all needed packages.

Thanks for your reply Jeko.

It seems to be unsafe for me to do all this stuff.

I think I will keep my MR3020 with your "no wireless" firmware that is working like a charm and use an (or several) Airport Express to share 4G connection over WiFi in my house (I believe WiFi network provided by an Airport Express will have a larger scope than the one provided by MR3020).

pyts01 wrote:

Thanks for your reply Jeko.
It seems to be unsafe for me to do all this stuff.

I've missed to mention that I've found another model like the MR3020 but with 8MB.
It's the NEXX WT3020F.
https://wiki.openwrt.org/toh/nexx/wt3020

It hard to buy this material in Switzerland too.
European merchant like Amazon or Ebay doesn't ship to Switzerland, so I order in China...
You can find the NEXX WT3020F here for example (14€ and free shipping, just waiting 2-3 week ;-)

pyts01 wrote:

I think I will keep my MR3020 with your "no wireless" firmware that is working like a charm and use an (or several) Airport Express to share 4G connection over WiFi in my house (I believe WiFi network provided by an Airport Express will have a larger scope than the one provided by MR3020).

I think too. Simply because those "mini" router was powered via USB that has limited power.