What is the best way to tether an Android phone with a Slackware laptop over Bluetooth?
Here is how I got this done, it worked for me for some time but it doesn't seem to be even close to the best way.
I needed to use my smartphone (GSmart 1305) with a Slackware laptop to access the Internet and found that most such setups require firmware hacking / "rooting" the phone. The bad thing is that my GSmart is not a "mainstream" model so no ready "rooted" firmware are lying around so I gave PdaNet (
http://www.junefabrics.com/android/index.php) a try.
Well, unfortunately the guys at June Fabrics are not very Linux-friendly. They say to connect the phone with USB, install a Windows/MacOS application, press "Install to phone..." button somewhere - but what the heck, I thought? It's just to send an .apk file to the phone and install id there, no special application is needed for that. So I tried to download a Windows installer and unpack it.
Oops, they doesn't use MSI or InstallShield for the installation. Pity, unzip, unshield and cabextract cannot help to extract a tiny .apk file from the .exe so I had to use Wine.
During the install process the application asked me to connect the phone. This is the point where you actually need to switch to XTerm and copy a PdaNet.apk from $WINEPREFIX/drive_c/Program files/... directory - this is because if I choose to cancel the installation or the install application won't find the phone it will erase its files.
So, I grabbed the pdanet.apk, sent it to the phone (I used Bluetooth file transfer app for Android and obexfs on Slackware but any other way will do) and clicked it in File explorer. The application installed okay (you need to allow generic .apk installation in phone settings, of course) and asked me if I want to tether over USB or Bluetooth.
June Fabrics claim they don't support USB with Linux so I chose Bluetooth and fired sdptool to browse my phone. Hooray, it now has DUN service available! But blueman didn't succeed in automatically connecting to this service so I went further.
Okay, I'm not a big guru in BlueZ and stuff, so I tried to use dund with no success and fell back to rfcomm. rfcomm was able to attach me to the phone:
rfcomm bind rfcomm0 00:11:22:xx:xx:xx
rfcomm connect rfcomm0 00:11:22:xx:xx:xx 3
It figures that the last command parameter, channel no, 3 in my case is actually needed - you can see what channel should be used in sdptool output. For some reason rfcomm doesn't choose the correct channel by itself... A minor problem, I suppose.
Then I tried to fire up the pppd:
/usr/sbin/pppd passive noauth noccp lcp-echo-failure 0 usepeerdns nodetach debug rfcomm0
This set of parameters worked for me. The connection was established and the interface was brought up.
It seems that PdaNet uses some custom user-level PPP implementation to just bridge the frames from Bluetooth to phone's mobile connection and back. This implementation doesn't support PPP compression and even doesn't respond to CCP frames which makes pppd exit without bringing up the link - that's why I used noccp parameter. It also doesn't support LCP keep-alive so pppd will exit after approx. 2 minutes because of timeout - that's why lcp-echo-failure 0 is needed. Otherwise it works rather fine - I have my phone's IP address on the interface and able to use at least HTTP/HTTPS and SSH connections which is sufficient for my needs.
A minor drawback is that I cannot use external DNS services - just ones provided by my operator work. It may be a PdaNet or my operator limitation, I didn't check.
So, to summarize, this is how I used my non-rooted smartphone (GSmart 1305 with Russian 2.1 firmware), PdaNet 3.00 and Slackware64 13.1:
1. Get PdaNet300A.exe from
http://junefabrics.com/bin/PdaNetA300.exe
2. Use Wine to start it and grab PDANET.APK from the program directory as soon as it is extracted there.
(you may also ask your friend with Windows or Mac to do this for you)
3. Install PDANET.APK to the smartphone and start it
4. Choose Bluetooth tethering in PdaNet and switch to your laptop
5. Make sure the devices are already paired
6. Use sdptool to find out the BT address (e.g., 00:11:22:xx:xx:xx) and channel (e.g., 3) for DUN service
7a. (not sure if it's required) Bind a terminal with rfcomm: rfcomm bind rfcomm0 00:11:22:xx:xx:xx
7. Connect the terminal with rfcomm: rfcomm connect rfcomm0 00:11:22:xx:xx:xx 3
8. If the connect was successful (rfcomm said so and told you to Ctrl-C when you're done) start the pppd: /usr/sbin/pppd noauth noccp lcp-echo-failure 0 usepeerdns 230400 rfcomm0 nodetach debug
9. Try to browse the Internet - it should work now
But, well, this is just not very user-friendly, and also requires Wine or Windows just to get the small 100K file! So - does anyone know the better way to do this without rooting the phone and typing so much in the console?