Skip to content

jottenlips/raspberry-pi-ble-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Bluetooth Server Example

Requirements

Raspberry Pi 3 Module running Raspbian Lite aka Debian GNU/Linux 13 (trixie)

PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
NAME="Debian GNU/Linux"
VERSION_ID="13"
VERSION="13 (trixie)"
VERSION_CODENAME=trixie
DEBIAN_VERSION_FULL=13.1
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Install Dependencies

sudo xargs apt install -y < ./manual-packages.txt
# we mostly need dbus and cairo
sudo apt install -y python3-cairo python3-dbus libdbus-1-dev libcairo2-dev

Make Bluetooth Discoverable

sudo systemctl enable bluetooth
sudo systemctl start bluetooth
sudo systemctl status bluetooth # check that it is running 
sudo bluetoothctl
power on
agent on
default-agent
discoverable on
pairable on
scan on
show
sudo nano /etc/bluetooth/main.conf

add these settings under general

[General]
Name = raspberrypi
Class = 0x000100
DiscoverableTimeout = 0
PairableTimeout = 0
AutoEnable=true
sudo systemctl restart bluetooth

Get the BD Address you need

hciconfig

Update this address field in ble_server.py

Verify that Discoverable says yes

bluetoothctl show

Install python dependencies

python3 -m venv --system-site-packages ./venv
source ./venv/bin/activate
pip install bluezero

Run server

 sudo ./venv/bin/python3 ble_server.py

About

🫐 Bluetooth server running on a raspberry pi 🥧

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages