FORUMS
Remove All Ads from XDA

Real Tethering via Bluetooth!

736 posts
Thanks Meter: 52
 
By JesusFreke, Inactive Recognized Developer on 27th November 2008, 06:37 AM
Post Reply Email Thread
29th November 2008, 07:23 PM |#11  
Disconn3ct's Avatar
Senior Member
Flag Washington, DC
Thanks Meter: 158
 
Donate to Me
More
Quote:
Originally Posted by parrothd

FYI..
Tethering via bluetooth I was only seeing about 70Kb/s, while Tethering via wifi I'm seeing 300+Kb/s.

Can anyone else reproduce this? (FYI it will share a wifi link but unfortunately, I'm in EDGE and my wifi is WPA2 .. so my wifi connectivity only lasts 5-10 seconds at a time, and edge is.. well.. edge..)
 
 
29th November 2008, 08:22 PM |#12  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Disconn3ct

Can anyone else reproduce this? (FYI it will share a wifi link but unfortunately, I'm in EDGE and my wifi is WPA2 .. so my wifi connectivity only lasts 5-10 seconds at a time, and edge is.. well.. edge..)

I can confirm this. I'm in an EDGE area this weekend, so I tested by sharing a Wifi connection. Speedtest on the phone gave 4 Mbps down. Sharing over BT gave 89 kbps down. Also, when I ping the phone while connected to the PAN, I get latency around 30-50ms. Latency to google.com using the shared Wifi was around 250ms.

This may not be related, but if you look in the git for the Dream platform, init.trout.rc has this section: (http://android.git.kernel.org/?p=pla...9f8f90;hb=HEAD)

Code:
  64 service hciattach /system/bin/hciattach \
  65     -n -s 115200 /dev/ttyMSM0 texas 115200 flow
  66     user bluetooth
  67     group bluetooth net_bt_admin
  68     disabled
I know that hciattach is the BT service, and it appears that its creating a 115k baud serial port. The module we load emulates an ethernet adapter (bnep0), but I'm not sure if this serial device has any relation. Anybody around here know what the deal with this is?
29th November 2008, 08:26 PM |#13  
JesusFreke's Avatar
OP Inactive Recognized Developer
Flag Dallas
Thanks Meter: 52
 
More
Hmm. that's a good point. I'll play around with it a bit today and see if it's related
7th December 2008, 05:31 PM |#14  
Disconn3ct's Avatar
Senior Member
Flag Washington, DC
Thanks Meter: 158
 
Donate to Me
More
Just a quick update on this, google is working on a faster bluetooth driver, which will (automagically) make this faster too.
7th December 2008, 07:13 PM |#15  
Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by parrothd

Hey, thanks for the tip about the calling the script. The connection speed sucks, but at least the setup is easier.. You still need to turn on bluetooth, and make it discoverable so windows can see the NAP and connect to it..

Here's my setup: I use dsnmasq for DHCP...
...
/data/local/bin/dnsmasq -x /data/local/bin/dnsmasq.pid

WOW! Nice job. Could you please put your compiled dnsmasq somethere?
8th December 2008, 12:06 AM |#16  
Member
Thanks Meter: 0
 
More
Strange thing. I setuped everything. Seeing iface on my phone via busybox ifconfig. Phone could ping himself via it's bluetooth IP.
Also PC could itself. Ifaces up and active on both sides.
But on PC I am having 0 recieved packets thru virtual bluetooth nic. While on phone i am having both RX and TX. And funny thing what RX on phone is exactly equal to TX on PC. So actually connection working but only one way...
WTF is what? Haven't even idea which way to look into this problem. Anyone have any idea about that?
8th December 2008, 02:12 AM |#17  
Senior Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by hmepas

WOW! Nice job. Could you please put your compiled dnsmasq somethere?

i didn't compile it, but it's available in the iptables thread, if you can't find it I'll post it, having said that, you can also use udhcpd from busybox as well...
8th December 2008, 02:42 AM |#18  
Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by parrothd

i didn't compile it, but it's available in the iptables thread, if you can't find it I'll post it, having said that, you can also use udhcpd from busybox as well...

Oh thanks. I found it easily.
Btw could explain those two lines in your script:
Code:
/data/local/bin/iptables -I INPUT -s 192.168.2.254 -j DROP
/data/local/bin/iptables -I FORWARD -s 192.168.2.254 -j DROP
any secret here? for me those lines is complete useless. Or it's just your local issue which you didn't clean up before publishing script?
8th December 2008, 04:29 PM |#19  
Senior Member
Thanks Meter: 3
 
More
They're not needed, but you may want them.

dnsmasq and probably busybox udhcp will only start if you have at least 1 ip available for DHCP assignment(as far as I can tell).

This allows anyone to connect to your G1 mobile when in ad-hoc wifi mode and get access to the internet. Probably something you don't want to allow, with the limited speed and caps.

I use dnsmasq to staticly assign my laptop 192.168.2.30(cux I'm lazy and don't want to manually assign my IP), while assigning everyone else that connects to my G1 IP 192.168.2.254 which I then drop all access via iptables, so they have no access.

If you can figure out how to get dnsmasq or busybox udhcp to provide only static IP assignments then this is not needed...

My dnsmasq.conf changes..

# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
dhcp-range=192.168.2.254,192.168.2.254,30m

# Always allocate the host with ethernet address 11:22:33:44:55:66
# The IP address 192.168.0.60
dhcp-host=00:13:ce:b7:a8:0e,192.168.2.30
8th December 2008, 06:03 PM |#20  
Senior Member
Thanks Meter: 3
 
More
I found that if you set the lease time to 0, dnsmasq will not assign an IP address unless it's statically assigned. You still should setup some filtering to keep people of your network, but most users won't bother trying to figuring that out.


# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
dhcp-range=192.168.2.254,192.168.2.254,0
5th January 2009, 01:43 AM |#21  
Junior Member
Thanks Meter: 1
 
More
Helper scripts for bluetooth tethering on G1 from Ubuntu
In case it's helpful to anyone, I got bluetooth tethering to work from my Ubuntu box to my G1. I wrote a few helper scripts that hopefully make the process easier on both ends. I posted the info at: http://joshuaredstone.blogspot.com/2...ubuntu-to.html. I know this is over bluetooth rather than wifi, but hopefully some of the bits will be useful to others here.
Cheers,
Josh
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes