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

version 1.1, 2011/11/20 21:35:54 version 1.5, 2020/09/08 21:05:59
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 -p /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)](//man.NetBSD.org/pppd.8)
       #        #
       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/bluetooth start
       Configuring Bluetooth controllers: ubt0.        Configuring Bluetooth controllers: ubt0.
            starting Bluetooth Link Key/PIN Code manager
         starting Bluetooth Service Discovery server
 and perform an inquiry to discover the Bluetooth device address of your phone      
      
       # btconfig ubt0 inquiry  and perform an inquiry to discover the Bluetooth device address of your phone 
       Device Discovery from device ubt0 ..... 1 response      
        1: bdaddr 00:22:b3:22:3e:32        # btconfig ubt0 inquiry
         : name "My Nokia"        Device Discovery from device ubt0 ..... 1 response
         ...         1: bdaddr 00:22:b3:22:3e:32
              : name "My Nokia"
           ...
 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  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
 Next set up a PIN in order to pair the phone with your Bluetooth dongle      
      
       # btpin -a phone -r -l 6  Next set up a PIN in order to pair the phone with your Bluetooth dongle 
       PIN: 928434      
            # btpin -a phone -r -l 6
         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)      
      
       # rfcomm_sppd -a phone -s DUN  and attempt to open a manual RFCOMM connection to the Dial Up Networking (DUN) service on the phone (press ^C to close the connection) 
       Starting on stdio...      
       AT        # rfcomm_sppd -a phone -s DUN
       OK        Starting on stdio...
       ATI        AT
       Nokia        OK
       ATI3        ATI
       Nokia 6230i        Nokia
              ATI3
       OK        Nokia 6230i
       ^C        
            OK
         ^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.      
   
 Now we can start pppd  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. 
      
       # pppd call gprs  Now we can start pppd 
       Serial connection established.      
       Connect:  ppp0 <--> /dev/ttyp9        # pppd call gprs
       local     IP address 10.177.120.221        Serial connection established.
       Remote    IP address 10.4.4.4        Connect:  ppp0 <--> /dev/ttyp9
       Primary   DNS address IP        local     IP address 10.177.120.221
       Secondary DNS address IP        Remote    IP address 10.4.4.4
            Primary   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.      
   
 #  Advanced Configuration  You are now online. To terminate your pppd session just press Control + C, or send a SIGHUP to the pppd process. 
   
 You may find that some phones require authentication when connecting to PPP, this will be a username/password provided by your GSM Operator.  #  Advanced Configuration 
   
 Create a /etc/ppp/chap-secrets file, owned by root and unreadable by anybody else (mode 0600) containing  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 
       # CHAP/PAP secrets file      
       #        #
       "user" * "pass"        # CHAP/PAP secrets file
            #
         "user" * "pass"
 and add the following line to the /etc/ppp/peers/gprs file      
      
        user "user"  and add the following line to the /etc/ppp/peers/gprs file 
          
          user "user"
 To automatically configure the DNS server when the PPP link is brought up, create a /etc/ppp/ip-up file containing      
      
       #!/bin/sh  To automatically configure the DNS server when the PPP link is brought up, create a /etc/ppp/ip-up file containing 
       #      
       # ip-up <interface> <tty> <speed> <local-ip> <remote-ip> <ipparam>        #!/bin/sh
       #            $1      $2      $3       $4         $5          $6        #
       #        # ip-up <interface> <tty> <speed> <local-ip> <remote-ip> <ipparam>
              #            $1      $2      $3       $4         $5          $6
       if [ -f /etc/ppp/resolv.conf ]; then        #
           rm -f /etc/resolv.conf        
           mv /etc/ppp/resolv.conf /etc/resolv.conf        if [ -f /etc/ppp/resolv.conf ]; then
       fi            rm -f /etc/resolv.conf
                mv /etc/ppp/resolv.conf /etc/resolv.conf
         fi
 #  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.  #  See Also 
   
   The [Bluetooth section in the NetBSD Guide](http://www.netbsd.org/docs/guide/en/chap-bluetooth.html) contains more general Bluetooth configuration, and details of all PPP options can be found in the [pppd(8)](//man.NetBSD.org/pppd.8) manpage. 

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


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