adafruit / adafruit/Adafruit_CircuitPython_BLE

TimeoutError when Trying to recive service from connection

Open
#197 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
138
Forks
58
PR merge metrics
No merged PRs in 30d

Description

when trying to recive a service using its UUID i get an TimeoutError:

code.py output:
Scanning...

True
Traceback (most recent call last):
File "code.py", line 18, in
File "adafruit_ble/__init__.py", line 104, in __getitem__
File "adafruit_ble/__init__.py", line 68, in _discover_remote
TimeoutError:

here is the code:

from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.uuid import VendorUUID, StandardUUID

ble = BLERadio()
print("Scanning...")
found = set()

ad = []
for advertisement in ble.start_scan(ProvideServicesAdvertisement):
addr = advertisement.complete_name
if addr == "GravitraxConnect":
found.add(addr)
print(advertisement.services)
con = ble.connect(advertisement, timeout=20)
break
print(con.connected)
print(con[StandardUUID(0xff00)])
print("Scan done")

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the connection and service lookup from the provided code.py example, then inspect adafruit_ble/__init__.py at __getitem__ and _discover_remote. Compare the advertised services with StandardUUID(0xff00); done means the reported service can be retrieved without the TimeoutError, with a regression test or a clearly documented cause.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.