November 2006 This is how I configured gprs via bluetooth on my IPAC 3900 running OPIE familiar 0.8.4. The cell phone used was Sony Ericsson K600i. The mobile operator was tele2. Turn bluetooth radio on, Use the gui or do: hciattach -p /dev/tts/1 bcsp 921600 & Show our own bluetooth adress: hcitool dev Let the devices find each other and pair them. Turn on the phone and make it discoverable. Look for other bluetooth devices: hcitool scan ------------ example begin ---------------- /etc # hcitool scan Scanning ... 00:12:EE:5F:6C:DC Henriks K600i ------------- example end ----------------- This gives us the bdaddr of devices within range. In my case it was 00:12:EE:5F:6C:DC. Replace 00:12:EE:5F:6C:DC with yours in following instructions. Find out on which channel the phone gives DUN service: sdptool search --bdaddr 00:12:EE:5F:6C:DC DUN You might be asked for a PIN on first ipaq and then phone here. Enter same PIN one both. ------------ example begin ---------------- root@h3900:~# sdptool search --bdaddr 00:12:EE:5F:6C:DC DUN Searching for DUN on 00:12:EE:5F:6C:DC ... Service Name: Dial-up Networking Service RecHandle: 0x10001 Service Class ID List: "Dialup Networking" (0x1103) "Generic Networking" (0x1201) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 1 Profile Descriptor List: "Dialup Networking" (0x1103) Version: 0x0100 root@h3900:~# ------------- example end ----------------- We will need the bdaddr and the channel number (1 in this case) when we make the bind_dun script later. rfcomm0 is a virtal serial port, it is used just like any other perial port by pppd) Make a script for binding rfcomm0 to the DUN in my phone. This file needs to contain hw adresses uniqe for each user. So first change and below to that of your phone (you got these from hcitool and sdptool above) then just cut and paste: ------------------------------------------- rfcomm bind 0 mknod -m 666 /dev/rfcomm0 c 216 0 ------------------------------------------- in my case like this: ---------------- cut and paste from here ---------------- cat > /sbin/bind_dun << EOF mknod -m 666 /dev/rfcomm0 c 216 0 rfcomm bind 0 00:12:EE:5F:6C:DC 1 EOF ------------------------ end cut ------------------------ chmod +x /sbin/bind_dun Run the bind_dun as root each time the iPAQ has been rebooted. I dont know how to get this done automatically. Perhaps one shall put something in an rfcomm.conf file something like this: ---------------- cut and paste from here ---------------- cat > /etc/bluetooth/rfcomm.conf << EOF # # RFCOMM configuration file. # # $Id: rfcomm.conf,v 1.1 2002/10/07 05:58:18 maxk Exp $ # rfcomm0 { # Automatically bind the device at startup bind yes; # Bluetooth address of the device device 00:12:EE:5F:6C:DC; # RFCOMM channel for the connection channel 1; # Description of the connection comment "Example Bluetooth device"; EOF ------------------------ end cut ------------------------ but you still need to do: mknod -m 666 /dev/rfcomm0 c 216 0 after each reboot so its not much point. Setup ppp First a file telling pppd which files to use. The following tells pppd where the ppp options are, which script to use for dialing and the option file for that dialing script: ---------------- cut and paste from here ---------------- cat > /etc/ppp/peers/gprsbt << EOF file /etc/ppp/options.gprs connect "/usr/sbin/chat -v -f /etc/ppp/chat.gprs" EOF ------------------------ end cut ------------------------ The options file for pppd may look like this: ---------------- cut and paste from here ---------------- cat > /etc/ppp/options.gprs << EOF # pppd shall not propose IP address to other peer. noipdefault # Accept peers idea of address ipcp-accept-local # Ask peer for DNS servers. usepeerdns # Add default route defaultroute EOF ------------------------ end cut ------------------------ The chat script should exist already but the options file for the chat script may look like this: ---------------- cut and paste from here ---------------- cat > /etc/ppp/chat.gprs << EOF ABORT "BUSY" "" "\d" SAY "reseting modem\n" "" "atz" SAY "connecting\n" OK 'AT+CGDATA="PPP",1' SAY "dialing\n" CONNECT "atdt*99#" TIMEOUT 60 SAY "connected\n" EOF ------------------------ end cut ------------------------ The options are critical, if it later dont work but you see that the phone is trying, but then fails saying something is wrong, then the problem may be here. If the above dont work, try replacing the line: CONNECT "atdt*99# With one of these: CONNECT "atdt*99***1# CONNECT "atdt*99***2# CONNECT "atdt*99***3# CONNECT "atdt*99***4# If it still dont work you need to set the Access Point Name (APN). It is different for different networks (vodafone, tele2 etc). Refere to your operator. In my case it was found here: http://www.editorial.tele2.se/?page=tele2se_privat_mobiltelefoni_wapportalen_installningarochhjalp_internetviagprs&t2page=privat_mobiltelefoni_wapportalen_installningarochhjalp&nomenu=1 It is done with a command cgdcont: at+cgdcont=1,"ip","","0.0.0.0",0,0 So in my case (with tele2): ---------------- cut and paste from here ---------------- cat > /etc/ppp/chat.gprs << EOF ABORT "BUSY" "" "\d" SAY "reseting modem\n" "" "atz" SAY "connecting\n" OK 'at+cgdcont=1,"ip","internet.tele2.se","0.0.0.0",0,0' "" 'AT+CGDATA="PPP",1' SAY "dialing\n" CONNECT "atd*99***2#" TIMEOUT 60 SAY "connected\n" EOF ------------------------ end cut ------------------------ And one script for initating a connection: ---------------- cut and paste from here ---------------- cat > /usr/bin/gprs << EOF echo starting pppd pppd /dev/rfcomm0 lcp-echo-interval 0 call gprsbt EOF ------------------------ end cut ------------------------ chmod a+x /usr/bin/gprs Run the gprs script (dont need to be root) when you wish to connect. To disconnect kill the hciattach process or turn radio of from bluetooth applet in panel. ------------------------------------------- root@h3900:~# jobs [1] + Running /etc/bluetooth/hciattach root@h3900:~# kill %1 root@h3900:~# [1] + Terminated /etc/bluetooth/hciattach ------------------------------------------- -----------------------cut and paste---------------------------- cat > bookmarks.html << EOF Henriks www pages www.eit.se
news.bbc.co.uk
www.google.com
www.dn.se
< EOF ---------------------------------------------------------------- REFERENCES (some of these may be old) http://www.handhelds.org/ http://www.handhelds.org:8080/wiki/IPMasqHowto http://www.wbglinks.net/pages/reads/chainstables/iptablesmasq.html http://www.eit.se/hb/misc/text/ipaq_gprs_bluetooth.txt http://www.handhelds.org:8080/wiki/FamiliarLoopbackHowto http://handhelds.org/hypermail/ipaq/126/12612.html http://www.zaurususergroup.com/modules.php?op=modload&name=phpWiki&file=index&pagename=Bluetooth http://www.linuxjournal.com/article/7525 /Henrik Copyright 2005 Henrik Björkman www.eit.se. Please use and redistribute as under GPL, but remember to mention where the info came from.