maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC) (https://talk.maemo.org/showthread.php?t=58570)

9000 2011-04-02 06:45

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I see. I made a few changes to run dnsmasq as daemon.

I've updated the script on first page. Note that I change the network from 192.168.1 to 192.168.3 to avoid conflicting with WiFi. Please try again.

jschan 2011-04-02 16:36

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
heh, sounds like we've done some of the same work. I'm using custom scripts at this point based off the dbus script tethering example and your script. In all, it's 3 files at the moment:
1) an enhanced version of your script that uses daemons and takes params like start/stop and optional external interface to tether to (bnep0 or wlan0 generally, defaulting to bnep0 if one isn't supplied).
2) a dbus script used as a front controller to call the above script with the correct params (if neither the wlan or bnep interfaces are up, it doesn't try to setup tethering)
3) a dbus config script to trigger the front controller script

So far it's working great, though the scripts aren't elegant at all. If I get some time to clean them up and test properly, i'll post them.

Edit: fixed some typos... writing this from the xoom is pretty error prone on this virtual keyboard.

9000 2011-04-03 01:26

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
FYI.

1) It's serving the host IP address rather than interface in the dbus version. I don't set lease time as I'm supposed to know who do I serve.
2) the dbus version is triggered by preset event
3) aye

jschan 2011-04-03 09:22

Re: [HOWTO] N900 Bluetooth-PAN Tethering (tested with a WiFi XOOM!)
 
1 Attachment(s)
I cleaned up my scripts a bit, added some documentation, and threw them into the attached tar file.

The version of the script here includes the following new features:
- Adds in support for multiple concurrent tethering clients (tested using a ThinkPad and a XOOM at the same time via bluetooth PAN)
- Adds in support for disabling tethering for a particular client
- Automatically picks the Internet interface (though it's pretty dumb about it)
- Works with included file to get dbus-scripts to automatically setup tethering on new connections
- Provides additional error checks and messages (though these could definitely use more work)

It's missing the pick-which-connection feature you have in the current version of your script, though I did try to make the entire script pretty verbose for easy modifications.

Outside of that, using the main script is very similar to your current script except that you have to specify whether you want to "start" or "stop" the tethering. The requirements and setup is pretty much what you have already written about in great detail in the first post.

Here's the script for each reference (it's also in the attached tar file):
Code:

#!/bin/sh
#
# /opt/tether/tether.sh
#
# Written by jschan @ http://talk.maemo.org
#
# Code snippets and inspiration from:
#  - http://wiki.maemo.org/DbusScripts
#  - http://talk.maemo.org/showthread.php?t=58570
#  - http://code.google.com/p/n900ipv6/source/browse/share/pan
#
# Enables tethering over USB network and Bluetooth PAN.
#
# usage: ./tether.sh start|stop [internal_interface]
#
# Examples:
#  - "./tether.sh start" - Enables tethering on a single PAN client when an Internet connection is active
#  - "./tether.sh stop" - Disables tethering on a single PAN client (assumes the client is on bnep0)
#  - "./tether.sh start bnep1" - Enables tethering on a 2nd PAN client when an Internet connection is active
#  - "./tether.sh stop bnep1" - Disables tethering on the 2nd PAN client, without interfering with the 1st
#
# Notes:
#  - Tested to work with multiple Bluetooth PAN clients including a WiFi-only XOOM
#  - Tested to work in conjuction with a dbus-scripts to automate tethering setups
#  - Doesn't currently have support for multiple concurrent Internet interfaces
#    such as an IPv4 grps connection and a seperate IPv6 grps connection.
#  - IPv6 isn't supported yet... (Waiting for T-Mobile IPv6 activation)
#

DEFAULT_INTERFACE="bnep0"
PAN_NETWORK_PREFIX="10.20"
USB_NETWORK_PREFIX="10.30"
INTERFACE_OCTET="88"
DHCP_MIN_IP_OCTET="100"
DHCP_MAX_IP_OCTET="127"
DHCP_MAX_LEASE_TIME="1h"
PRIMARY_DNS="8.8.8.8"
SECONDARY_DNS="8.8.4.4"

if [ $# -lt 1 ] || [ $# -gt 2 ]; then
        echo "usage: $0 start|stop [internal_interface]"
        exit 1
fi

if [ -z "$2" ]; then
        INTERFACE="$DEFAULT_INTERFACE"
else
        INTERFACE="$2"
fi

print_message () {
        echo "$(date) $*"
              run-standalone.sh dbus-send \
                --type=method_call \
                --dest=org.freedesktop.Notifications \
                /org/freedesktop/Notifications \
                org.freedesktop.Notifications.SystemNoteInfoprint \
                string:"$*"
}
#set -x

INTERFACE_TYPE="$(echo $INTERFACE | sed 's/\([a-z]*\)[0-9]*/\1/')"
INTERFACE_NUMBER="$(echo $INTERFACE | sed 's/[a-z]*\([0-9]*\)/\1/')"

case $INTERFACE_TYPE in
        bnep )
                NETWORK_PREFIX="$PAN_NETWORK_PREFIX.$INTERFACE_NUMBER"
        ;;
        usb )
                NETWORK_PREFIX="$USB_NETWORK_PREFIX.$INTERFACE_NUMBER"
        ;;
        * )
                # Notify no active Internet connection
                print_message "Unsupported interface type: $INTERFACE_TYPE"
                exit 1
        ;;
esac

INTERFACE_IP="$NETWORK_PREFIX.$INTERFACE_OCTET"
NETMASK="255.255.255.0"
EXTERNAL_INTERFACE="$(ifconfig | awk '/(gprs|wlan)/ {print $1}' | head -1)"

DHCP_MIN_IP="$NETWORK_PREFIX.$DHCP_MIN_IP_OCTET"
DHCP_MAX_IP="$NETWORK_PREFIX.$DHCP_MAX_IP_OCTET"
DHCP_GATEWAY="$INTERFACE_IP"

MESSAGE="Tethering from $INTERFACE to $EXTERNAL_INTERFACE"
ACTIVATION_MSG="$MESSAGE activated"
DEACTIVATION_MSG="$MESSAGE deactivated"
DNSMASQ_PID_NAME="dnsmasq.$INTERFACE"
DNSMASQ_PID_FILE="/var/run/$DNSMASQ_PID_NAME.pid"

if [ "$1" == "start" ]; then
        INTERFACE_EXISTANCE_CHECK="$(ifconfig -a | grep $INTERFACE | awk '{print $1}')"
        if [ -z "$INTERFACE_EXISTANCE_CHECK" ]; then
                # Notify no active Internet connection
                print_message "$INTERFACE does not exist"
                exit 1
        fi

        if [ -z "$EXTERNAL_INTERFACE" ]; then
                # Notify no active Internet connection
                print_message "Tethering request from $INTERFACE recieved"
                exit 1
        fi

        # Setup interface
        ifconfig $INTERFACE down 2> /dev/null
        ifconfig $INTERFACE up
        ifconfig $INTERFACE $INTERFACE_IP netmask $NETMASK

        # Load modules
        modprobe ipt_MASQUERADE

        # flush old iptables rules
        iptables --flush
        iptables --table nat --flush

        # Setup NAT
        iptables --out-interface $EXTERNAL_INTERFACE \
                --table nat \
                --append POSTROUTING \
                --jump MASQUERADE

        # Enable IP forwarding
        #echo 1 > /proc/sys/net/ipv4/ip_forward
        echo 1 > /proc/sys/net/ipv4/conf/$INTERFACE/forwarding
        echo 1 > /proc/sys/net/ipv4/conf/$EXTERNAL_INTERFACE/forwarding

        # Setup DNS and DHCP
        start-stop-daemon \
                --exec /usr/sbin/dnsmasq \
                --pidfile $DNSMASQ_PID_FILE \
                --start -- \
                        --interface=$INTERFACE \
                        --listen-address=$INTERFACE_IP \
                        --except-interface=lo \
                        --bind-interfaces \
                        --pid-file=$DNSMASQ_PID_FILE \
                        --dhcp-range=$DHCP_MIN_IP,$DHCP_MAX_IP,$DHCP_MAX_LEASE_TIME \
                        --dhcp-option=1,$NETMASK \
                        --dhcp-option=3,$DHCP_GATEWAY \
                        --dhcp-option=6,$PRIMARY_DNS,$SECONDARY_DNS

        # Notify user bluetooth tethering is active
        print_message "$ACTIVATION_MSG"

elif [ "$1" == "stop" ]; then

        start-stop-daemon \
                --exec /usr/sbin/dnsmasq \
                --pidfile $DNSMASQ_PID_FILE \
                --stop

        # Bring down the interface
        ifconfig $INTERFACE down 2> /dev/null

        # Disable IP forwarding for tethered interface
        if [ -f "/proc/sys/net/ipv4/conf/$INTERFACE/forwarding" ]; then
                echo 0 > /proc/sys/net/ipv4/conf/$INTERFACE/forwarding 2> /dev/null
        fi

        # Notify user bluetooth tethering is inactive
        print_message "$DEACTIVATION_MSG"

        # Disable external interface IP forwarding if appropriate
        DNSMASQ_CHECK="$(ps -eaf | grep 'dnsmasq' | grep -v -e '127\.0\.0\.1' -e 'grep')"
        if [ -z "$DNSMASQ_CHECK" ]; then
                echo "$(date) No more clients tethered--disabling all forwarding"
                echo 0 > /proc/sys/net/ipv4/conf/$EXTERNAL_INTERFACE/forwarding
                echo 0 > /proc/sys/net/ipv4/ip_forward
        fi

else

        echo "unknown argument: $1"
        echo "usage: $0 start|stop [internal_interface]"
        exit 1

fi

If you want to install my scripts, just install dbus-scripts if you haven't already, untar the attached tar file into a new /opt/tether directory, copy the "tether-dbus-config" file into the /etc/dbus-scripts.d directory, and restart dbus-scripts.

Thanks again for all of you help getting me over the humps while I was working on this, 9000. I was thinking about returning this XOOM if I couldn't tether it to the n900, but I'm digging it now... :)

9000 2011-04-03 11:16

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Well done jschan. ^^

jschan 2011-04-08 08:47

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
found some more docs about calls on the dbus: http://wiki.maemo.org/Phone_control#...ved_connection

apparently, if you don't already have a data connection open, you can open one. unfortunately, it looks like it requires user specific data, though i'm sure a gconftool call along with some combination of grep and awk could probably generalize it.

anyhow, i updated my script with it so that it makes the connection without having the prompt for a connection. the important parts are as follows:

Code:

DEFAULT_IAP_ID="***SEE DOCS ABOVE***"
...
EXTERNAL_INTERFACE="**CHECK***"
if [ -z "$EXTERNAL_INTERFACE" ]; then
        print_message "Establishing Default Connection"
        dbus-send --system --type=method_call \
                --dest=com.nokia.icd /com/nokia/icd \
                com.nokia.icd.connect \
                string:$DEFAULT_IAP_ID uint32:0

        EXTERNAL_INTERFACE="**CHECK AGAIN***"
        if [ -z "$EXTERNAL_INTERFACE" ]; then
                # Notify no active Internet connection
                print_message "Unable to establish tether"
                exit 1
        fi
fi
...

cheers

9000 2011-04-08 16:18

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by jschan (Post 984091)
found some more docs about calls on the dbus: http://wiki.maemo.org/Phone_control#...ved_connection

apparently, if you don't already have a data connection open, you can open one. unfortunately, it looks like it requires user specific data, though i'm sure a gconftool call along with some combination of grep and awk could probably generalize it.

anyhow, i updated my script with it so that it makes the connection without having the prompt for a connection. the important parts are as follows:

Code:

DEFAULT_IAP_ID="***SEE DOCS ABOVE***"
...
EXTERNAL_INTERFACE="**CHECK***"
if [ -z "$EXTERNAL_INTERFACE" ]; then
        print_message "Establishing Default Connection"
        dbus-send --system --type=method_call \
                --dest=com.nokia.icd /com/nokia/icd \
                com.nokia.icd.connect \
                string:$DEFAULT_IAP_ID uint32:0

        EXTERNAL_INTERFACE="**CHECK AGAIN***"
        if [ -z "$EXTERNAL_INTERFACE" ]; then
                # Notify no active Internet connection
                print_message "Unable to establish tether"
                exit 1
        fi
fi
...

cheers

You can use the following one-liner to get the IAP:

Code:

for i in `gconftool -R /system/osso/connectivity/IAP | grep /system/osso/connectivity/IAP/ | sed -e "s:\(.*\)\:\(.*\):\1:"`; do if [ "`gconftool -g $i/type`" == "GPRS" ]; then IAP=$i; fi; done
I assumed by "default" you mean "GPRS".

anapospastos 2011-04-21 23:58

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I succesfully paired my sony ericsson k850 to N900. I ve had some problems when I tried it a couple of months ago but now I made it. Changes of first post may helped in this and especially ip settings. Thank you 9000.

ToniA 2011-04-29 09:17

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Thanks guys, this is really cool. I was already quite desperate after having tried out the Joikuspot and normal Bluetooth (DUN profile) pairing between the Xoom and the N900.

I still have one minor issue though. Even on a freshly flashed PR1.3 (I also reflashed the eMMC content) the dbus-scripts do not seem to work at all, i.e. it very much looks like I don't get any events. So right now I'm running the tether.sh script manually.

Any ideas where to look at? I tried to debug (http://wiki.maemo.org/DbusScripts#Th...l_--debug_flag), but couldn't see any Bluetooth-related events.

9000 2011-04-29 09:43

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Have you followed the configuration instructions in the corresponding page? ( http://wiki.maemo.org/DbusScripts )

jschan 2011-05-10 05:15

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Did you also reboot or restart the dbus daemon after copying the tether dbus configuration script into place? It's a long shot given that the debug command launches a new instance and you aren't seeing anything, but I thought I'd ask...

ToniA 2011-05-19 09:49

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Well, I'm running this in the xterm as root:

Code:

/usr/bin/run-standalone.sh dbus-scripts --debug --session
but all I get is this (new printout every few seconds) while I connect to the Bluetooth tether (the BT icon does change color to indicate the connection state changes)

Code:

============
Arg 1: :1.31
Arg 2: com.nokia.modest
Arg 3: com.nokia.modest
Arg 4: GetUnreadMessages
============
Arg 1: :1.311
Arg 2: :1.31


9000 2011-05-24 17:49

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
@ToniA do you have any new update on using dbus? BTW, you're reminded that the dbus is not a pre-requisite on making Bluetooth-PAN tethering. You could still use the original version in #1.

The whole meaning of using Bluetooth-PAN is its extreme low power consumption. If you've to build an automatic hotspot as such, you'd better build a WiFi hotspot instead.

ToniA 2011-05-25 08:24

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Well, nothing new, I'm afraid. I don't really know where to start off on debugging the dbus-scripts.

The whole use case is to be able to use N900 as the modem for a Wifi-only Xoom. The tethering works fine, it's just that I need to run the 'tether.sh' script manually, instead of having dbus-scripts doing it for me.

9000 2011-05-25 08:58

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by ToniA (Post 1014937)
Well, nothing new, I'm afraid. I don't really know where to start off on debugging the dbus-scripts.

The whole use case is to be able to use N900 as the modem for a Wifi-only Xoom. The tethering works fine, it's just that I need to run the 'tether.sh' script manually, instead of having dbus-scripts doing it for me.

Or you could create a screen icon with Queen Beecon Widget. As I said before, the whole point of Bluetooth-PAN tethering is to tether at minimum power consumption. If you've to add extra layer of process just to make it running automatically, I'd rather recommend WiFi hotspot.

Thanks for your feedback. You might want to raise your question on dbus-script in a separate post for more help as the issue you've encountered seem to be a general dbus-script setup problem rather than issues on Bluetooth-PAN or tethering.

ToniA 2011-06-03 14:49

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I'm such an idiot... I can't believe in fell into this newbie trap of not having the executable bit turned on for the /usr/bin/tethering.sh.

It works like charm now. Thanks guys!

And yes, the Bluetooth over PAN is exactly what I need. That's the only way to tether the Motorola XOOM into a Nokia phone, for example at the summer cottage, or on the road.

Ardraaken 2011-06-08 11:38

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Hi Guys,

Some good work here on getting the Xoom to tether and run with the N900 :) I bought the Wifi only Xoom also with the express intention of tethering it to my N900 but didn't realise it's limitations with ad-hoc networking until too late :(

I've been trying to get the N900/Xoom tether working on mine and have followed the instruction given as closely as possible but I'm a total noob at linux so some if this is totally confusing for me. I started off following the installation instructions from 9000's original post but ran into a problem that I couldn't find iptables to install on the N900, my pc connects to my N900 and I can join the PAN however I get no internet connection, is this because iptables isn't installed and if so where can I download it?

On the plus side I can now select Tether in my Xoom's Bluetooth connection just still can't use the net :(

9000 2011-06-08 12:35

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by Ardraaken (Post 1024955)
Hi Guys,

Some good work here on getting the Xoom to tether and run with the N900 :) I bought the Wifi only Xoom also with the express intention of tethering it to my N900 but didn't realise it's limitations with ad-hoc networking until too late :(

I've been trying to get the N900/Xoom tether working on mine and have followed the instruction given as closely as possible but I'm a total noob at linux so some if this is totally confusing for me. I started off following the installation instructions from 9000's original post but ran into a problem that I couldn't find iptables to install on the N900, my pc connects to my N900 and I can join the PAN however I get no internet connection, is this because iptables isn't installed and if so where can I download it?

On the plus side I can now select Tether in my Xoom's Bluetooth connection just still can't use the net :(

You must install iptables, alongside with all the pre-requisites as listed in the instruction for this script to work.

In order to install iptables, you need the kernel power; and to install kernel power, you need to enable the extras-devel repository in application manager and then update the package listing.

Also, this script requires root to run, so you need install rootsh as well. Please go through the instructions again, especially the pre-req part.

I am on the move so I cant give you further help atm. You would like to research a bit on how to enable extras-devel repository. Hope this helps.

Ardraaken 2011-06-08 13:08

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Sorry I might not have been overly clear...

I've installed everything from the pre-req's with the exception of iptables. I have access to Extras-Devel (set it up from day one) and have Kernel Power installed from a previous attempt to tether using MobileHotspot unfortunately iptables package isn't showing up in the list of apps for me so I'm unable to install it.

Appreciate the quick response 9000, thanks :)

mrwormp 2011-06-08 13:13

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
try apt-get install iptables from xterm

9000 2011-06-08 13:24

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by Ardraaken (Post 1025019)
Sorry I might not have been overly clear...

I've installed everything from the pre-req's with the exception of iptables. I have access to Extras-Devel (set it up from day one) and have Kernel Power installed from a previous attempt to tether using MobileHotspot unfortunately iptables package isn't showing up in the list of apps for me so I'm unable to install it.

Appreciate the quick response 9000, thanks :)

I just checked iptables is in extras. Please show me the output of thed following command:
Code:


cat /etc/apt/sources.list.d/hildon-application-manager.list


Ardraaken 2011-06-08 13:37

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by mrwormp (Post 1025025)
try apt-get install iptables from xterm

Was just coming back to post that I'd just done that...

Question:

How do I get the
Code:

echo "/home/user/bluetooth-pan.sh" | sudo gainroot
command to run in Xterm as I can't figure out how to create the | symbol.

9000 2011-06-08 14:34

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by Ardraaken (Post 1025042)
Was just coming back to post that I'd just done that...

Question:

How do I get the
Code:

echo "/home/user/bluetooth-pan.sh" | sudo gainroot
command to run in Xterm as I can't figure out how to create the | symbol.

You could just run /home/user/bluetooth-pan.sh as root. Type root to enter root shell.

Or you could copy&paste from browser to the command line during Queen Beecon Widget creation.

jschan 2011-06-10 04:46

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by HRH_H_Crab (Post 870674)
The wiki doesn't actually mention anything about maemo-pan.
It just says if you remove "network" from the disabled plugins list in the bluetooth main.conf then PAN will work.

I'm going to install iptables and use your script and manually configure the network on both sides and see where that gets me.

Changing the subject totally, I lived in HK from 1977 until the early '90s!

Awesome place! ;)

Thanks to this info and something I believe I read from 9000 about not needing pc-connectivity-manager and sixaxis conflicts, I have both bluetooth tethering and sixaxis support working in parallel. Summary is just do as Crab suggested above: remove the offending 'network' entry and don't install pc-connectivity-manager. If you already did install it, however, just go into /etc/bluetooth/main.conf and uncomment the DisablePlugins line while removing 'network' from the list of plugins to disable.

Ardraaken 2011-06-12 11:18

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Thanks for the help guys, still not been able to get this working but I ended up unlocking/rooting my Xoom and replacing the supplicant file so now I can see Ad-Hoc networks and use the MobileHotspot app whilst running 3.1 :)

youth 2011-06-16 23:12

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Are there special steps to making this work with an Android Honeycomb tablet? I've been trying the steps in the 1st post, but it hasn't been working. I'm not too familiar with Linux (got far enough to get the PAN tethering has been turned on msg but no net connection) so if there are special steps can they be listed complete in one post.

9000 2011-06-17 00:17

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by youth (Post 1030572)
Are there special steps to making this work with an Android Honeycomb tablet? I've been trying the steps in the 1st post, but it hasn't been working. I'm not too familiar with Linux (got far enough to get the PAN tethering has been turned on msg but no net connection) so if there are special steps can they be listed complete in one post.

Go to root shell in xterminal. Run the script there and then show us the output.

9000 2011-06-18 18:06

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
@youth I just come across it. The second part about Xoom might help you find where to open tethering - provided that the N900 script is running fine which I expected you to show me for diagnosis.

http://www.droid-life.com/2011/03/01...riginal-droid/

Hope this helps.

youth 2011-06-19 16:48

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 1031540)
@youth I just come across it. The second part about Xoom might help you find where to open tethering - provided that the N900 script is running fine which I expected you to show me for diagnosis.

http://www.droid-life.com/2011/03/01...riginal-droid/

Hope this helps.

I can pair the devices & open tethering but no net connection.
Here is what shows in xterminal.

Code:

Nokia-N900-42-11:/home/user# echo "/home/user/bluetooth-pan-tethering.sh" | gainroot
Root shell enabled
+ IP_ADDR=192.168.3.1
+ NETMASK=255.255.255.0
+ DHCP_RANGE=192.168.3.100,192.168.3.127
+ RUNFILE=/var/run/btpan_tethering.pid
+ DNSMASQ=/usr/sbin/dnsmasq
+ modprobe ipt_MASQUERADE
+ iptables -F
+ iptables -t nat -F
+ iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+ echo 1
+ ifconfig bnep0 down
+ ifconfig bnep0 up
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up
+ start-stop-daemon -S -p /var/run/btpan_tethering.pid -m -b -x /usr/sbin/dnsmasq -- -k -I lo -z -a 192.168.3.1 -F 192.168.3.100,192.168.3.127 -b
+ run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:Bluetooth PAN Activated
Nokia-N900-42-11:/home/user#


9000 2011-06-19 18:11

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by youth (Post 1032144)
I can pair the devices & open tethering but no net connection.
Here is what shows in xterminal.

Code:

Nokia-N900-42-11:/home/user# echo "/home/user/bluetooth-pan-tethering.sh" | gainroot
Root shell enabled
+ IP_ADDR=192.168.3.1
+ NETMASK=255.255.255.0
+ DHCP_RANGE=192.168.3.100,192.168.3.127
+ RUNFILE=/var/run/btpan_tethering.pid
+ DNSMASQ=/usr/sbin/dnsmasq
+ modprobe ipt_MASQUERADE
+ iptables -F
+ iptables -t nat -F
+ iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+ echo 1
+ ifconfig bnep0 down
+ ifconfig bnep0 up
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up
+ start-stop-daemon -S -p /var/run/btpan_tethering.pid -m -b -x /usr/sbin/dnsmasq -- -k -I lo -z -a 192.168.3.1 -F 192.168.3.100,192.168.3.127 -b
+ run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:Bluetooth PAN Activated
Nokia-N900-42-11:/home/user#


Please show me the routing table on your N900 side:

Code:

root
route


youth 2011-06-19 20:34

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Code:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 bnep0


9000 2011-06-20 01:20

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by youth (Post 1032273)
Code:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 bnep0


I don't see any gprs connection there. How does your N900 connect to Internet?

youth 2011-06-20 02:05

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 1032354)
I don't see any gprs connection there. How does your N900 connect to Internet?


3g with t-mobile

I use it regularly with my laptop using BT DUN. I was hoping it would be just as easy with these honeycomb tablets.

9000 2011-06-20 02:19

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by youth (Post 1032365)
3g with t-mobile

I use it regularly with my laptop using BT DUN. I was hoping it would be just as easy with these honeycomb tablets.

Android is not (yet) comparable to PC in terms of connectivity. People has to wait til Android 3.x (Honeycomb) to have Bluetooth PAN profile included in the connection settings. (and good luck with DUN) Before that, people used to root and tinker to get Bluetooth PAN/DUN work. So, consider yourself lucky to have gotten a honeycomb, otherwise you might have to root yours like others. ;)

Back to your issue, the script is enabling your N900 to supply Internet to PAN peers. So at least you must have an Internet connection on N900 before your peers could make use of it.

I just re-check the script and it should prompt you for Internet connection first. Was it failed to connect to Internet on N900? Please check by browsing with your N900.

youth 2011-06-20 02:50

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
I tried it again enabling the connection first & this is what I get & it never prompts me for a connection to choose. Internet browsing within the phone works.

Code:

Nokia-N900-42-11:/home/user# echo "/home/user/bluetooth-pan-tethering.sh" | gainroot
Root shell enabled
+ IP_ADDR=192.168.3.1
+ NETMASK=255.255.255.0
+ DHCP_RANGE=192.168.3.100,192.168.3.127
+ RUNFILE=/var/run/btpan_tethering.pid
+ DNSMASQ=/usr/sbin/dnsmasq
+ modprobe ipt_MASQUERADE
+ iptables -F
+ iptables -t nat -F
+ iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+ echo 1
+ ifconfig bnep0 down
ifconfig: SIOCGIFFLAGS: No such device
+ ifconfig bnep0 up
ifconfig: SIOCGIFFLAGS: No such device
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up
ifconfig: SIOCSIFADDR: No such device
+ start-stop-daemon -S -p /var/run/btpan_tethering.pid -m -b -x /usr/sbin/dnsmasq -- -k -I lo -z -a 192.168.3.1 -F 192.168.3.100,192.168.3.127 -b
+ run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:Bluetooth PAN Activated
Nokia-N900-42-11:/home/user# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default * 0.0.0.0 U 0 0 0 gprs0
Nokia-N900-42-11:/home/user#


9000 2011-06-20 04:06

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by youth (Post 1032383)
I tried it again enabling the connection first & this is what I get & it never prompts me for a connection to choose. Internet browsing within the phone works.

Code:

Nokia-N900-42-11:/home/user# echo "/home/user/bluetooth-pan-tethering.sh" | gainroot
Root shell enabled
+ IP_ADDR=192.168.3.1
+ NETMASK=255.255.255.0
+ DHCP_RANGE=192.168.3.100,192.168.3.127
+ RUNFILE=/var/run/btpan_tethering.pid
+ DNSMASQ=/usr/sbin/dnsmasq
+ modprobe ipt_MASQUERADE
+ iptables -F
+ iptables -t nat -F
+ iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+ echo 1
+ ifconfig bnep0 down
ifconfig: SIOCGIFFLAGS: No such device
+ ifconfig bnep0 up
ifconfig: SIOCGIFFLAGS: No such device
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up
ifconfig: SIOCSIFADDR: No such device
+ start-stop-daemon -S -p /var/run/btpan_tethering.pid -m -b -x /usr/sbin/dnsmasq -- -k -I lo -z -a 192.168.3.1 -F 192.168.3.100,192.168.3.127 -b
+ run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:Bluetooth PAN Activated
Nokia-N900-42-11:/home/user# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default * 0.0.0.0 U 0 0 0 gprs0
Nokia-N900-42-11:/home/user#


I spot errors in creating the device bnep0 which did not happen in your previous output you posted at #149: http://talk.maemo.org/showpost.php?p...&postcount=149

In #149:
Code:

+ ifconfig bnep0 down
+ ifconfig bnep0 up
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up

In your last post:
Code:

+ ifconfig bnep0 down
ifconfig: SIOCGIFFLAGS: No such device
+ ifconfig bnep0 up
ifconfig: SIOCGIFFLAGS: No such device
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up
ifconfig: SIOCSIFADDR: No such device

Now the gprs0 appreas in the routing table while bnep0 is missing.

What have you changed since #149? Say, have you paired up the devices first?

youth 2011-06-20 04:47

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 1032412)
Now the gprs0 appreas in the routing table while bnep0 is missing.

What have you changed since #149? Say, have you paired up the devices first?

Restarted the n900 & started the 3g connection before connecting the tablet.

Trying pair again before connecting.

New output:

Code:

Root shell enabled
+ IP_ADDR=192.168.3.1
+ NETMASK=255.255.255.0
+ DHCP_RANGE=192.168.3.100,192.168.3.127
+ RUNFILE=/var/run/btpan_tethering.pid
+ DNSMASQ=/usr/sbin/dnsmasq
+ modprobe ipt_MASQUERADE
+ iptables -F
+ iptables -t nat -F
+ iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+ echo 1
+ ifconfig bnep0 down
+ ifconfig bnep0 up
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up
+ start-stop-daemon -S -p /var/run/btpan_tethering.pid -m -b -x /usr/sbin/dnsmasq -- -k -I lo -z -a 192.168.3.1 -F 192.168.3.100,192.168.3.127 -b
/usr/sbin/dnsmasq already running.
+ run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:Bluetooth PAN Activated
Nokia-N900-42-11:/home/user# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 bnep0
default * 0.0.0.0 U 0 0 0 gprs0


9000 2011-06-20 05:49

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by youth (Post 1032428)
Restarted the n900 & started the 3g connection before connecting the tablet.

Trying pair again before connecting.

New output:

Code:

Root shell enabled
+ IP_ADDR=192.168.3.1
+ NETMASK=255.255.255.0
+ DHCP_RANGE=192.168.3.100,192.168.3.127
+ RUNFILE=/var/run/btpan_tethering.pid
+ DNSMASQ=/usr/sbin/dnsmasq
+ modprobe ipt_MASQUERADE
+ iptables -F
+ iptables -t nat -F
+ iptables -t nat -A POSTROUTING -o gprs0 -j MASQUERADE
+ echo 1
+ ifconfig bnep0 down
+ ifconfig bnep0 up
+ ifconfig bnep0 192.168.3.1 netmask 255.255.255.0 up
+ start-stop-daemon -S -p /var/run/btpan_tethering.pid -m -b -x /usr/sbin/dnsmasq -- -k -I lo -z -a 192.168.3.1 -F 192.168.3.100,192.168.3.127 -b
/usr/sbin/dnsmasq already running.
+ run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:Bluetooth PAN Activated
Nokia-N900-42-11:/home/user# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 bnep0
default * 0.0.0.0 U 0 0 0 gprs0


What were the problems you got in #151 and #155?

youth 2011-06-20 06:26

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by 9000 (Post 1032447)
What were the problems you got in #151 and #155?

Not sure. Most of this linux stuff is above my head so I'm just trying different things following the steps best I can. The tablet is connected but isn't getting an internet connection & has no IP. One of the posters here somehow got it to work with his xoom but it's confusing to follow.

I considered wifi tethering, but n900 only does adhoc & Honeycomb tablets don't even see those networks w/o some workaround. Why did google have to make this so difficult?

9000 2011-06-20 06:38

Re: [HOWTO] N900 Bluetooth-PAN Tethering (N900 supplies Internet Access for PC)
 
Quote:

Originally Posted by youth (Post 1032462)
Not sure. Most of this linux stuff is above my head so I'm just trying different things following the steps best I can. The tablet is connected but isn't getting an internet connection & has no IP. One of the posters here somehow got it to work with his xoom but it's confusing to follow.

I considered wifi tethering, but n900 only does adhoc & Honeycomb tablets don't even see those networks w/o some workaround. Why did google have to make this so difficult?

It'd really help if you could feedback the problems you encountered in details. Nevertheless, you've done correctly on N900 in view of the output in #157.

Have you triggered the "Tethering" under "Bluetooth Settings" on honeycomb's side?


All times are GMT. The time now is 09:46.

vBulletin® Version 3.8.8