question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BLE problems on Raspberry Pi 3B+ and 4

See original GitHub issue
  • bleak version: 0.8.0
  • Python version: 3.7.3
  • Operating System: Raspberry Pi OS buster (completely up to date) on Raspberry Pi 3B+ and 4
  • BlueZ version (bluetoothctl -v) in case of Linux: 5.50

This is not a bleak problem per se, I believe.

I’m trying to get bleak to work on an RPi 4 (and 3B+). It works fine on an RPi Zero W and 3B, but swapping the SD card from the RPi Zero W into an RPi 4 or 3B+ (assuring that the OS setup is identical) gives this error when trying to do service discovery:

...
  File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/client.py", line 154, in connect
    await self.get_services()
  File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/client.py", line 384, in get_services
    raise BleakError("Services discovery error")

The properties value ServicesResolved never becomes True, which causes the error.

If anyone has gotten bleak to work on an RPi4, I’d love to hear what you had to do. I’ve scoured the RPi forums, etc., and haven’t come up with any solution. The wifi/BLE adapter chip is supposed to be identical between the two boards. [EDIT: In fact, the wifi hardware changed between 3B and 3B+, though it’s hard to find this out.] Thanks.

EDIT: Further testing shows it works on Pi0W and Pi3B, but not on Pi3B+ and Pi4B.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dhalbertcommented, Mar 21, 2021

The bluez-firmware-1.2-4+rpt7 and rpt8 versions fix the problem mentioned. Use rpt8, which includes security fix not in rpt7.

1reaction
dhalbertcommented, Nov 20, 2020

Reopening this for your interest because there is new firmware under test at RPi-Distro/bluez-firmware#6. Unfortunately it does not work for me.

Turns out for some reason I had to power cycle the board (not just reboot) in order to test the new firmware properly. It now does work for me, getting values from a pulse oximeter via our software on top of bleak.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BLE problems with latest bluez-firmware in RPi-3B+ and ...
The connection is usually timed-out and Pairing+Bonding is either timed-out or rejected. steps to reproduce: 1. configure BLE peripheral via ...
Read more >
Using BLE Devices with a Raspberry Pi
Raspberry Pi BLE Performance​​ Before we get into running the Raspberry Pi, we wanted to discuss a bit about performance. After all, no...
Read more >
Fix Raspberry Pi 3 Bluetooth Issues • Pi Supply Maker Zone
There are many guides on how to get Bluetooth working on Raspberry Pi 3 already, but again I found that some crucial steps...
Read more >
Ask Question
Does RPi 3 have BLE (Bluetooth Low Energy/Bluetooth 4.0/Bluetooth Smart) ... And if it does, how do I find BLE devices or install...
Read more >
Connect BLE devices with Raspberry pi 3 B
Well at this point either your BLE Device does not allow the connection or bluez is not working on your rpi. Did you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found