BigSoft Logo

Linux

Spreading the good word

Linux Project

Linux is a free Unix-type operating system originally created by Linus Torvalds with the assistance of developers around the world. Developed under the GNU General Public License, the source code for Linux is freely available to everyone.

BigSoft Limited has been a keen promoter of open source solutions. We have produced a document to help get a bluetooth doggle to work under linux.

Bluetooth under RedHat 9.0

This document was written sometime ago, but it still recieves quite a bit of traffic.

The majority of the following text is from a screen dump which is why it is formatted with a terminal font.


plug in ubs doggle
-----------------------------------------
[root@z600hek root]# hciconfig
hci0:   Type: USB
        BD Address: 00:20:ED:36:D7:54 ACL MTU: 192:8  SCO MTU: 64:8
        UP RUNNING PSCAN ISCAN
        RX bytes:135 acl:0 sco:0 events:19 errors:0
        TX bytes:569 acl:0 sco:0 commands:18 errors:0
[root@z600hek root]# hcitool scan
Scanning ...
        00:02:EE:38:DB:DE       DavidMob
[root@z600hek root]# ls -l /dev/rfcomm0
crw-r--r--    1 root     root     216,   0 Sep  5 21:51 /dev/rfcomm0
[root@z600hek root]# vi /etc/bluetooth/rfcomm.conf
#
# 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 no;
        bind yes;
                                                                                
        # Bluetooth address of the device
        #device 11:22:33:44:55:66;
        device 00:02:EE:38:DB:DE;
                                                                                
        # RFCOMM channel for the connection
        channel 1;
                                                                                
        # Description of the connection
        #comment "Example Bluetooth device";
        comment "Nokia 7650";
}
:wq
[root@z600hek root]# vi /etc/ppp/peers/gprs
# File:
# gprs
#
# Description:
# Serial cable, IrDA, Bluetooth and USB pppd options for GPRS phones.
                                                                                
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
                                                                                
# Debug info from pppd:
# Comment this off, if you don't need more info
debug
                                                                                
# Show password in debug messages
show-password
                                                                                
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
# wvdial command is for Orange SPV while other phones should work with chat
connect /etc/ppp/peers/gprs-connect-chat
#connect "/usr/bin/wvdial --chat --config /etc/ppp/peers/gprs-wvdial.conf radiolinja_usb_orange_spv"
                                                                                
# Disconnect script:
# AT commands used to 'hangup' the GPRS connection.
disconnect /etc/ppp/peers/gprs-disconnect-chat
                                                                                
# Serial device to which the GPRS phone is connected:
# /dev/ttyS0 for serial port (COM1 in Windows),
# /dev/ircomm0 for IrDA,
# /dev/ttyUB0 for Bluetooth (Bluez with rfcomm running) and
# /dev/ttyUSB0 for USB
#/dev/ttyS0     # serial port one
#/dev/ttyS1     # serial port two
#/dev/ircomm0   # IrDA serial port one
/dev/rfcomm0    # Bluetooth serial port one
#/dev/ttyUSB0   # USB serial device, for example Orange SPV
                                                                                
# Serial port line speed
115200  # fast enough
#57600  # perhaps usefull with IrDA
                                                                                
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with IrDA.
crtscts  # serial cable, Bluetooth and USB
#nocrtscts # IrDA
                                                                                
# Ignore carrier detect signal from the modem:
local
                                                                                
# IP addresses:
# - accept peers idea of our local address and set address peer as 10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# - if you use the 10. network at home or something and pppd rejects it,
# change the address to something else
:10.0.0.1
                                                                                
# pppd must not propose any IP address to the peer!
noipdefault
                                                                                
# Accept peers idea of our local address
ipcp-accept-local
                                                                                
# Add the ppp interface as default route to the IP routing table
defaultroute
# DNS servers from the phone:
# some phones support this, some don't.
usepeerdns
                                                                                
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
                                                                                
# The phone is not required to authenticate:
noauth
                                                                                
# Username and password:
# If username and password are required by the APN, put here the username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
# Example, Radiolinja operator pap-secrets:
# "rlnet"         *       "internet"    *
#user "rlnet"
#user "Orange"
                                                                                
# Asyncmap:
# some phones may require this option.
#asyncmap 0xa0000
                                                                                
# No magic:
# some phones may require this option.
nomagic
                                                                                
# Require PAP authentication:
# some phones may require this option.
#require-pap
:wq
[root@z600hek root]# vi /etc/ppp/peers/gprs-connect-chat
#!/bin/sh
#
# File:
# gprs-connect-chat
#
# Description:
# chat script to open Radiolinjas GPRS service with GPRS phones. If ppp
# negotiation stalls, try restarting the phone. To try with other GPRS
# operator setting, change the PDP contex setting. The settings work with
# most Ericsson models, but Nokia 8310 and 30 do not support QoS parameters
# with AT commands, so just delete those lines and it'll work.
#
# Set PDP context CID=1, protocol=IP, APN=internet:
# AT+CGDCONT=1,"IP","internet","",0,0
#
# Set CID=1 QoS requirements from the network, not supported by Nokia:
# AT+CGQREQ=1,0,0,0,0,0
#
# Set CID=1 minimum acceptable QoS parameters, not supported by Nokia:
# AT+CGQMIN=1,0,0,0,0,0
#
# 'Call' CID=1 (activate PDP context one, perform GPRS attach):
# ATD*99***1#
#
# Some phones like the Orange SPV (yes, the Microsoft Smartphone) use this
# dial string to start GPRS connection:
# ATD*99#
#
# The actual chat script:
exec chat                                               \
        TIMEOUT         5                               \
        ECHO            ON                              \
        ABORT           '\nBUSY\r'                      \
        ABORT           '\nERROR\r'                     \
        ABORT           '\nNO ANSWER\r'                 \
        ABORT           '\nNO CARRIER\r'                \
        ABORT           '\nNO DIALTONE\r'               \
        ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
        ''              \rAT                            \
        TIMEOUT         12                              \
        SAY             "Press CTRL-C to close the connection at any stage!"   \
        SAY             "\ndefining PDP context...\n"   \
        OK              ATH                             \
        OK              ATE1                            \
        OK              'AT+CGDCONT=1,"IP","orangeinternet","",0,0'     \
        OK              ATD*99#                         \
        TIMEOUT         22                              \
        SAY             "\nwaiting for connect...\n"    \
        CONNECT         ""                              \
        SAY             "\nConnected." \
        SAY             "\nIf the following ppp negotiations fail,\n"   \
        SAY             "try restarting the phone.\n"
:wq
[root@z600hek root]# vi /etc/ppp/peers/gprs-disconnect-chat
#!/bin/sh
#
# File:
# gprs-disconnect-chat
#
# send break
exec /usr/sbin/chat -V -s -S    \
ABORT           "BUSY"          \
ABORT           "ERROR"         \
ABORT           "NO DIALTONE"   \
SAY             "\nSending break to the modem\n"        \
""              "\K"            \
""              "+++ATH"        \
SAY             "\nPDP context detached\n"
:wq
[root@z600hek root]# vi /etc/resolv.conf
;  Orange UK
nameserver 193.35.131.194
nameserver 193.35.131.195
:wq
[root@z600hek root]# ifdown eth0
[root@z600hek root]# rfcomm bind all
[root@z600hek root]# pppd call gprs
Press CTRL-C to close the connection at any stage!
defining PDP context...
rAT
OK
ATH
OK
ATE1
OK
AT+CGDCONT=1,"IP","orangeinternet","",0,0
OK
waiting for connect...
 
ATD*99#
CONNECT
Connected.
If the following ppp negotiations fail,
try restarting the phone.
 
Serial connection established.
using channel 3
Using interface ppp0
Connect: ppp0 <--> /dev/rfcomm0
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfAck id=0x1 ]
rcvd [LCP ConfReq id=0x0   ]
sent [LCP ConfRej id=0x0 ]
rcvd [LCP ConfReq id=0x1  ]
sent [LCP ConfAck id=0x1  ]
sent [IPCP ConfReq id=0x1   ]
sent [CCP ConfReq id=0x1  ]
rcvd [IPCP ConfReq id=0x0 ]
sent [IPCP ConfNak id=0x0 ]
rcvd [LCP ProtRej id=0x0 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
sent [IPCP ConfReq id=0x1   ]
rcvd [IPCP ConfNak id=0x1   ]
sent [IPCP ConfReq id=0x2   ]
rcvd [IPCP ConfReq id=0x1 ]
sent [IPCP ConfAck id=0x1 ]
rcvd [IPCP ConfAck id=0x2   ]
not replacing existing default route to eth0 [172.16.100.1]
local  IP address 172.23.164.128
remote IP address 10.0.0.1
primary   DNS address 194.33.26.135
secondary DNS address 193.35.131.194
Script /etc/ppp/ip-up started (pid 8219)
Script /etc/ppp/ip-up finished (pid 8219), status = 0x0
 
^C

Terminating on signal 2.
Script /etc/ppp/ip-down started (pid 8220)
sent [LCP TermReq id=0x2 "User request"]
rcvd [LCP TermAck id=0x2]
Connection terminated.
Connect time 0.6 minutes.
Sent 98 bytes, received 64 bytes.
 
Sending break to the modem
 
PDP context detached
Serial link disconnected.
Waiting for 1 child processes...
  script /etc/ppp/ip-down, pid 8220
Script /etc/ppp/ip-down finished (pid 8220), status = 0x0
[root@z600hek root]# rfcomm release all