A couple of notes, This is to do tethering using an Android G1 phone. This should work with all Android based devices that have Debugging over USB enabled, and a network stack that the Tetherbot app can talk to. These instructions are focused on the Ubuntu release of Linux.
First, I’m not talking about full tethering here. To do that requires root access. To get root access you have to install a kernel that is not distributed by T-Mobile. If you are using a device that does give you root access, there are other solutions available.
This Tethering solution basically puts together a socks proxy that you can use to surf the web with your G1 phone anywhere you can get a good cell signal. It also works perfectly well for a local wifi connection (not between the computer and the phone, but say between the phone and your home wifi AP, or at a coffee shop.) For the most part that’s great for testing, but I suspect that if you have a modern laptop with good USB 2.0 ports, that you either have a wifi adapter already you can plug in, or your laptop came with a WiFi connection you can probably use. If you are having problems with some proprietary drivers, this may be a temporary workaround, but you’ve just added a $200 wifi adapter to your kit. Seems a bit extravagant. Doesn’t it?
Start by following the instructions over at http://graha.ms/androidproxy/
If the instructions work, you’re done. I had to do a bit more.
In my case I ended up with the following problem:
./adb devices
List of devices attached
???????????? no permissions
First you need to have a file named adb_usb.ini in your ~/.android/ folder. You can create it with the command
echo "0x0e79" >> ~/.android/adb_usb.ini
As much as I would like to say that the next step is a drop kick, it’s a little bit more detailed. You may not need this. If after doing the above command you see a device identified by ‘./adb devices’ you’re done. However experience suggests that you will need to create a /etc/udev/rules.d/51-android.rules file with the usb maunfacturer ID for your phone included.
To get the manufacturer ID, run lsusb twice, once with your phone not attached to your computer, the other with it connected. The line that is added with the phone there should look something like:
Bus 002 Device 003: ID 0bb4:0c02 High Tech Computer Corp.
Obviously Bus and Device will depend upon which port it’s plugged into. The ID is in two parts, the part to the left of the colon is the manufacturer ID, the other is a per manufacturer device ID, but for what we are doing is not critical. So for the Android G1 phone, the part of the ID that we are interested in here is ’0bb4′
The rules file needs to contain the following:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Once the file has been created, I’ll leave it to you how, but
sudo echo SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666" > /etc/udev/rules.d/51-android.rules
should do the trick, you need to set up the permissions properly, and restart the udev process:
sudo chmod a+rx /etc/udev/rules.d/50-android.rules
sudo /etc/init.d/udev restart
Personally I recommend doing the above with the phone detached (except when testing with adb) and once udev has been restarted plugging your phone into your computer again.
This time when you run ./adb devices you should see something like:
./adb devices
List of devices attached
HT???GZ????? device
The specific numbers have been replaced with ‘?’ but if you see something beginning with HT, you’re probably well on your way.
I ran into one last issue with FireFox. It may have been the fault of the platform, but if you run into it this is the cure.
Basically once I had set all the above up, when I disconnected my lan connection, I would get a ‘server not found’ error from Firefox when attempting to navigate anywhere. The problem is that by default firefox will continue to do dns lookups through the OS DNS lookup resolver. Since that requires a network connection and on it’s own doesn’t recognize a Socks 5 connection as one, the connection doesn’t work.
So the fix? Install the FoxyProxy add on, and create an entry to browse using the proxy for all traffic. One of the check boxes is to do dns lookups through the proxy as well. Make sure it is checked.
Now go back to the instructions at http://graha.ms/androidproxy/ and you should be on your way.
Hope this is useful to someone besides me. Most of this page was written with a local lan connection. However final edits, and posting to the public occurred over a functioning foxyproxy tethered connection. It will work, it’s just a bit of a step by step process to get it going.