adafruit / adafruit/Adafruit_CircuitPython_BLE_BroadcastNet

Bluetooth LE Sensor Nodes to Raspberry Pi WiFi Bridge - Stuck at scanning

Open
#11 13 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Python
Stars
14
Forks
7
PR merge metrics
No merged PRs in 30d

Description

From the guide by John Park at https://learn.adafruit.com/bluetooth-le-broadcastnet-sensor-node-raspberry-pi-wifi-bridge/overview ......

Following through the guide and executing on an upto date Pi OS on Zero W everything goes fine until you actually execute `python3 ble_broadcastnet_blinka_bridge.py`

After this , instead of finding the Clue (which has the prescribed basic broadcast script running and is tested with both CP5.3 and CP5.4BETA), the output is stuck at

This is BroadcastNet bridge: b827eb2d289a

```
Fetching existing feeds.
{}
scanning
```

until after about 15 minutes an error (memory error) stops python 3.7 running on the Pi Zero W and the following extra output is given :

```
Traceback (most recent call last):
File "ble_broadcastnet_blinka_bridge.py", line 113, in
adafruit_ble_broadcastnet.AdafruitSensorMeasurement, interval=0.5
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_ble/__init__.py", line 243, in start_scan
active=active,
File "/home/pi/.local/lib/python3.7/site-packages/_bleio/adapter_.py", line 201, in start_scan
prefixes, timeout=timeout, minimum_rssi=minimum_rssi, active=active,
File "/home/pi/.local/lib/python3.7/site-packages/_bleio/adapter_.py", line 299, in _start_scan_hcitool
buffered, prefixes, minimum_rssi, active
File "/home/pi/.local/lib/python3.7/site-packages/_bleio/adapter_.py", line 261, in _parse_hcidump_data
if scan_entry.matches(prefixes, all=False):
File "/home/pi/.local/lib/python3.7/site-packages/_bleio/scan_entry.py", line 79, in matches
fields = self._advertisement_fields
File "/home/pi/.local/lib/python3.7/site-packages/_bleio/scan_entry.py", line 138, in _advertisement_fields
fields.append(self._advertisement_bytes[idx + 1 : idx + field_length])
MemoryError
```

This same fault was raised by another use in Adafruit Customer forums in MArch at https://forums.adafruit.com/viewtopic.php?f=50&t=163964 and by myself earlier today at https://forums.adafruit.com/viewtopic.php?f=65&t=166701

Would like to get this to work, and given I can see the CLUE in a bluetooth scan from Bluefruit Connect iOS app I'm at a loss as to whether this is down to Adafruit_CircuitPython_BLE_BroadcastNet or the CP library adafruit_ble_broadcastnet.mpy

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the scan from ble_broadcastnet_blinka_bridge.py on the Raspberry Pi Zero W and compare the traceback through adafruit_ble/__init__.py and _bleio/adapter_.py. Inspect _bleio/scan_entry.py around advertisement-field parsing. Done means the bridge completes scanning without MemoryError and detects the running CLUE sensor.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, raspberry-pi
Domain
embedded-iot, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.