Diff for /wikisrc/tutorials/how_to_use_nokia_6230i_over_bluetooth_as_a_gprs_modem.mdwn between versions 1.1 and 1.2

version 1.1, 2011/11/20 21:35:54 version 1.2, 2012/02/05 07:14:36
Line 1 Line 1
 **Contents**  **Contents**
   
 [[!toc]]  [[!toc]]
   
 #  Requirements  #  Requirements 
   
 You will need a mobile phone with GPRS and Bluetooth, a Bluetooth device and a NetBSD system that supports Bluetooth (4.0 and above).  You will need a mobile phone with GPRS and Bluetooth, a Bluetooth device and a NetBSD system that supports Bluetooth (4.0 and above). 
   
 In this example, we are using a Nokia 6230i phone, a Broadcom USB dongle and NetBSD 4.9.11.  In this example, we are using a Nokia 6230i phone, a Broadcom USB dongle and NetBSD 4.9.11. 
   
 #  Setting up pppd  #  Setting up pppd 
   
 We need to create some pppd options and chat scripts, first create the directories  We need to create some pppd options and chat scripts, first create the directories 
          
       # mkdir /etc/ppp /etc/ppp/peers        # mkdir /etc/ppp /etc/ppp/peers
          
   
 Create a /etc/ppp/options file containing  Create a /etc/ppp/options file containing 
          
       #        #
       # default options file for [pppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-current)        # default options file for [pppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-current)
       #        #
       57600        57600
       crtscts        crtscts
       local        local
       defaultroute        defaultroute
       usepeerdns        usepeerdns
       noipdefault        noipdefault
       nodetach        nodetach
          
   
   
 and a /etc/ppp/chat.gsm file containing  and a /etc/ppp/chat.gsm file containing 
          
       #        #
       #  Chat script to dial out with GSM phone        #  Chat script to dial out with GSM phone
       #        #
       ABORT     "BUSY"        ABORT     "BUSY"
       ABORT     "NO CARRIER"        ABORT     "NO CARRIER"
       ABORT     "DELAYED"        ABORT     "DELAYED"
       ABORT     "NO DIALTONE"        ABORT     "NO DIALTONE"
       ABORT     "VOICE"        ABORT     "VOICE"
              
       TIMEOUT   10        TIMEOUT   10
       ""        AT        ""        AT
       OK-AT-OK  AT&F        OK-AT-OK  AT&F
       OK        AT+CGDCONT=1,"IP","\U"        OK        AT+CGDCONT=1,"IP","\U"
              
       TIMEOUT   60        TIMEOUT   60
       OK        ATDT\T        OK        ATDT\T
       CONNECT   \c        CONNECT   \c
          
   
 Create a /etc/ppp/peers/gprs file containing  Create a /etc/ppp/peers/gprs file containing 
          
       #        #
       # pppd(8) options file for GPRS        # pppd(8) options file for GPRS
       #        #
       # The Access Point Name (APN) used by your GSM Operator may need        # The Access Point Name (APN) used by your GSM Operator may need
       # to be different from the "internet" used below.        # to be different from the "internet" used below.
       #        #
       pty "rfcomm_sppd -a phone -d ubt0 -s DUN -m encrypt"        pty "rfcomm_sppd -a phone -d ubt0 -s DUN -m encrypt"
       connect "/usr/sbin/chat -V -f /etc/ppp/chat.gsm -U internet -T *99#"        connect "/usr/sbin/chat -V -f /etc/ppp/chat.gsm -U internet -T *99#"
       noccp        noccp
          
   
 ##  Configuring Bluetooth  ##  Configuring Bluetooth 
   
 First, activate Bluetooth on your phone, on the Nokia 6230i as follows  First, activate Bluetooth on your phone, on the Nokia 6230i as follows 
          
       Menu > Settings > Connectivity > Bluetooth > Bluetooth settings > My phone's name        Menu > Settings > Connectivity > Bluetooth > Bluetooth settings > My phone's name
       Choose a name for your device, for this example I will use "My Nokia"        Choose a name for your device, for this example I will use "My Nokia"
              
       Menu > Settings > Connectivity > Bluetooth > Bluetooth settings > My phone's visbility        Menu > Settings > Connectivity > Bluetooth > Bluetooth settings > My phone's visbility
       Choose "Shown to all"        Choose "Shown to all"
              
       Menu > Settings > Connectivity > Bluetooth > Bluetooth >        Menu > Settings > Connectivity > Bluetooth > Bluetooth >
       Choose "Bluetooth on"        Choose "Bluetooth on"
          
   
 Plug your Bluetooth dongle into your computer and you should see something like the following on the console  Plug your Bluetooth dongle into your computer and you should see something like the following on the console 
          
       ubt0 at uhub0 port 1 configuration 1 interface 0        ubt0 at uhub0 port 1 configuration 1 interface 0
       ubt0: Broadcom BCM92035DGROM, rev 1.10/0.04, addr 2        ubt0: Broadcom BCM92035DGROM, rev 1.10/0.04, addr 2
          
   
 Now, we need to establish a Bluetooth connection between your phone and computer. Enable the Bluetooth dongle  Now, we need to establish a Bluetooth connection between your phone and computer. Enable the Bluetooth dongle 
          
       # /etc/rc.d/btconfig start        # /etc/rc.d/btconfig start
       Configuring Bluetooth controllers: ubt0.        Configuring Bluetooth controllers: ubt0.
          
   
 and perform an inquiry to discover the Bluetooth device address of your phone  and perform an inquiry to discover the Bluetooth device address of your phone 
          
       # btconfig ubt0 inquiry        # btconfig ubt0 inquiry
       Device Discovery from device ubt0 ..... 1 response        Device Discovery from device ubt0 ..... 1 response
        1: bdaddr 00:22:b3:22:3e:32         1: bdaddr 00:22:b3:22:3e:32
         : name "My Nokia"          : name "My Nokia"
         ...          ...
          
   
 Add an alias of the bdaddr (yours will be different) to /etc/bluetooth/hosts  Add an alias of the bdaddr (yours will be different) to /etc/bluetooth/hosts 
          
       # echo "00:22:b3:22:3e:32 phone" >> /etc/bluetooth/hosts        # echo "00:22:b3:22:3e:32 phone" >> /etc/bluetooth/hosts
          
   
 Next set up a PIN in order to pair the phone with your Bluetooth dongle  Next set up a PIN in order to pair the phone with your Bluetooth dongle 
          
       # btpin -a phone -r -l 6        # btpin -a phone -r -l 6
       PIN: 928434        PIN: 928434
          
   
 and attempt to open a manual RFCOMM connection to the Dial Up Networking (DUN) service on the phone (press ^C to close the connection)  and attempt to open a manual RFCOMM connection to the Dial Up Networking (DUN) service on the phone (press ^C to close the connection) 
          
       # rfcomm_sppd -a phone -s DUN        # rfcomm_sppd -a phone -s DUN
       Starting on stdio...        Starting on stdio...
       AT        AT
       OK        OK
       ATI        ATI
       Nokia        Nokia
       ATI3        ATI3
       Nokia 6230i        Nokia 6230i
              
       OK        OK
       ^C        ^C
          
   
 Your phone should prompt you for accepting the connection from your computer, accept it and enter the PIN that btpin generated to complete the pairing process.  Your phone should prompt you for accepting the connection from your computer, accept it and enter the PIN that btpin generated to complete the pairing process. 
   
 Now we can start pppd  Now we can start pppd 
          
       # pppd call gprs        # pppd call gprs
       Serial connection established.        Serial connection established.
       Connect:  ppp0 <--> /dev/ttyp9        Connect:  ppp0 <--> /dev/ttyp9
       local     IP address 10.177.120.221        local     IP address 10.177.120.221
       Remote    IP address 10.4.4.4        Remote    IP address 10.4.4.4
       Primary   DNS address IP        Primary   DNS address IP
       Secondary DNS address IP        Secondary DNS address IP
          
   
 You are now online. To terminate your pppd session just press Control + C, or send a SIGHUP to the pppd process.  You are now online. To terminate your pppd session just press Control + C, or send a SIGHUP to the pppd process. 
   
 #  Advanced Configuration  #  Advanced Configuration 
   
 You may find that some phones require authentication when connecting to PPP, this will be a username/password provided by your GSM Operator.  You may find that some phones require authentication when connecting to PPP, this will be a username/password provided by your GSM Operator. 
   
 Create a /etc/ppp/chap-secrets file, owned by root and unreadable by anybody else (mode 0600) containing  Create a /etc/ppp/chap-secrets file, owned by root and unreadable by anybody else (mode 0600) containing 
          
       #        #
       # CHAP/PAP secrets file        # CHAP/PAP secrets file
       #        #
       "user" * "pass"        "user" * "pass"
          
   
 and add the following line to the /etc/ppp/peers/gprs file  and add the following line to the /etc/ppp/peers/gprs file 
          
        user "user"         user "user"
          
   
 To automatically configure the DNS server when the PPP link is brought up, create a /etc/ppp/ip-up file containing  To automatically configure the DNS server when the PPP link is brought up, create a /etc/ppp/ip-up file containing 
          
       #!/bin/sh        #!/bin/sh
       #        #
       # ip-up <interface> <tty> <speed> <local-ip> <remote-ip> <ipparam>        # ip-up <interface> <tty> <speed> <local-ip> <remote-ip> <ipparam>
       #            $1      $2      $3       $4         $5          $6        #            $1      $2      $3       $4         $5          $6
       #        #
              
       if [ -f /etc/ppp/resolv.conf ]; then        if [ -f /etc/ppp/resolv.conf ]; then
           rm -f /etc/resolv.conf            rm -f /etc/resolv.conf
           mv /etc/ppp/resolv.conf /etc/resolv.conf            mv /etc/ppp/resolv.conf /etc/resolv.conf
       fi        fi
          
   
 #  See Also  #  See Also 
   
 The [[Bluetooth]] wiki page contains more general Bluetooth configuration, and details of all PPP options can be found in the [pppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-current) manpage.  The [[Bluetooth]] wiki page contains more general Bluetooth configuration, and details of all PPP options can be found in the [pppd(8)](http://netbsd.gw.com/cgi-bin/man-cgi?pppd+8+NetBSD-current) manpage. 

Removed from v.1.1  
changed lines
  Added in v.1.2


CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb