Editing Bluetooth PAN

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
Personal Area Networking Profile of Bluetooth protocol allows you to connect your Maemo device via another device to another network such as the Internet.
+
This allows you to connect to [[Bluetooth]] PAN via the connection manager exactly the same way as you connect to a WLAN network or to a cell phone dial-up connection (DUN). Most Windows Smartphones use this method of connection when used as a modem via Bluetooth.
-
The Connection manager is used for this purpose, exactly the same way as you connect to a WLAN network or to a cell phone dial-up connection ([[Bluetooth DUN]]). Most Windows Smartphones use this method of connection when used as a modem via Bluetooth.
+
== Prerequisites ==
-
If you have [[Nokia N900]] you may instead use it as PAN server to allow an other device such as a Nokia N8x0 to utilize Bluetooth PAN.
+
* maemo-pan
 +
* In Diablo, libicd-network-dummy (installed automatically as a dependency by maemo-pan)
-
== Bluetooth NAP ==
+
== Installing ==
-
NAP stands for Network Access Point. It's a PAN profile for serving incoming connections.
+
Install maemo-pan through the Application manager. This will force the installation of libicd-network-dummy as it is listed as a dependency for maemo-pan. You may need to restart your tablet after installation for the libicd-network-dummy package to be loaded.
-
=== Installing ===
+
After restarting, tap on the wifi icon in your status bar and either "Select a connection" or "Change connection" to see a list of available network access points. You should see one called "Dummy Network" (this name will likely change in future versions of maemo-pan, see [https://bugs.maemo.org/show_bug.cgi?id=3306 bug #3306] for details).
-
For the [[Nokia N900]] pan is disabled by default.
+
To actually connect to the internet through this connection you must make sure the "Internet Connection Sharing" application is running on your phone and has a connection. Select the "Dummy Network" from the tablet network list and enjoy anywhere internet!
-
To enable it, edit /etc/bluetooth/main.conf and remove ''network'' from the disabled plugins
+
-
[General]
+
-
# List of plugins that should not be loaded on bluetoothd startup
+
-
DisablePlugins = <s>network</s>,input,hal
+
-
''libicd-network-null'' is also recommended for using internet over bluetooth
+
-
apt-get install libicd-network-null
+
-
For other devices you need to install maemo-pan through the Application manager. You may need to restart your tablet after installation in order to force a dependency on maemo-pan (libicd-network-dummy package) being loaded.
 
-
Tap on the Connectivity icon in your status bar and either "Select a connection" or "Change connection" to see a list of available network access points. You should see one called "Dummy Network" (this name will likely change in future versions of maemo-pan, see [https://bugs.maemo.org/show_bug.cgi?id=3306 bug #3306] for details).
+
== Private Area Network (PAN) connection ==
-
To connect to the Internet through this connection you must make sure the "Internet Connection Sharing" application is running on your phone and has a connection. Select the "Dummy Network" from the tablet network list and enjoy anywhere Internet!
+
On Chinook or Diablo, install maemo-pan through the Application manager. This should also install libicd-network-dummy as a dependency. Restart your tablet to activate libicd-network-dummy.
-
===Sharing your connection over bluetooth [n900]===
+
After restarting, tap on the wifi icon in your status bar and either "Select a connection" or "Change connection" to see a list of available network access points. You should see one called "Dummy Network" (this name will likely change in future versions of maemo-pan, see [https://bugs.maemo.org/show_bug.cgi?id=3306 bug #3306] for details).
-
Using [http://maemo.org/packages/view/genwall genwall] for internet connection sharing over bluetooth, follow:([http://talk.maemo.org/showpost.php?p=1454885&postcount=62 Linux]/[http://talk.maemo.org/showpost.php?p=1454885&postcount=63 Windows]).
+
To connect to the internet through this connection you must make sure that "Internet Connection Sharing" is active on your phone and has a connection. Select the "Dummy Network" from the tablet network list and enjoy internet anywhere!
 +
=== Using PAN on older releases ===
 +
It is possible to use PAN to share internet connections via PAN between two Nokia devices. However, on older devices it is recommended to use Bluetooth dial-up networking (DUN), since this is the normal method which smartphones use to share internet access over bluetooth.
-
Using udev to automatically setup internet connection sharing over bluetooth comes now.
+
== Dial Up Network (DUN) connection ==
 +
Bluetooth PAN offers slightly faster connection speeds than DUN, but DUN does not require having to install any extra software packages. This method also works for software versions older than OS2008.
-
A kernel with iptables support is needed,
+
=== Nokia N800 or later ===
-
[[Kernel Power]] is the recommended way to achieve this. see [[Kernel Power]] for installation details.
+
# Goto 'Menu → Tools → Control Panel → Bluetooth → Devices → New'
 +
# You should see your phone or PC, pair up with it. I recommend using a 10-digit or greater pairing code
 +
# Set it as a "Trusted Device"... I haven't tried it the other way yet
 +
# Goto 'Connectivity → Connections → New' in the Control Panel
 +
# Choose GPRS → Next
 +
# Leave Access Point and Tel# at defaults, leave user/pass blank → Next
 +
# IF you chose not to specify the remote IP on the PC side (see above) THEN choose Advanced → IP Addresses and put in an appropriate IP and DNS servers.
 +
# Goto 'Phone' in the Control Panel
 +
# Choose your new Device from step 2. It is now 'selected'. If you don't do this then it won't show up in the Connection Manager.
-
The default kernel with [[Community_SSU/Thumb|CSSU-thumb]] is also suitable.
+
=== Nokia 770 ===
-
 
+
-
 
+
-
Install the ''iptables'' package:
+
-
apt-get install iptables
+
-
 
+
-
create the following 2 files:
+
-
 
+
-
/etc/udev/rules.d/98-bnep0.rules:
+
-
ACTION=="add", SUBSYSTEM=="net",  KERNEL=="bnep0", RUN+="/etc/udev/bluenet.sh"
+
-
ACTION=="remove", SUBSYSTEM=="net",  KERNEL=="bnep0", RUN+="/etc/udev/bluenet.sh"
+
-
 
+
-
/etc/udev/bluenet.sh:
+
-
#! /bin/sh
+
-
if [ $ACTION = "add" ]; then
+
-
echo 1 > /proc/sys/net/ipv4/ip_forward
+
-
iptables -t nat -A POSTROUTING ! -o lo -j MASQUERADE
+
-
ifconfig bnep0 192.168.3.1
+
-
ifconfig bnep0 up
+
-
/usr/sbin/dnsmasq -I lo -z -a 192.168.3.1 -F 192.168.3.64,192.168.3.127 -x /var/run/dnsmasq.pid.bnep0
+
-
else
+
-
iptables -t nat -D POSTROUTING ! -o lo -j MASQUERADE
+
-
if [ -f /var/run/dnsmasq.pid.bnep0 ]; then
+
-
DNSMASQ_PID=`cat /var/run/dnsmasq.pid.bnep0`
+
-
rm -f /var/run/dnsmasq.pid.bnep0
+
-
kill $DNSMASQ_PID
+
-
        fi
+
-
fi
+
-
then set ''/etc/udev/bluenet.sh'' as executible:
+
-
chmod +x /etc/udev/bluenet.sh
+
-
 
+
-
now whenever an authorised remote device makes a bluetooth pan (nap) connection iptables and dnsmasq are setup to allow that device access to the phones network.
+
-
TODO: when no internet connection is active ask to set it up
+
-
 
+
-
 
+
-
=== Using PAN on older maemo5 pr3 ===
+
-
In terminal cd /etc/udev/ then write vi bluenet.sh
+
-
it will open
+
-
/etc/udev/bluenet.sh press R and paste that code:
+
-
#!/bin/sh
+
-
if [ $ACTION = "add" ]; then
+
-
# by 9000 @ talk.maemo.org
+
-
# Prompt you to select the Internet connection. You may choose gprs or wifi
+
-
run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.icd_ui /com/nokia/icd_ui com.nokia.icd_u
+
-
# Selecting and establishing connection takes time
+
-
sleep 2
+
-
# Verbose mode. You can remove it when you're using widget to activate this script
+
-
set -x
+
-
IP_ADDR="192.168.3.1"
+
-
NETMASK="255.255.255.0"
+
-
DHCP_RANGE="192.168.3.60,192.168.3.70"
+
-
RUNFILE="/var/run/btpan_tethering.pid"
+
-
DNSMASQ="/usr/sbin/dnsmasq"
+
-
# Load modules
+
-
modprobe ipt_MASQUERADE
+
-
# flush old rules
+
-
iptables -F
+
-
iptables -t nat -F
+
-
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
+
-
# forward IPs
+
-
echo 1 > /proc/sys/net/ipv4/ip_forward
+
-
# Setup bnep0
+
-
ifconfig bnep0 down
+
-
ifconfig bnep0 up
+
-
ifconfig bnep0 $IP_ADDR netmask $NETMASK up
+
-
# Setup DNS and DHCP
+
-
start-stop-daemon -S -p $RUNFILE -m -b -x $DNSMASQ -- -k -I lo -z -a $IP_ADDR -F $DHCP_RANGE -b
+
-
run-standalone.sh dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:'Bluetooth PAN Activated'
+
-
fi
+
-
 
+
-
press esc, then :w to save file and :q to quit
+
-
 
+
-
set ''/etc/udev/bluenet.sh'' as executible:
+
-
chmod +x /etc/udev/bluenet.sh
+
-
 
+
-
cd /etc/udev/rules.d/
+
-
command vi 98-bnep0.rules and press R
+
-
 
+
-
/etc/udev/rules.d/98-bnep0.rules copy that txt and paste it, esc and Save it with command :w quit vi editor :q :
+
-
ACTION=="add", SUBSYSTEM=="net",  KERNEL=="bnep0", RUN+="/etc/udev/bluenet.sh"
+
-
 
+
-
 
+
-
It is possible to use PAN to share Internet connections via PAN between two Nokia devices. However, on older devices it is recommended to use [[Bluetooth DUN]] (dial-up networking), since this is the normal method which smartphones use to share Internet access over Bluetooth.
+
-
 
+
-
 
+
-
== Bluetooth PANU ==
+
-
 
+
-
PANU is a client role for the PAN profile. Here's the way how to make it work.
+
-
 
+
-
Install bluez-test from SDK tools repository:
+
-
echo 'deb http://repository.maemo.org/ fremantle/tools free non-free' >> /etc/apt/sources.list
+
-
apt-get install bluez-test
+
-
 
+
-
You may now remove or comment SDK repository:
+
-
perl -pi -e 's,^(deb http://repository.maemo.org/ fremantle/tools .*)$,#\1,' /etc/apt/sources.list
+
-
 
+
-
And now you can use your N900 device as a bluetooth networking client. Below are some commands.
+
-
 
+
-
Connect to another bluetooth device that provides NAP service:
+
-
pand -c <bdaddr>
+
-
List connections:
+
-
pand -l
+
-
Remove connection:
+
-
pand -k <bdaddr>
+
 +
# Goto 'Menu → Tools → Control Panel → Phone → New'
 +
# You should see your PC. Make a pairing with it. I recommend a PIN of at least 10 characters.
 +
# You will get a warning that you can only use the phone for Dial-Up Networking, not transferring files. Use class 0x120108 in /etc/bluetooth/hcid.conf and set up OBEX if you want file sharing, see http://www.mulliner.org/bluetooth/sobexsrv.php
 +
# Goto 'Connectivity → Connections → New' in the Control Panel
 +
# Choose 'Packet Data' → Next
 +
# Leave Access Point and Tel# at defaults, leave user/pass blank → Next
 +
# IF you chose not to specify the remote IP on the PC side (see above) THEN choose Advanced → IP Addresses and put in an appropriate IP and DNS servers.
 +
[[Category:Users]]
[[Category:Bluetooth]]
[[Category:Bluetooth]]
[[Category:Connectivity]]
[[Category:Connectivity]]
-
[[Category:Power users]]
+
[[Category:Cellular]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)