LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.

Notices


Reply
  Search this Thread
Old 07-11-2011, 07:21 AM   #1
jmacloue
LQ Newbie
 
Registered: Apr 2009
Location: Kharkiv, UA
Distribution: Slackware
Posts: 18

Rep: Reputation: 7
Android + Slackware over Bluetooth


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?
 
Old 07-11-2011, 08:24 AM   #2
SeRi@lDiE
Member
 
Registered: Jun 2006
Location: /dev/null
Distribution: Slackware 13.1, Slackware 13.37, aptosid, rhel
Posts: 547
Blog Entries: 7

Rep: Reputation: 55
d00d thats way to much work.

Regardless of how you look at it you will need to root your phone... Android is some what worthless without root.
And rooting the phone is a lot more simpler than doing all that!
Any who... root your phone. Is not hard at all and can be done manually using adb in linux.

What version of android you are running?

once you have root all you will need is:

http://code.google.com/p/android-wifi-tether/


Some what helpful information on how to root your phone:

http://forum.xda-developers.com/showthread.php?t=742306

What I usually do is disassemble the windows batch scripts and take the rooting files and push them to temp under android and do exactly what the scripts are doing in the batch file but manually. It works. Though if you have no clue about Android, adb, and or linux you will be lost and could damage your phone so be warned I am not responsible
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware 13 bluetooth PAN 0rphu Slackware 1 10-03-2009 10:08 AM
Using USB bluetooth with slackware 12.0 vitalstrike82 Slackware 8 06-18-2009 11:27 AM
Slackware 12.0 and Bluetooth perry Slackware 2 08-07-2007 04:21 PM
Bluetooth in Slackware HOWTO drkstr Slackware 6 06-15-2006 04:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile

All times are GMT -5. The time now is 05:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration