[Epic 4G Themes] mkasick:
3/3/11 Update: Added an optional kernel patch against EB13 to fix the RNDIS/ADB bug mentioned below. It's not necessary for the use of this app, it still works fine on EB13 stock.

Attached is a build of Wired Tether v1.4 modified to support RNDIS (USB tethering) on (EB13) Froyo Epics. Also attached are the source patches against the v1.4 sources.

This is an update of the previous Eclair version of Wired Tether, but since the kernel patch is no longer necessary in Froyo I've split this into a new thread.

And yes, Froyo does come with USB tethering out of the box. However, in EB13 many folks may find that with the built-in tethering they can only tether to wifi, and attempts to tether to 3G (and possibly 4G) results in error. This Wired Tether client avoids said "errors."

Directions:

(Windows only) Install the Samsung USB drivers. No other drivers are needed for Windows 7, and I think Windows XP SP3.

Make sure the USB cable is unplugged before starting the tether client.

Start "Wired Tether" and "Press to start tethering."

Grant the Superuser Request (if your su requires it).

Make sure tethering has started, you should see green/red "Down/Up" numbers at the bottom of the screen.

Attach the USB cable.

Select "Charging" mode from the "Select USB mode" menu.

Tether!

When finished:

Detach the USB cable.

"Press to stop tethering."

Grant the Superuser Request (if your su requires it).

Exit the "Wired Tether" program.

Reattach the USB cable if you want to use mass-storage.

Note, tethering should be used with "USB debugging" disabled. This is due to a bug in the Froyo (including EB13) kernel's USB gadget driver whereby if RNDIS is enabled "on top of" ADB mode (and subsequently disabled), when "USB debugging" is later turned off it reverts back to RNDIS mode instead of mass storage, whoops! If you get stuck in RNDIS mode, cycling Wired Tether once should fix it. Alternatively, if you always run with "USB debugging" enabled, this bug shouldn't matter. Keep in mind, neither mass-storage support nor ADB will be availble while actively tethering.

Troubleshooting:

If the client force closes on you and you're using a ROM with android-wifi-tether preinstalled, then there is a library conflict. Remove android-wifi-tether from /system, and most importantly, delete (or rename) /system/lib/libnativetask.so, then android-wired-tether should work. If you want both wifi & wired tether, reinstall android-wifi-tether from the market. This will make each application use its own library so there's no more conflicts. See this post for more details.

Technical details:

The Froyo kernel provides RNDIS support via a sysfs switch, much like the previous Eclair kernel patch. Samsung just happens to use a different name ("tethering" instead of "rndis_enable"). Oh, and they introduced a silly bug that results in weird behavior if you tether with "USB debugging" enabled--see above.

You may toggle this variable manually, for example, if you wanted to use the RNDIS interface for other purposes. Just be sure to toggle when the USB cable is unplugged:

su
echo -n 1 > /sys/devices/virtual/sec/switch/tethering # Enable RNDIS.
echo -n 0 > /sys/devices/virtual/sec/switch/tethering # Disable RNDIS, reenable UMS (or ADB).

The Wired Tether patch simply toggles the sysfs varible upon starting and stopping tethering.

Mirror links (does not require forum login):

wired-tether-1.4-epic-4.apk

wired-tether_use_stable_api.diff

wired-tether_clamp_mss.diff

wired-tether_rndis_enable.diff

epic_adb_vtp_fix-EB13.diff