The Other Tether : The G1/Android as a Bluetooth PANU Client
Stop for a second to realize that your way of doing things is always the best way of doing things. If only for no one else.
I’ve been playing with a G1, mostly for Google Voice/Sipdroid and My Maps Editor (for an upcoming vacation). As I currently have a great plan with Sprint, and don’t want to drop the major coin required for the full voice and data package, I’ve got the G1 on the network with a pay-as-you-go Sidekick data plan. No, it doesn’t really work for much, except SMS. I have no need to make cellular calls, but I do want data while I’m out and about. The Sidekick plan does NOT work for data on a G1. It does register on the 3G/EDGE network, get an IP, set up the routes, and shoot, DNS even works. But you cannot get ‘out’ to anything. Yay T-Mobile for preventing me from giving you money you wouldn’t otherwise get at all, because lets face it, your network almost exists.
Thus my want for a BT PANU client. As it turns out, cupcake includes pand and bluetooth networking support is built into the kernel. Which is just about all you need. Well, you might need root too.
Enough blathering.
First, you need the MAC of your Bluetooth Network Access Point. I’m using Internet Sharing on Windows Mobile, so I just need my phone’s BT MAC, for instructional purposes, we’ll say it is: 00:15:81:3E:ED:02
Next create a shell script something like this:
#!/bin/bash pand --connect 00:15:81:3E:ED:02 sleep 1 dhcpcd -d bnep0 setprop net.dns1 192.168.0.1
That last line sets your DNS / Name Server, it might be different depending on your BT NAP. If you’re just using this at home instead of wireless because you’re bored or masochistic, then you’ll need to figure out what DNS info you need. I just connected to Internet Sharing with my netbook first and checked what DNS servers it was configured to use.
One other thing to note:
If you have wireless disabled, and don’t have any SIM card inserted, then as far as Android is concerned, you have NO network connection. Even after running the script above, only some Apps will work. Maps works fine, as does Google Voice, but the Browser complains on open, then works fine. Google Talk never opens at all. Inserting a SIM card that shows an active 3G connection avoids this, but if I figure out an easier way (to save on the losses of cellular radio) I’ll post it.
