sitemap  |  contact  |  about us  



Bluetooth on FreeBSD

This is a collection of the mail traffic i had with the developer of the bluetooth stack Maksim Yevmenkin [m_evmenkin at yahoo.com], to setup a complete connection between my Windows XP and my FreeBSD 5.0-RELEASE Server.


I.) The Hardware / Software

  • AMD Duron 1300
  • MSI PC2PC Bluetooth dongle
  • FreeBSD 5.0-RELEASE (original)
  • bluetooth-patch from 2003-03-05
  • gcc-3.2


II.) The system patching 5.0-RELEASE does NOT come with sufficient kernel modules, so you have to install at least the bluetooth-patch from 2003-03-05.
You can find it on http://www.geocities.com/m_evmenkin
Compiling hints from Maksim are :
1) download latest snapshot

2) extract it into your home directory. please *do not* extract shapshot into /usr.
    you *should* build snapshot *outside* of main FreeBSD source tree.

3) build and install kernel modules

cd $snapshot_dir/src/sys/modules/netgraph/bluetooth
make depend
make
make install
make cleandir

4) build and install userspace tools

cd $snapshot_dir/src/usr.bin/bluetooth
make depend
make make install
make cleandir
cd $snapshot_dir/src/usr.sbin/bluetooth
make depend
make
make install
make cleandir

5) build and install ports (optional)

IMPORTANT:
- build snapshot *outside* of FreeBSD main source tree.
- *Do not* update sources in /usr/src. If you run 'cvsup' then all your changes to /usr/src *will be lost*.
- always update your userspace tools - after bulding and installing new kernel
- *do not* forget to re-compile/re-install Bluetooth kernel modules (from snapshot).
  you need this because kernel build will install old (stock) Bluetooth modules
- after making "world" please *do not* forget to re-compile/re-install both kernel modules and userland tools from snapshot.


III.) The Setup Steps

  • Edit your /boot/loader.conf and add line : ng_ubt_load="YES"
  • Manually build and copy : src/share/examples/netgraph/bluetooth/rc.bluetooth ports/sdpd-1.03-rc3/sdpd ports/sdpd-1.03-rc4/tools/sdptool
  • Create a hcsecd.conf (man hcsecd)
    fill with something like :
    device { bdaddr 00:10:31:15:23:CF; name "windoze"; key nokey; pin "0815"; }
  • Edit / Create /etc/ppp/ppp.conf (man rfcomm_pppd has examples)
    pppserver:  
    set timeout 0  
    set lqrperiod 10  
    set ifaddr 10.0.0.1 10.0.0.3 255.255.255.0  
    enable lqr  
    accept lqr  
    nat enable yes  
    disable pap  
    deny pap  
    disable chap  
    deny chap
  • Now run :
    rc.bluetooth start ubt0 => where ubt0 is the device name and might vary for your hardware
    hcsecd => Allows pairing and authentication.
    rfcomm_pppd -C 1 -s -l pppserver => runs the wrapper for the pppd to allow you DUN/LAN access
    sdpd => daemon to get a service overview from your server
    sdptool add --channel=1 LAN => for LAN access OR
    sdptool add --channel=1 DUN => for Dialup Network access
    sdptool browse FF:FF:FF:00:00:00 => shows you the service profiles the sdpd provides
    => Note: ff:ff:ff:00:00:00 - is a "special" BD_ADDR - means your local SPD server. (like localhost) 


IV.) Connecting

Now you can :

  • pair your devices with the pin you entered in the hcsecd.conf
  • see all available services on your BSD Server (LAN / DUN)
  • connect to your service if everything is ok.

You might want yo check out the complete but un-edited email-log. See Links / Files


V.) Links / Files

PavS BSD Corner has a good article to more basic usage of the commands

Here you can find the Complete Mail Log