Skip to content

Hotspot Bluetooth

Matheus Frigo edited this page Sep 6, 2019 · 2 revisions

Install

To configure a Raspberry Pi 3 as a Bluetooth Hotspot follow there steps: Deploying BlueZ v5.50 on Raspberry Pi 3

The version used for the scripts of the Raspberry Pi is Buster

Bluepy

Installation (Python2)

sudo apt-get install python-pip libglib2.0-dev
sudo pip install bluepy

Installation (Python3)

sudo apt-get install python3-pip libglib2.0-dev
sudo pip3 install bluepy

Using BluetoothCtl

Connecting to device

  1. sudo bluetoothctl
  2. power on
  3. scan on then wait few seconds and turn off scan off
  4. find the MAC of the device you want to connect
  5. connect <MAC>

Write and Read

With the device connected

  1. menu gatt

  2. list-attributes

  3. find the right attribute you want, there is probably one for writting and other for reading

    For this XDK example, we know that:

    1ed9e2c0-266f-11e6-850b-0002a5d5c51b is the UUID to read the service value

    0c68d100-266f-11e6-b388-0002a5d5c51b is the UUID to write to the service

Bluetooth example

  1. select-attribute <attribute>

    For write to the XDK BLE application, for example, you should select select-attribute /org/bluez/hci0/dev_FA_7C_39_BB_25_84/service000e/char000f

    And then use write 0x30 (write 0 in hex)

    For read to the XDK BLE application, for example, you should select select-attribute /org/bluez/hci0/dev_FA_7C_39_BB_25_84/service000e/char0011

    And then use read