HowTo: Install bluez and dbus

I had a lot of trouble installing bluez-5.16 on my Raspberry Pis. But finally i made it and i wrote a little script. Which might be helpful for many of you.

Bluez is supporting the Bluetooth Low Energy (BLE) or Bluetooth Smart stack. So first thing i did was buying a Bluetooth LE USB Dongle on Amazon (DE / US).

Anyway here is the script. It’s pretty ugly written any maybe you should just copy and paste it line by line to install it on your machine otherwise i might miss some error messages that could occure. I’m using bluez-5.17 amd dbus-1.8.0.

 BE CAREFUL WITH SIMPLY COPYING THE COMMANDS, SOME CHARACTERS WILL BE WRONG e.g. the — of the .configure.

#!/bin/bash

if [ “$(id -u)” != “0” ]; then
echo “Sorry, but you have to be root.”
exit 1
fi
apt-get update
apt-get upgrade
apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
echo “Creating bluez_temp folder”
mkdir bluez_temp
cd bluez_temp
echo “Download: bluez-5.17”
wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.17.tar.xz
echo “Download: dbus-1.8.0”
wget http://dbus.freedesktop.org/releases/dbus/dbus-1.8.0.tar.gz
echo “uncompressing”
tar –xz -xvf bluez-5.17.tar.xz
tar xzf dbus-1.8.0.tar.gz
cd dbus-1.8.0
echo “install dbus-1.8.0”
./configure
make
make install
cd ../bluez-5.17
echo “install dbus-1.8.0”
./configure –disable-systemd –enable-library
make
make install
sudo apt-get install python-bluetooth python-requests
sudo hciconfig hci0 up

To avoid a problem that might occur we need to add a permission to the dbus bluetooth config.

sudo su –
cd /etc/dbus-1/system.d
nano bluetooth.conf

and add this

 

Than restart the service: service dbus restart.

Advertisements

Posted on April 2, 2014, in Uncategorized. Bookmark the permalink. 1 Comment.

  1. I had problem to install version 5.25. This command for the configuration was helpful:
    LDFLAGS=-lrt ./configure –prefix=/usr –sysconfdir=/etc –localstatedir=/var –enable-library -disable-systemd

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: