USB Tether -- The old school method:

evildean

Member
Mar 14, 2010
11
0
0
I frequently use wifi-tether. Because battery life suffers, and my phone heats up during extended sessions... I desired an alternative. After much research this is the USB tethering solution I found.

Tested and working on Win-XP and Linux.

1) connect phone and computer via USB cable. (Charging only. There are no other inputs needed.)

2) ADB shell into the phone and issue the "su" command. (I assume most will understand what I'm talking about!)

3) Issue the following command:
/system/bin/netsharing net on && echo 4 > /sys/devices/platform/msm_hsusb/usb_function_switch (two commands actually :p)

At this point the ADB shell automatically drops, and the computer indicates a successful USB connection. When I want to tear down the connection I do: Menu >> Settings >> Wireless and Networks. De-select "Internet Sharing" and every thing is back to normal.

This solution has proved reliable in my experience. The connection feels quicker than wifi-tether, and my phone battery thanks me. Let me know how it works out for you.

I attempted to make a bash script for issuing the command in step three. It would be nice to issue something like "usbt" instead of the much longer command needed. If anyone can tell me what I am doing wrong in this regard I would appreciate it.

Running:
beezy option 4
 
Last edited:
wow, way to get around the dirty error 67 message from sprint about internet sharing from the menu!!! works great on icedhoneybun!!

ive been looking for a free usb tether option, you rock!!!

Bash script would def be nice, thats a bit cumbersome to remember...lol

also, charge only no longer connects the adb device in honeybun, you have to use the sync option.
 
Last edited:
I just use a non-standard PRI (2.11) and then the built-in USB internet sharing works like a charm, every time.
 
im using PRI 1.70_003.

Im a little unclear on what pri is and used for.

What are the advantages/disadvantages to using a non-standard one? where can i get 2.11?
 
seems that updating the PRI with damage control and doing a nandroid restore would do the trick.

However it seems to be hit or miss whether is will break allot of the sprint apps.

Not a good fit for me.

I wonder if there is a way to build some kind of app/script to push the OPs shell command on the phone itself, rather than through ADB and avoid having to install the SDK.

what exactly does PRI stand for? cant seem to google it...
 
I frequently use wifi-tether. Because battery life suffers, and my phone heats up during extended sessions... I desired an alternative. After much research this is the USB tethering solution I found.

Tested and working on Win-XP and Linux.

1) connect phone and computer via USB cable. (Charging only. There are no other inputs needed.)

2) ADB shell into the phone and issue the "su" command. (I assume most will understand what I'm talking about!)

3) Issue the following command:
/system/bin/netsharing net on && echo 4 > /sys/devices/platform/msm_hsusb/usb_function_switch (two commands actually :p)

At this point the ADB shell automatically drops, and the computer indicates a successful USB connection. When I want to tear down the connection I do: Menu >> Settings >> Wireless and Networks. De-select "Internet Sharing" and every thing is back to normal.

This solution has proved reliable in my experience. The connection feels quicker than wifi-tether, and my phone battery thanks me. Let me know how it works out for you.

I attempted to make a bash script for issuing the command in step two. It would be nice to issue something like "usbt" instead of the much longer command needed. If anyone can tell me what I am doing wrong in this regard I would appreciate it.

Running:
beezy option 4


what are you doing wrong? wheres your script?

Code:
#!/bin/bash
# start USB tether woot!

cd ~/Desktop/Android/android-sdk-linux_86/tools
./adb kill-server
sudo ./adb start-server
./adb shell /system/bin/netsharing net on && echo 4 > /sys/devices/platform/msm_hsusb/usb_function_switch
exit

#done

theres mine i get

RTNETLINK answers: Address family not supported by protocol
RTNETLINK answers: Address family not supported by protocol
FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:372
FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:372

from that and if i separate the 2 commands i get:


line 7: /sys/devices/platform/msm_hsusb/usb_function_switch: No such file or directory

the file and directory DO exist. any ideas??
 
Last edited:
what are you doing wrong? wheres your script?

I named the following script "usbt" and pushed it to /system/xbin/

#!/bin/bash
/system/bin/netsharing net on && echo 4 > /sys/device
s/platform/msm_hsusb/usb_function_switch

I issued chmod 755 on the file.

Via connectbot the command "usbt" is not found. With or without su, and with the full path, results in not found!?
 
wow, way to get around the dirty error 67 message from sprint about internet sharing from the menu!!! works great on icedhoneybun!!

ive been looking for a free usb tether option, you rock!!!

Bash script would def be nice, thats a bit cumbersome to remember...lol

also, charge only no longer connects the adb device in honeybun, you have to use the sync option.

I'm happy you found this useful. Thank you for sharing the sync option tip regarding honeybun.
 
I named the following script "usbt" and pushed it to /system/xbin/

#!/bin/bash
/system/bin/netsharing net on && echo 4 > /sys/device
s/platform/msm_hsusb/usb_function_switch

I issued chmod 755 on the file.

Via connectbot the command "usbt" is not found. With or without su, and with the full path, results in not found!?

im trying the same i also tried using adb and i couldnt execute it there either. then i chmod it again while its on the phone and tried again. also tried ./usbt nothing... anybody?

and i re-read what i typed. i did NOT mean to say what are YOU doing wrong i meant whats are you doing and whats wrong.?
 
what are you doing wrong? wheres your script?

Code:
#!/bin/bash
# start USB tether woot!

cd ~/Desktop/Android/android-sdk-linux_86/tools
./adb kill-server
sudo ./adb start-server
./adb shell /system/bin/netsharing net on && echo 4 > /sys/devices/platform/msm_hsusb/usb_function_switch
exit

#done

theres mine i get

RTNETLINK answers: Address family not supported by protocol
RTNETLINK answers: Address family not supported by protocol
FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:372
FIX ME! implement getprotobyname() bionic/libc/bionic/stubs.c:372

from that and if i separate the 2 commands i get:


line 7: /sys/devices/platform/msm_hsusb/usb_function_switch: No such file or directory

the file and directory DO exist. any ideas??

I receive identical messages when issuing the commands, but the connection still comes up, and everything seems to work as expected.
 
Im going to check this out. @evildean Sweet that you got it working for ya.
 
I receive identical messages when issuing the commands, but the connection still comes up, and everything seems to work as expected.
works for me as well but only manually. i cant get the script to work under linux or windoze.... weird...
 
Im going to check this out. @evildean Sweet that you got it working for ya.

Thank you Beezy... your input is highly regarded!!
I'm assuming my inability to call a simple bash script from a "ConnectBot" command prompt is pedestrian???
Am I missing something obvious? Is there a better way?
I wish I had the skills to code a widget or icon that would execute the commands at the push of a button. :D
 
that would be awesome...i need this badly for my technology challenged clients that wont get internet so i can tether and update their os/proggies.....
 
If this could somehow be turned into a widget it would be life altering (well, almost)!. I'd like to be able to revert back to the stock Sprint PRI so Sprint specific apps work again. I'll keep an eye on this thread, good work guys!
 
lovin the wireless tether. it freezes when i disconnect but tethers beautifully. thing i don't like about the usb tether is the cable is finicky. when you move it it disconnects
 
yeah, the actual HTC cable has a little key/notch on one side, so it fits more snug...if you are using a standard cable, it like to jiggle lose...
 
ok, ive tried the scripts with both sh, and bash, no lovin...it wont run the intpreter. However, if you call "bash usbt" it will run, but errors out. im thinking its a permissioning issue. I picked apart the a2sd script (which runs fine and doesnt require su), and it has different permissions than 0755. Unfortunately, i dont know the CHMOD hex code to duplicate the permissions.

-rwxrwxrwx root root 10455 2008-08-01 08:00 a2sd
 
Last edited:

Latest posts

Trending Posts

Forum statistics

Threads
960,668
Messages
6,983,174
Members
3,164,543
Latest member
isaackse