Intro:
This how-to is mostly one I made for myself but I'm sure it could be useful for other Q owners as well as other WM5 Standard device owners.
This is written specifically for Ubuntu GNU/Linux but it should work for Debian as well as other Debian-derived distros.
If you don't already have a linux box, head over to
the Ubuntu website and download the .iso for x86. You can burn this image to a CD and boot this on your computer and be at the ubuntu desktop in 10 minutes without changing a thing.
Requirements:
A PC
USB bluetooth adapter
Q or other WM5 Standard device
Blank CD (if you intend to burn Ubuntu)
Notes:
pand should be using NAP (network access point) role. It does not seem to be working on the Q with MOL2.
Instead, GN (group ad-hoc network) role seems to work.
Instructions:
1.Install extra needed bluetooth utilities and DHCP server
sudo apt get install bluez-utils
sudo apt-get install dhcp3-server
2.Edit /etc/network/interfaces
sudo nano /etc/network/interfaces
#ADD THIS TO THE END OF THE FILE
iface bnep0 inet static
address 192.168.3.1
netmask 255.255.255.0
3.Edit /etc/dhcp3/dhcpd.conf
sudo nano /etc/dhcp3/dhcpd.conf
#EDIT THIS SECTION OF THE FILE
# option definitions common to all supported networks...
option domain-name "yourhostname.yourprovider.org";
option domain-name-servers 192.168.1.1;
#ADD THIS TO THE END OF THE FILE
subnet 192.168.3.0 netmask 255.255.255.0 { range 192.168.3.1 192.168.3.10; option domain-name-servers 192.168.1.1; option domain-name "yourhostname.yourprovider.org"; option routers 192.168.3.1; option broadcast-address 192.168.3.255; default-lease-time 600; max-lease-time 7200; }
4.Run pand
sudo pand --listen --role GN --master -n
5.Connect with phone
bluetooth manager > personal network
6.Restart network
sudo /etc/init.d/networking restart
7.Restart DHCP server
sudo /etc/init.d/dhcp3-server restart
8.Add iptables entries
sudo iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -j MASQUERADE
sudo iptables -A FORWARD -i bnep0 -o eth0 -j ACCEPT
sudo iptables -A FORWARD -o bnep0 -i eth0 -j ACCEPT
Now connect with your app!
For example, Opera uses the PAN when set to "work" network
Useful scripts:
These scripts help to automate the process. Put these in your home folder. Start the PAN by simply running the first script. Be sure to make these executable.
#/bin/sh
#Use for starting the PAN
#Start this with root privileges
#Change path to your home folder
echo "Starting the PAN..."
echo 1 > /proc/sys/net/ipv4/ip_forward
pand --listen --role GN --master --devup /home/jason/panconnect
sleep 1
#!/bin/sh
#This script runs when the device is connected to the PAN
#Name this script panconnect
sleep 2
ifconfig bnep0 up
ifconfig bnep0 192.168.3.1 netmask 255.255.255.0
sleep 2
sudo iptables -t nat -A POSTROUTING -s 192.168.3.0/24 -j MASQUERADE
sudo iptables -A FORWARD -i bnep0 -o eth0 -j ACCEPT
sudo iptables -A FORWARD -o bnep0 -i eth0 -j ACCEPT
sleep 1
/etc/init.d/dhcp3-server restart
sleep 1
Misc:
HKLM/Comm/BTCEPAN1/Parms/TCPIP
PAN TCP/IP Parameters on device
If your paranoid like me, there is also an encryption option for pand. It does not seem to slow things down, but I don't know how secure it actually is. Just add '--encrypt' after '--master' to the pand line in the startpan script.
If your GNU/Linux distribution is set up strangely, you may need to pair with the device first. I urge you to upgrade to the latest available bluez to fix this. If you want to pair anyway, do it with this:
passkey-agent /usr/bin/bluez-pin MACADDRESSOFYOURDEVICE
References:
Some boring and half-working reads here.
http://fastcreators.com/article/2007...r-debian-etch/ http://bluez.sourceforge.net/contrib/HOWTO-PAN