Bluez user howto version 0.6 20-04-2003
By Hans-Cees Speel at hanscees[nospam]@myrealbox.com and http://www.hanscees.com

About this howto.
Hi!
This is the new howto for the Bluez: the stack for bluetooth in linux. It is not official documentation at all but a good effort to make install and understanding as smooth as it gets.
Everyone is invited to share their comments and especially asked to add their detailed working recipes of how to get things working.

If you just want to get things working and don't need to understand things go to section 4 or even 5. Section 11 is a really tight howto to get bluetooth working with mandrake 9.1 over an usb dongle with a nokia 6530 dialing in to your isp.


Contents

  • 1 What is bluez
  • 2 What can you do with bluez
  • 3 How does bluez work
  • 3.1 how does bluetooth work | 3.11 OSI model | 3.12 BT layers | 3.11 BT profiles
  • 3.2 links to bluetooth stuff
  • 3.3 how is this implemented in bluez
  • 4 what do you need installed and what does it do | 4.1 kernell stuff| 4.2 programs and tools
  • 5 how to install (what do i need to install anyway) | 5.1 kernell stuff | 5.2 programs and tools
  • 6 what steps are needed to get things working
  • 6.0 Get your bluetooth device up!
  • 6.1 You have more computers you want in a bluetooth network:    
  •    Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies:    
  •    Solution 2: attach two computers with ppp. ppp over rfcomm    
  •    Recipies: HELP! no recipe yet!!
  • 6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth.    
  •    Solution1: dund over pan    
  •    Resource: pan and dund over rfcomm    
  •    Recipies: Jim's recipe!
  • 6.3 You have a mobile phone and you want to dial into your isp    
  •    Solution: use pan and ppp over rfcomm    
  •    Recipies: Hans-Cees' recipe!
  • 7. Reference guide: what does that word mean?
  • 8. Leftovers from ..
  • 9. Extra: Little guide to compile your kernel
  • 10. Thanks to these guys you read this
  • 11. Thight howto for dialing in over bluetooth with usb dongle and nokia 6530

    =============================================================

    1 What is bluez


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    Bluez is the official Official Linux Bluetooth protocol stack and can be found at http://bluez.sourceforge.net/. Features can be found at http://bluez.sourceforge.net/features.html.

    Bluez is already part of the official kernell 2.4 tree and if you have a recent distro your standard kernell will probably have it built in.

    2 What can you do with bluez

    For linux users bluez makes it possible to connect to and thus use bluetoothdevices. It becomes possible to use bluetooth usb-dongles, mobile phones with bluetooth, acces points and so on.

    Thus you can connect two or more computers wireless, or phone your isp with your mobile bluetooth-enabled phone. You can synchronize your pim with your computer or phone. You can access your phone data and so on with your computer.

    Q: More things?

    3 How does bluez work


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    Bluez works by implementing the bluetooth standards for linux in the linux kernell and in bluetooth-device drivers and bluetooth layers. See below for a lot more detail

    Q: is that correct?

     3.1 how does bluetooth work(the extreme short version:-))

    Bluetooth is a standard for sending binary data over radio frequencies over a short distance. Bluetooth devices thus contain radio senders and receivers. In the end it sends 0's and 1's through the air in packets. The packets are send and received and processed in a layer-model of all kinds of protocols we can call lower-level or physical-level and data-link level protocols (OSI-model). Bluetooth has a number of profiles that define things you can do like synchronizing your pim data, making a personal area network and so on. This makes bluetooth more than just a radio-layer to build ethernet and ppp ip over.

    Links to more information are below.

    Ultimately these layers can be used by computers or other devices to send voice- or data, in the end all 0's and 1's, using higher-level protocols like ip and tcp/udp/icmp protocols.

    3.11 OSI model


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    If we map the OSI-model to bluetooth and for comparison ethernet over utp (what you are probably using if you have a network) we get this picture:

    OSI-layer ethernet bluetooth
            
    Physical Layer utp-cable/nic/repeater radio-
    waves/emitter/receiver Lmp/LC function: bit encoding and sending over medium

    Data-Link Layer MAC and LLC/bridge L2CAP
     function: receiving frames upper layer and (dis)assemble them for
     physical layer. Adressing by for instance MAC-address. Also flow controle and (simple)error control (are all the frames received?) for single links between devices.

    Network Layer IP/routers/packet-firewalls idem
     function adressing packets/routing and packet/message/circuit switching

    Transport Layer tcp/udp/icmp tcp/udp/icmp
     Function: connections(tcp); repackaging segments/ error-control (checksums); end-to-end flow control.

    Session layer Function: connection establishment/ error correction/negotiation of protocols/authentication Presentation layer function: data formatting Appliciation layer function: API to network

    As you can see only the fiorst layers, like physical and data-link are really different from your usual tcp/ip over ethernet of telephony (ppp) communication.

    Q: is this osi stuff helpful or annoying? Perhaps I should use ppp over telephone and not ethernet?

    3.12 BT layers

    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this
    The howto at http://eie555.eie.polyu.edu.hk/tut/tutorial/ says this:

    Bluetooth Radio

    The Bluetooth Radio (layer) is the lowest defined layer of the Bluetooth specification. It defines the requirements of the Bluetooth transceiver device operating in the 2.4GHz ISM band.

    Bluetooth Baseband

    The Baseband is the physical layer of the Bluetooth. It manages physical channels and links apart from other services like error correction, data whitening, hop selection and Bluetooth security. The Baseband layer lies on top of the Bluetooth radio layer in the bluetooth stack. The baseband protocol (..) carrying out link level routines like link connection and power control. The baseband also manages asynchronous and synchronous links, handles packets and does paging and inquiry to access and inquire Bluetooth devices in the area.

    Link Manager Protocol (LMP)

    The Link Manager carries out link setup, authentication, link configuration and other protocols. It discovers other remote LM´s and communicates with them via the Link Manager Protocol (LMP). To perform its service provider role, the LM uses the services of the underlying Link Controller (LC).

    Host Controller Interface (HCI)

    The HCI provides a command interface to the baseband controller and link manager, and access to hardware status and control registers. Essentially this interface provides a uniform method of accessing the Bluetooth baseband capabilities.The HCI exists across 3 sections, the Host - Transport Layer - Host Controller. Each of the sections has a different role to play in the HCI system.

    Logical Link Control and Adaptation Protocol (L2CAP)

    The Logical Link Control and Adaptation Layer Protocol (L2CAP) is layered over the Baseband Protocol and resides in the data link layer. L2CAP provides connection-oriented and connectionless data services to upper layer protocols with protocol multiplexing capability, segmentation and reassembly operation, and group abstractions. L2CAP permits higher level protocols and applications to transmit and receive L2CAP data packets up to 64 kilobytes in length. Two link types are supported for the Baseband layer : Synchronous Connection-Oriented (SCO) links and Asynchronous Connection-Less (ACL) links. SCO links support real-time voice traffic using reserved bandwidth. ACL links support best effort traffic. The L2CAP Specification is defined for only ACL links and no support for SCO links is planned.

    RFCOMM Protocol. The RFCOMM protocol provides emulation of serial ports over the L2CAP protocol.

    Service Discovery Protocol (SDP) The service discovery protocol (SDP) provides a means for applications to discover which services are available and to determine the characteristics of those available services.

    3.11 BT profiles
    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    The profiles have been developed in order to describe how implementations of user models are to be accomplished. The user models describe a number of user scenarios where Bluetooth performs the radio transmission. A profile can be described as a vertical slice through the protocol stack. Some Profiles are :
    - GAP Profile The Generic Access Profile
    - DNP or DUN (dial up)
    - SPP (serial port) (rfcomm) - Lan Lan access profile
    - Pan (BNEP) Personal area network
     - Sdap The Service Discovery Application Profile
    - Ctp The Cordless Telephony Profile
     - IP Intercom profile
    - HS Headset profile
     - FP Fax profile
    - GOEP The Generic Object Exchange Profile (obex)
     - OPP Object push profile
     - FTP File transfer profile
     - SP Synchronisation profile (PIM-data)

     GAP Profile

    The Generic Access Profile defines the generic procedures related to discovery of Bluetooth devices and link management aspects of connecting to Bluetooth devices. It is the core on which all other Profiles are based

     DNP or DUN Profile

    The Dial-up Networking Profile defines the requirements that shall be used by devices (modems, cellular phones) implementing the usage model called ‘Internet Bridge'. The Gateway role is typically used in a mobile phone with Bluetooth dial-up networking capability and the Terminal role in PDA´s or laptops: thus dun has two roles: terminal and gateway. SDP BNEP TCS

     SPP Profile

    The Serial Port Profile defines the requirements for Bluetooth devices necessary for setting up emulated serial cable connections using RFCOMM between two peer devices.

     LAP Profile

    The LAN Access Profile defines how Bluetooth enabled devices can access the services of a LAN using PPP. Also, this profile shows how the same PPP mechanisms are used to form a network consisting of two Bluetooth-enabled devices.

     PAN profile or personal area network.

    The Personal Area Networking (PAN) Bluetooth Network Encapsulation Specification describes the protocol to be used by the Bluetooth PAN profiles (BNEP or bluetooth network encapsulation protocol). This document defines a packet format for Bluetooth network encapsulation used to transport common networking protocols over the Bluetooth media. Bluetooth network encapsulation supports the same networking protocols that are supported by IEEE 802.3/Ethernet encapsulation. Packets from the supported networking protocols are contained in Bluetooth network encapsulation packets, which are transported directly over the Bluetooth L2CAP protocol. BNEP removes and replaces the Ethernet Header with the BNEP Header. The Ethernet Payload remains unchanged. Finally, both the BNEP Header and the Ethernet Payload is encapsulated by L2CAP and is sent over the Bluetooth media.

      SDAP

    The Service Discovery Application Profile defines the features and procedures for an application in a Bluetooth device to discover services registered in other Bluetooth devices and retrieve any desired available information pertinent to these services.

    CTP Profile

    The Cordless Telephony Profile defines the features and procedures that are required for interoperability between different units active in the 3-in-1 phone use case. This profile also shows how the use case can be applied generally for wireless telephony in a residential or small office environment,

    IP Profile

    The Intercom Profile defines the requirements for Bluetooth devices necessary for the support of the intercom functionality within the 3-in-1 phone use case. This is also refereed to as the 'walkie-talkie' usage of Bluetooth

    HS Profile

    The Headset Profile defines the requirements that shall be used by devices implementing the usage model called ‘Ultimate Headset´.

    FP Profile

    The Fax Profile defines the requirements for Bluetooth devices necessary to support the Fax use case. This allows a Bluetooth cellular phone (or modem) to be used by a computer as a wireless fax modem to send/receive a fax message.

    GOEP Profile (obex)

    The Generic Object Exchange Profile lays the basis (defines the protocols and procedures) for Bluetooth devices necessary for the support of the object exchange usage models. The usage model can be the Synchronization , File Transfer, or Object Push model.

    OPP Profile

    The Object Push Profile defines the requirements for applications providing the object push usage model.Typical scenarios covered by this profile involve the pushing/pulling of data objects between Bluetooth devices

    FTP Profile
    The File Transfer Profile defines the requirements for applications providing the file transfer usage model.Typical scenarios involve a Bluetooth device browsing, transferring and manipulating objects on/with another Bluetooth device.

    SP Profile
    The Synchronization Profile defines the requirements for applications providing the synchronization usage model.Typical scenarios covered by this profile involving manual or automatic synchronization of PIM data when 2 Bluetooth devices come within range.


    3.2 links to bluetooth stuff


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    The official site is http://www.bluetooth.com/. With many pdf-files
    Core specifications are here:
    http://www.bluetooth.com/pdf/Bluetooth_11_Specifications_Book.pdf

    Tutorial/howto
    The best explanation on bluetooth I know is here:
    L2CAP: Logical Link Control and Adaptation Protocol
    http://eie555.eie.polyu.edu.hk/tut/tutorial/l2cap.html
    RFCOMM Protocol:
    http://eie555.eie.polyu.edu.hk/tut/tutorial/rfcomm.html
    Service Discovery Protocol (SDP) at
    http://eie555.eie.polyu.edu.hk/tut/tutorial/sdp.html
    Profiles at:
    http://eie555.eie.polyu.edu.hk/tut/tutorial/profiles.html
    PAN and BNEP at:
    http://www.telematik.informatik.uni-
    karlsruhe.de/lehre/WS0102/ag/BNEP.
    pdf

    Pan description at:
    http://www.kjhole.com/Bluetooth/PDF/Bluetooth10.pdf

    About Profiles at:
    http://www.ericsson.com/bluetooth/files/profile_components.pdf

        Devices at: http://www.holtmann.org/linux/bluetooth/devices.html
    Manymore links at : http://www.holtmann.org/linux/bluetooth/

    HowTo set up common PAN scenarios with BlueZ's integrated PAN support http://bluez.sourceforge.net/contrib/HOWTO-PAN

    3.3 how is this implemented in bluez


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    Bluez stack supports:
    - General Access Profie
    - Service Discovery Profile
    - Serial Port Profile
    - DialUp Networking Profile
    - LAN Access Profile
    - OBEX Object Push Profile
    - OBEX File Transfer Profile
    - PAN Profile

    Bluez has a core package called bluez-kernel that includes all to set up the core of bluetooth. It takes care of making HCI-devices, the L2cap and LMP/LC protocols. It is already a part of the 2.4.x kernel. In kernel 2.4.18 you need to patch the kernel with the bluez-kernel package and compile the kernel (mandrake 9.0 for instance). In Mandrake 9.1, which uses kernel 2.4.21, you need not bother with patching your kernel: all code is already in. For other kernel's please see the website of Marcel Holtman which has the patches you need or see the bluez website for details. This how to only covers kernel 2.4.18 and 2.4.21 and beyond.

  • For kernel 2.4.18 The confusing bit at this moment is that the latest version is a lot more advanced and better then the code in the kernel. Thus you must compile a kernel without bluez in it, and then the bluez-kernel package makes modules that you can dynamically load with insmod and so on. The install also has scripts to set up the /dev devices needed like /dev/rfcomm0-256 and more.
  • For kernel 2.4.21 you need not do anything. All source is already there: no recompiling needed.

    Included in the bluez-kernel code is HCI UART driver, HCI PCMCIA drivers RFCOMM protocol and some BNEP stuff. I think it also has sdp but I am not sure.

    There are two more things you need for all bluetooth stuff. The bluetooth libraries (no idea why you need such things) and the bluez-utils. The bluez-utils are needed to bring the HCIx devices up for instance. You can also search for devices and bind serial ports and so on. It thus includes tools to use the kernel-code to make bluetooth connections and so on. It also included trouble shootings tools.

    Separately is the Pan-package which includes LAN Access over PPP profile (dund) and has pand
     - PAN/BNEP client and server dund
     - LAN access client and server

    Also separate is the SDP package with the sdp server I think to search and advertise bluetooth services (for instance a nokia 6310 has a dial-in service or modem it advertises by sdp.)

    4 what do you need installed and what does it do


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

      4.1 kernell stuff

  • For kernel 2.4.21 you can skip this section and go to 5.2: programs and tools.
  • For kernel 2.4.19 and 2.4.20 you need patches from http://bluez.sourceforge.net/. This howto does not cover that. Some info about these 2.4.19/2.4.20 kernels from Marcel Holtman:

    The best way is to install your own kernel with one of my Bluetooth patches. I prefer the 2.4.20-mh6, but you can also use the 2.4.19, but at the moment it only exists the -mh5 (I am working on the -mh6 for 2.4.19). And for example the -mh6 contains all previous patches for that kernel version, like the -ac ones.

    You should not install the bluez-kernel-2.3 package, because it is deprecated and out of date. You will miss many bugfixes and features.

    (my comment here: for kernel 2.4.18 you still need to as there is no other way)

    As you are using the SuSE distribution, you can also try one of their new 2.4.20 kernels which includes an update the Bluetooth subsystem as it is now part of the 2.4.21-pre5. The upcoming SuSE 8.2 will use this kind of 2.4.20 by default.

    Regards

    Marcel

  • For kernel 2.4.18 you need the kernel code which builds modules. At 6 november 2002 the
    version is 11.01.2002 BlueZ-Kernel 2.3.

  • If you compile and patch your kernel beware of the bluetooth.o module: YOU SHOULD DELETE IT!!!! See this commant from Marcel Holtman:
    the bluetooth.o kernel module, which exists in the Linux kernel is a Bluetooth HCI USB (H2) to HCI UART (H4) converter for the Axis OpenBT stack. The BlueZ stack have native support for USB Bluetooth devices which is included in the hci_usb.o module. Since both modules serves the same devices, the hotplug stuff decides to load the bluetooth.o, because of the alphabetical order. You can solve this problem in many ways and the quickest one is to remove the bluetooth.o module from your harddisk.

     4.2 programs and tools

  • For kernel 2.4.18 (mandrake 9.0) you need
    10.07.2002 BlueZ-Utils 2.1
    10.07.2002 BlueZ-Libs 2.2
    and probably
    09.16.2002 BlueZ-SDP 0.8
    Perhaps 11.01.2002 BlueZ-PAN 1.1-pre1, if you wil use acces points
    and so on.

  • For kernel 2.4.21 (Mandrake 9.1) you can use:

    [ ] bluez-bluefw-0.9-1.i..> 26-Dec-2002 15:30 80k
    [ ] bluez-hcidump-1.5-1...> 20-Mar-2003 16:24 29k
    [ ] bluez-libs-2.4-1.i38..> 20-Mar-2003 11:39 102k
    [ ] bluez-pan-1.1-1.i386..> 20-Mar-2003 15:47 25k
    [ ] bluez-sdp-1.1-1.i386..> 20-Mar-2003 14:08 300k
    [ ] bluez-utils-2.3-1.i3..> 20-Mar


    5 how to install (what do i need to install anyway)


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    Whatever you want to do, you need kernel stuff for kernels below 2.4.21 (section 5.1), and always libs and utils (section 5.2):

    5.1 kernell stuff

  • For kernel 2.4.21 go to 5.2: you need not compile anything for the kernel.
  • For kernel 2.4.19/2.4.20 this howto does not cover this. Go to the bluez pages for kernel patches: http://bluez.sourceforge.net/. See the comment from Marcel Holtman:

    The best way is to install your own kernel with one of my Bluetooth patches. I prefer the 2.4.20-mh6, but you can also use the 2.4.19, but at the moment it only exists the -mh5 (I am working on the -mh6 for 2.4.19). And for example the -mh6 contains all previous patches for that kernel version, like the -ac ones. You should not install the bluez-kernel-2.3 package, because it is deprecated and out of date. You will miss many bugfixes and features.
    (my comment here (Hans=Cees): for kernel 2.4.18 you still need to as there is no other way)
    As you are using the SuSE distribution, you can also try one of their new 2.4.20 kernels which includes an update the Bluetooth subsystem as it is now part of the 2.4.21-pre5. The upcoming SuSE 8.2 will use this kind of 2.4.20 by default.

  • For kernel 2.4.18, see here below:

    You need a compiled kernel without bluez in it. So do not compile in bluetooth and also definitly not the bluetooth module in the usb section! All below is the section short guide to compile a kernel. Download the code at http://bluez.sourceforge.net/download/download.html to for instance /home/myname

    unpack the tar.gz like this:

    tar -xzvf bluez-kernel-2.3.tar.gz

    You will now have a directory called bluez-kernel-2.3. Go there

    cd bluez-kernel-2.3

    Follow the instructions in the README (cat README|more) probably it says to do this: do
    ./configure
    and then
    make make install

    Then do

     ./create_dev

    If that file is not there do either 1 or 2:

    1. You can download the "./create_dev" script from:

    http://cvs.sourceforge.net/cgi- bin/viewcvs.cgi/*checkout*/bluez/kernel/create_dev?rev=1.2

       (save it as "create_dev", and do "chmod +x create_dev" before
       running it)

    2: type this with an enter after every line:

    mknod /dev/vhci c 10 250
    chmod 664 /dev/vhci

    then type this:
    C=0;
    while [ $C -lt 256 ]; do
    if [ ! -c /dev/rfcomm$C ]; then
    mknod -m 666 /dev/rfcomm$C c 216 $C
    fi
    C=`expr $C + 1`
    done

    That is it. Watch out though that you type the almost last line with ` ` (below the ~) and not with ' ' or " "!!

    5.2 programs and tools

  • For kernel 2.4.21 (mandrake 9.1) do this:

    1. I dowloaded and installed:

  • [ ] bluez-bluefw-0.9-1.i..> 26-Dec-2002 15:30 80k
  • [ ] bluez-hcidump-1.5-1...> 20-Mar-2003 16:24 29k
  • [ ] bluez-libs-2.4-1.i38..> 20-Mar-2003 11:39 102k
  • [ ] bluez-pan-1.1-1.i386..> 20-Mar-2003 15:47 25k
  • [ ] bluez-sdp-1.1-1.i386..> 20-Mar-2003 14:08 300k
  • [ ] bluez-utils-2.3-1.i3..> 20-Mar

    just put them all in one dir and do :
    rpm -Uhv bl*.rpm

    2. add in /etc/modules.conf:
    alias net-pf-31 bluez
    alias bt-proto-0 l2cap
    alias bt-proto-2 sco
    alias bt-proto-3 rfcomm
    alias bt-proto-4 bnep
    alias tty-ldisc-15 hci_uart

  • For kernel 2.4.18 (mandrake 9.0)follow the steps below:

    Now for the libs.
    Download the libs: bluez-libs-2.2.tar.gz
    tar -xzvf bluez-libs-2.2.tar.gz
    cd bluez-libs-2.2
    cat README|more
    ./configure
    make
    make install

    Now the utils:
    Downlaod bluez-utils-2.1.tar.gz
    tar -xzvf bluez-utils-2.1.tar.gz
    cd bluez-utils-2.1
    cat README|more
    ./configure
    make
    make install

    Note: with the utils I got an error that it could not find glib-config with mandrake 9. I missed the package libglib1.2-devel-1.2.10-6mdk.i586.rpm. Just for the case that you get the same error.

    after that you install bluez-sdp-0.8 (version at 8/11/2002). Install bluez-sdp- 0.8, like above: download, untar;
    ./configure;make;make install.

    Now you have installed what you need, let's get it working.


    6 what steps are needed to get things working


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    6.0 Get your bluetooth device up!

    To do bluetooth you need a bluetooth device. If you follow your log (tail -f /var/log/messages as root) you can see what happens if you plug your usb- dongle/serial-dongle/pcmcia-card in.

    A warning!!!!
    the bluetooth.o kernel module, which exists in the Linux kernel is a Bluetooth HCI USB (H2) to HCI UART (H4) converter for the Axis OpenBT stack. The BlueZ stack have native support for USB Bluetooth devices which is included in the hci_usb.o module. Since both modules serves the same devices, the hotplug stuff decides to load the bluetooth.o, because of the alphabetical order. You can solve this problem in many ways and the quickest one is to remove the bluetooth.o module from your harddisk.
    Thus if something does not work, and you compiled your own pre-2.4.21 kernel, please search for bluetooth.o and delete it! 90% of all trouble stems form this mistake!!

    hciconfig
    wil show you if the device has been spotted.
    hciconfig hci0 up
    should show that the device is up. If so you are on your way.

  • With an uart device (something attached to your serial ports) you
    might have to do:

    hciattach <serial_device> <protocol> <speed> [flow]

    to get the hci0 device working.


    For instance:
    hciattach /dev/ttyS0 csr 115200 flow
    This will make the /dev/ttys0 device your device you can acess like a
    modem for instance.

    Just point /dev/modem to it with:
    ln -s /dev/modem /dev/ttyS0

    At least this is necessary on the iPaq 3870 that as a csr chip connected to a serial port, even with the latest bluez stuff (at 11/11/2002).

    Only after this step a device hci0 appears when you do
     hciconfig hci0 up

  • For an usb device this is not neccesary.

    Now it is needed before or after hciconfig hci0 up to tell hci the settings for hci0. Tell it with:

    hcid -f /etc/bluetooth/hcid.conf
    (I am told that run "/etc/init.d/bluetooth start" will also do the
    trick)

    You may guess that the success of what you do later will depend on that /etc/bluetooth/hcid.conf file. For using hci0 with rfcomm (the code that makes a bluetooth device look like a modem or serial device) to dial up at least, but perhaps also for other purposes that file reads:

    # HCI daemon configuration file.
    #
    #
    options {
            autoinit yes;
            security auto;
            pairing multi;
            pin_helper /etc/bluetooth/givepin;
    }

    device {
            name "LP_AH";
            class 0x100;
            pkt_type DH1,DM1,HV1;
            iscan enable; pscan enable;
            lm master;
            lp hold,sniff,park;
            auth enable;
            encrypt enable;
    }

    **********************************************************************
    **** *******************************

    You might want to change the name section. Also other things if you know what you are doing:-) See "hciconfig --help" to know more about this.

    To make this work with the hcid.conf file above you need the /etc/bluetooth/givepin script. Here is mine:

    ##############givepin##########
    #!/bin/sh
    echo "PIN:123456"
    ################

    Just open an editor and copy this into a file and save it as /etc/bluetooth/givepin Then do

    chmod 710 /etc/bluetooth/givepin

    Obviously your pin then is 123456. Use something different as a pin to be more secure! You need this pin when you connect to a bleutooth device for the first time to set up 'pairing' as it is called. For instance with my nokia 6310 I also put in 123456 the first time when I connected (after saying "yes" to let the connection in) and it answered that a pairing was set up.

    When the files are set up and you did hcid -f /etc/bluetooth/hcid.conf you can find your bluetooth device by doing :


    hcitool scan
    This shows the devices in your neighbourhood with bd address

    To search for services you can do:

  • For kernel 2.4.18:
    sdptool seach --service=DUN <phone bd address>

  • for kernel 2.4.21:
    sdptool search --bdaddr DUN
    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    Now what you want to do depends on your aims. Some of them are layed out below. Take your pick or fill in when you know something that is not yet here.

    6.1 You have more computers you want in a bluetooth network: Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies:

    recipe 1: To make use of the PAN functionality of BlueZ, it is necessary to build the following BlueZ packages: "BlueZ-Kernel 2.2", "BlueZ-Libs 2.0", "Bluez-Utils 2.0", "BlueZ-SDP 0.7" and "BlueZ-PAN 1.0" (or any of the respective follow-up packages). See http://bluez.sourceforge.net/contrib/HOWTO-PAN rfcomm examples for rfcomm and dund: http://sourceforge.net/mailarchive/message.php?msg_id=2228724

    recipe 2: Bluez and i-book with Lan-acces point and cable modem http://bluetooth.mutante.at/bluez_on_ibook.html

    Solution 2: attach two computers with ppp. ppp over rfcomm

    rfcomm examples for rfcomm and dund:
    http://sourceforge.net/mailarchive/message.php?msg_id=2228724

    Recipies:

    6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth.


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    Solution1: dund over pan Use the recipe by Jim Pick. He uses dund and the PAN profile to make contact between a linux computer with bluetooth and the Palm.

    Recipies Beside what was installed above you also need bluez-pan-1.1-pre1.tar.gz - contains dund.

    Here is Jim's recipe. Notice that some things are double or slightly different from what I did above. But since this is one recipe that was delivered as a whole I will keep it in place:

    bluez-pan-1.1-pre1.tar.gz - contains dund A) I modified one line, in order to get it to call "/usr/sbin/pppd call dun" instead of just "/usr/bin/pppd" when it gets a connection:

    --- dund/dun.c.old Sun Nov 3 19:43:18 2002
    +++ dund/dun.c Sun Nov 3 09:52:18 2002
    @@ -203,7 +203,7 @@
                    need_worker = 1;
            }

    -#if 1
    +#if 0
            arg[0] = "pppd";
            arg[1] = tty;
            arg[2] = NULL;

    Also installed is bluez-hcidump-1.3.tar.gz - debugging tool

    B) Make sure your Bluetooth device is working.

    a) Make sure the appropriate kernel modules are loaded for whatever hardware you are using. I have a PCMCIA based Nokia DTL1 card, so which was loaded when I inserted the card by the PCMCIA scripts.

    You can add these lines to /etc/modules.conf to configure automatic module loading.

    alias net-pf-31 bluez
    alias bt-proto-0 l2cap
    alias bt-proto-2 sco
    alias bt-proto-3 rfcomm
    alias bt-proto-4 bnep
    alias tty-ldisc-15 hci_uart
    alias char-major-10-250 hci_vhci

    C) Setup "hcid":

    Edit "/etc/bluetooth/hcid.conf" to set the name of your bluetooth device, eg: My laptop is an IBM Thinkpad X22, so I set up a descriptive name for it: name "Jim's X22";

    Also, modify "/etc/bluetooth/pin" to a security code you select.

    Run "hcid" to start the hcid daemon (or run "/etc/init.d/bluetooth start")

    Look at the output of "ps ax" to verify it's running:

          # ps ax | grep hci
          11654 ? S 0:00 hcid: processing events
          14399 pts/4 S 0:00 grep hci

     D) Run "hcitool dev" to make sure you have a device loaded, eg.

          # hcitool dev
          Devices:
                  hci0 00:E0:03:25:1E:2C

      E) Run "hcitool scan" to find other Bluetooth devices, eg. your
          Palm...

          # hcitool scan
          Scanning ...
                  00:07:E0:08:06:F4 Jim's Palm

    (Make sure your Palm is on, and it's discoverable via Bluetooth, and the Bluetooth is on. It's also worth reseting it, just to be 100% sure it's in a stable state)

      F) Try pinging your Palm...

    # l2ping 00:07:E0:08:06:F4 Ping: 00:07:E0:08:06:F4 from 00:E0:03:25:1E:2C (data size 20) ...

    20 bytes from 00:07:E0:08:06:F4 id 200 time 39.69ms

    20 bytes from 00:07:E0:08:06:F4 id 201 time 40.25ms

    20 bytes from 00:07:E0:08:06:F4 id 202 time 420.26ms

    3 sent, 3 received, 0% loss

    G) Now set up ppp to act as a server:

      H) I create thed /etc/ppp/peers/dun text file, with the contents:

    -- cut here --
    debug
    57600
    noipdefault
    proxyarp
    192.168.4.129:192.168.4.130
    ms-dns 192.168.4.4
    ktune
    -- cut here --

    This is configured for my network at home (on the 192.168.4.x) private subnet. When a connection comes in, it will create a "fake" IP on my ethernet (local IP address 192.168.4.129), giving a remote IP of 192.168.4.130 to the Palm. I also set up a DNS entry. The "ktune" parameter turns on IP forwarding in the kernel on Linux (check the man page - old versions of pppd might not have that option).

    I) Run dund:

    # dund --listen --sdp --channel 1 -n dund[14532]: DUN daemon ver 1.1-pre1

    (it will wait here - I used the "-n" option so that it won't go into the background as a daemon so it's easier to debug)

    Now you should be all setup to connect (unless I forgot to mention something).

    J) Now set up the Palm to connect.

    J1) Go to Preferences->Communication->Bluetooth and make sure
    Bluetooth is on. You can use the "Trusted Devices" button here to
    bind to your gateway, but it's not necessary to do it there yet.

    J2) Go to Preferences->Connection, click the "New..." button, create a name for your connection, select "PC" from the "Connect to:" option, "Bluetooth" for the "Via:" option, and "Tap to Find" for the "Device:" option. With a little luck, the Palm will see your gateway with the name you set in the "Select a device" dialog. Click OK, and if it prompts you, add it to your trusted device list by entering in the passkey. You don't have to touch the default values (57,600bps, automatic flow control) on the "Details" screen.

    J3) Now go to Preferences->Network, and click the "New" button. Enter a name for your network setup, and enter the user name and password that you will be logging in as (a user account on your Linux gateway machine). For "Connection", select the connection name you created in the previous step. That should be all you need. The default values on the "Details" screen should work: Connection Type is set to PPP, Idle Timeout is 1 minute (although for a home gateway, it's nice to set it to "Never"), Query DNS is checked, IP Address is set to "Automatic", and the "Script..." dialog hasn't been customized.

    J4) Now go back to Preferences->Network - you should be able to
    connect. The output from dund should look like:

         # dund --listen --sdp --channel 1 -n
         dund[14617]: DUN daemon ver 1.1-pre1
         dund[14618]: New connection from 00:07:E0:08:06:F4

    The dund daemon starts up "/usr/sbin/pppd call dun" in the background to handle the connection. Usually, most pppd's are set up to log their output to syslog, typically to /var/log/messages. Here's an example of a successful session:

    Nov 3 21:16:35 pepper pppd[14655]: pppd 2.4.1 started by root, uid 0 Nov 3 21:16:35 pepper dund[14654]: New connection from 00:07:E0:08:06:F4 Nov 3 21:16:35 pepper pppd[14655]: Using interface ppp0 Nov 3 21:16:35 pepper pppd[14655]: Connect: ppp0 <--> /dev/rfcomm0 Nov 3 21:16:35 pepper modprobe: modprobe: Can't locate module net-pf-4 Nov 3 21:16:35 pepper modprobe: modprobe: Can't locate module net-pf-5 Nov 3 21:16:38 pepper pppd[14655]: found interface wlan0 for proxy arp Nov 3 21:16:38 pepper pppd[14655]: local IP address 192.168.4.129 Nov 3 21:16:38 pepper pppd[14655]: remote IP address 192.168.4.130

    As the Palm is negotiating, you should see a series of information messages, first "Initializing", then "Signing on", and finally "Established". If you have problems, you can check the menu in Preferences->Network - the Options->View Log menu item has a log of the PPP chat and negotation, including the negotiated IP, gateway and DNS addresses, if you are successful. If you couldn't establish any sort of connection at the Bluetooth level, there will be no log, unfortunately.

    Now you should be able to use TCP/IP based apps such as the web browser and email client. I didn't try syncing yet (I think pilot-tools needs to be updated for PalmOS 5), but I imagine that can be made to work too.

    *

    6.3 You have a mobile phone and you want to dial into your isp


    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Resource: pan and dund over rfcomm |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    Solution: use ppp over rfcomm

    Resource: pan and dund over rfcomm

    http://sourceforge.net/mailarchive/message.php?msg_id=2228724

    Recipies:

    >I have hci0 up and can see the hpone with hcitool scan.
    >But how do I connect to it now and use it to dial into my isp?

  • For kernel 2.4.18:
    First install bluez-sdp-0.8, like above: download, untar;
    ./configure;make;make install.
  • For kernel 2.4.21:
    Download bluez-sdp-1.1-1.i386..> 20-Mar-2003 14:08 300k . Install it with (you have already if you followed this howto from the top)
    rpm -Uhv bluez-sdp*.rpm

    Get the address of your phone by
    hcitool scan.

    For instace my phone is at bt-address:
    00:03:EE:20:77:04

    Do

  • For kernel 2.4.18:
            sdptool seach --service=DUN <phone bd address>

    so with my phone for example:

    sdptool seach --service=DUN 00:03:EE:20:77:04

  • For kernel 2.4.21 with bluez-sdp-1.1-1.i386:
    sdptool search --bdaddr DUN
    so in my case sdptool search --bdaddr 00:03:EE:20:77:04 DUN

    and see if your phone actually has "Dialup Networking" service If it does then you'd get something like

    Searching for DUN on FF:FF:FF:00:00:00 ...
    Service Name: Dial-Up Networking
    Service RecHandle: 0x8051548
    Service Class ID List:
      "Dialup Networking" (0x1103)
      "Generic Networking" (0x1201)
    Protocol Descriptor List:
      "L2CAP" (0x0100)
      "RFCOMM" (0x0003)
        Channel/Port: 1
    Profile Descriptor List:
      "Dialup Networking" (0x1103)
        Version: 1

    Now you can bind a TTY port to your phone and use dialup utilities that you use with serial ports.

            rfcomm bind 0 <phone bd addr> <channel>
    (channel is reported by sdptool)

    my phone says it has channel 1, so that would make the command:

      rfcomm bind 0 00:03:EE:20:77:04 1

    That gives nothing back at the prompt, but in /var/log/messages a line appears that says BlueZ RFCOMM ver 0.4

    From now on use /dev/rfcomm0 just like you'd use /dev/ttyS0 (or whatever serial port you phone is connected to).

    If /dev/rfcomm0 does not exist do:
    for i in `seq 0 255`
    do
    if [ ! -c /dev/rfcomm$i ]; then
    mknod -m 666 /dev/rfcomm$i c 216 $i
    fi
    done

    Well, I like to use /dev/modem so I now do:
    rm-rf /dev/modem
    ln -s /dev/rfcomm0 /dev/modem

    now
    ls-all /dev/modem
    shows /dev/modem -> /dev/rfcomm0
    which is good.
    now I simply do kppp

    click on setup and device and make sure it is pointed at /dev/modem. I had to make sure control line termination is CR/LF for it to work.

    When I now click on connect the phone asks me to allow a connection,
    which I do.

    I then have to put in the pin on the phone. It says it paires. Now the phone starts dialing out! Caramba! It works!

    ifconfig
    should show ppp0
    (some distros have an option "replacedefaultroute" in which case you need not do this): I had to delete an old default route and add the new:
    route delete default
    route add default ppp0

    7. Reference guide: what does that word mean?

    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    - PAN user (PANU):
      Client of a NAP or client-type member of a GN (see below)

    - Group ad-hoc Network (GN) controller: Forwarding node in a peer-to-peer style network (Bluetooth Piconet). Interconnects up to 7 (active) PANUs to a real peer-to- peer network.

    - Network Access Point (NAP): Acts as proxy, router or bridge between an existing network infrastructure (typically LAN) and (up to 7 active) wireless clients (PANUs).

    NAP A Bluetooth device acting as a bridge to connect a piconet to an IP network.


    8. Leftovers from http://www.kjhole.com/Bluetooth/PDF/Bluetooth10.pdf

    ² NAPs and GNs rely on SDP to advertise their services to PANUs ² NAPS and GNs must register their services in a service discovery database before they can be used ² When a NAP or GN service is initialized, the device must initialize its packet Øltering database. This database deØnes which packet types will be forwarded across the Bluetooth link ² The security database must also be initialized if security is used

    A connection between a PANU and a NAP (or GN) is started as
    follows:
    1. ACL link is set up between PANU and NAP
    2. PANU sends LMP host connection req
    3. NAP returns LMP accepted
    4. Security is set up
    5. NAP sends LMP setup complete
    6. PANU sends LMP setup complete
    7. Service discovery
    8. PANU sends LMP detach (or start using PAN services)

    Packet Forwarding
    ² The NAP or GN acts as a bridge and forwards packets between
    PAN users. It performs a subset of the operations speciØed by
    the IEEE 802.1D standard for MAC bridges
    ² Each PAN user is treated as if it was a bridge port. For NAPs the
    Ethernet connection is also treated as a bridge port ² It is possible
    to Ølter out packet types

    Contents |1 What is bluez |2 What can you do with bluez |3 How does bluez work |3.1 how does bluetooth work |3.11 OSI model |3.12 BT layers |3.11 BT profiles |3.2 links to bluetooth stuff |3.3 how is this implemented in bluez |4 what do you need installed and what does it do |4.1 kernell stuff |4.2 programs and tools |5 how to install (what do i need to install anyway) |5.1 kernell stuff |5.2 programs and tools |6 what steps are needed to get things working |6.0 Get your bluetooth device up! |6.1 You have more computers you want in a bluetooth network: |Solution 1: make a bluetooth network with pan (bnep over l2cap) using rfcomm recipies: |Solution 2: attach two computers with ppp. ppp over rfcomm |Recipies: |6.2 You have an ipac or other mobile device and want to synchronize by using bluetooth. |Solution1: dund over pan |Recipies |6.3 You have a mobile phone and you want to dial into your isp |Solution: use pan and ppp over rfcomm |Recipies: |7. Reference guide: what does that word mean? |8. Leftovers from |9. Extra: Little guide to compile your kernel |10. Thanks to these guys you read this

    9. Extra: Little guide to compile your kernel

    9. Little guide to compile your kernel OK, for many things here you need to add things to the kernell. I have seen horrible guides pages and pages long. Let's do it the quick way: Make sure you have the kernell sources installed because you need them to ccompile from. Compiling is making binaries from source. You also need the kernell tools to compile a kernell. You can get the latest sources by doing: 1. cd /usr/src 2. download latest stable source ie do ftp ftp.kernell.org; cd to /pub/linux/kernell..; bin; mget patch-2.4.[567].gz; patch -p0 < patch-2.4.5, patch -p0 You can also not patch but just get the latest full source of the kernell you want and make the link linux to that dir. 3. cd linux; make mrproper; make menuconfig. Here you have to make sure you include the iptables things and you might want the advanced routing stuff and the tos things put in. Look out that you set experimental feature on in the beginning or you will never see some stuff. Save the config you made to for instance /etc/kernell 4. make dep clean bzImage modules modules_install, and wit for the compiling to take a while. 5. cd arch; cd i386; cd boot; cp bzImage /boot/bootvmlinuz2.4.14 (or another number). 6. edit lilo config usually at /etc/lilo.conf and run it: lilo. That's it. 7. If it does not boot it can be too large or other stupid mistakes:-)

    10. Thanks to these guys you read this Andre Hugener!
    Jim Pick!

    11. Thight howto for using an usb dongle with nokia 6530 with mandrake 9.1 to dial into your isp.

    Howto: Steps to use your mobile phone to dial into an isp with mandrake9.1:

    1. I dowloaded and installed:
    [ ] bluez-bluefw-0.9-1.i..> 26-Dec-2002 15:30 80k
    [ ] bluez-hcidump-1.5-1...> 20-Mar-2003 16:24 29k
    [ ] bluez-libs-2.4-1.i38..> 20-Mar-2003 11:39 102k
    [ ] bluez-pan-1.1-1.i386..> 20-Mar-2003 15:47 25k
    [ ] bluez-sdp-1.1-1.i386..> 20-Mar-2003 14:08 300k
    [ ] bluez-utils-2.3-1.i3..> 20-Mar

    just put them all in one dir and do :
    rpm -Uhv bl*.rpm

    2. add in /etc/modules.conf:
    alias net-pf-31 bluez
    alias bt-proto-0 l2cap
    alias bt-proto-2 sco
    alias bt-proto-3 rfcomm
    alias bt-proto-4 bnep
    alias tty-ldisc-15 hci_uart

    3. change /etc/bluetooth/hcid.conf to read:
    # HCI daemon configuration file.
    #
    #
    options {
    autoinit yes;
    security auto;
    pairing multi;
    pin_helper /etc/bluetooth/givepin;
    }
    device {
    name "LP_AH";
    class 0x100;
    pkt_type DH1,DM1,HV1;
    iscan enable; pscan enable;
    lm master;
    lp hold,sniff,park;
    auth enable;
    encrypt enable;
    }

    4. make the
    /etc/bluetooth/givepin script. Here is mine:

    ##############givepin##########
    #!/bin/sh
    echo "PIN:123456"
    ################

    chmod 710 /etc/bluetooth/givepin

    5.
    hciconfig

    You should see your device.

    6.
    hciconfig hci0 up
    hcid -f /etc/bluetooth/hcid.conf

    hcitool scan

    you should see your phone (if you have bluetooth on).

    sdptool search --bdaddr DUN

    The phone might pair right now, if it was not paired already and the pin is correct.

    The sdptool should say it found dial-up networking channel 1 (or another channel).

    rfcomm bind 0 1
    (where 1 is the channel address)

    and logging (/var/log/messages) says: bluez rfcomm ver 0.4

    7. make /dev/entries for rfcomm:
    for i in `seq 0 255`
    do
    if [ ! -c /dev/rfcomm$i ]; then
    mknod -m 666 /dev/rfcomm$i c 216 $i
    fi
    done

    8. make a link to the /dev/rfcomm device (only if you use kppp. You cannot add /dev/rfcomm0 as a device there):
    rm-rf /dev/modem
    ln -s /dev/rfcomm0 /dev/modem

    9. start up kppp. I had to make sure control line termination is CR/LF for it to work under device. Hardware control is on and the device is /dev/modem.

    Then dialing out worked via the phone.

    ifconfig
    should show ppp0

    (some distros have an option "replacedefaultroute" in which case you need not do this): I had to delete an old default route and add the new:
    route delete default
    route add default ppp0

    and could ping the world (which I did).