[BlueZ] 1、Download install and use the BlueZ and hcitool on PI 3B+

星期日, 02. 九月 2018 11:58下午 – beautifulzzzz

图片 1

This how-to will explain how to download rpm packages from a yum
repository without installing them. This will work on Redhat Enterprise
Linux 5.x, Fedora and CentOS 5.x. 

实际上前日对于mac怎么烧raspbian照旧很有狐疑的。完全不知情,首先先来看下树莓派。小编是在天猫商城上买的。

图片 2

gpio-numbers-pi2.png

You need to install yum plugin called yum-downloadonly. This plugin adds
a –downloadonly flag to yum so that yum can download the packages
without installing/updating them. Following options supported by this
plugin:

图片 3

1. Introduction

Bluez is the default Bluetooth protocol stack on Linux. It should be
present and installed on your Linux distribution. If not, building and
installing from source is not too difficult:

  • [BlueZ] 1、Download install and use the BlueZ and hcitool on PI 3B+。Download the latest stable source release of Bluez from here. Unzip
    the compressed file you downloaded.
  • Install the headers and libraries required for Bluez compilation:

图片 4

  • –downloadonly : don’t update, just download a rpm file to default
    yum cache directory/var/cache/yum/.
  • –downloaddir=/path/to/dir : specifies an alternate directory to
    store packages such as /tmp

pi1

2. Download And Install

I follow the blog (Installing Bluez 5.44 onto
Raspbian?)
to install bluez-5.50.

Download the most recent version from the official
page:.

For example, at the time of writing it was 5.50, so I used(on my pi):

wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.50.tar.xz

Then I extracted it and built it:

tar -xf bluez-5.50.tar.xz
cd bluez-5.50

Read the README! It lists the dependencies and the configure
switches:

Install the dependencies first: (glib, dbus, libdbus, udev, etc.)

sudo apt install libdbus-1-dev libudev-dev libical-dev libreadline-dev

note: If you do not install the libdbus-1-dev, you will later get
this strange error:

configure: error: D-Bus >= 1.6 is required

once you’ve installed dependencies, you can configure switches:

./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var  --enable-experimental

then do:

make
sudo make install

It takes maybe 10 minutes to compile. After installing, you should find
bluetoothd in /usr/libexec/bluetooth. You should also see bluetoothd
in /usr/lib/bluetooth.

Go to each of these directories and type

./bluetoothd --version

You’ll note that the one in libexec is new and the one in lib is old.

In order to make sure that d-bus is talking to you new BlueZ 5.50
and not your old BlueZ 5.43, you need to tell systemd to use the new
bluetooth daemon:

sudo vim /lib/systemd/system/bluetooth.service

Make sure the exec.start line points to your new daemon in
/usr/libexec/bluetooth.

For me, that wasn’t enough. No matter what, upon restart I always got
bluetoothd 5.43… So I just created a symlink from the old one to the
new.

First rename the old file:

sudo mv /usr/lib/bluetooth/bluetoothd /usr/lib/bluetooth/bluetoothd-543.orig

Create the symlink:

sudo ln -s /usr/libexec/bluetooth/bluetoothd /usr/lib/bluetooth/bluetoothd
sudo systemctl daemon-reload

That should do it.

图片 5

Install the yum-downloadonly plugin:

以此是树莓派B+,八个usb,贰个mini
tf卡,1个网口,三个mini充电口,贰个hdmi口主若是那般。

3. How to use the bluez and hcitool

Type the following command to install plugin, enter:

先从官网下载raspbian
的img,下载达成之后,将tf卡挂到mac上边。使用如下命令