Adafruit is open and shipping! Let's build back better, together!
0

Broadcastnet Bridge crashing on Pi4
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Broadcastnet Bridge crashing on Pi4

by dmairq on Tue Jun 23, 2020 9:14 am

Not sure where to post this so apologies if it's off topic.

I've been following the John Parks article on how to push sensor data via Bluetooth enabled Arduino's using broadcastnet bridge. Pretty sure I followed the steps to the letter and had no errors during the install. When I try to run the bridge on my new Pi4 (4gb) it hangs on "scanning" and after a couple minutes crashes with a memory error. All the command line bluetooth tools seem to work so I'm not exactly sure what is going on. I can't seem to find any posts on broadcastnet bridge or a similar issue. The article itself has no tips so I've reached a bit of an impasse. Looking for suggestions where to look or debugging tips .

This is BroadcastNet bridge: dce6326e4021

Fetching existing feeds.
{}
scanning

Traceback (most recent call last):
File "ble_broadcastnet_blinka_bridge.py", line 113, in <module>
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

dmairq
 
Posts: 6
Joined: Wed Sep 05, 2018 3:27 pm

Re: Broadcastnet Bridge crashing on Pi4

by adafruitguy on Wed Sep 16, 2020 8:38 am

@dmairq I am running into similar challenges, and was wondering if you had found a fix or if anyone has ideas?

I am running the Bluetooth LE Sensor Nodes to Raspberry Pi WiFi Bridge example from....

https://learn.adafruit.com/bluetooth-le ... e-software

Clue_broadcastnet_sensor_node_and_Pi.jpeg
Hardware Setup
Clue_broadcastnet_sensor_node_and_Pi.jpeg (174.08 KiB) Viewed 83 times


The Clue as sensor node, is running...

Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CLUE nRF52840 Express with nRF52840


With the following code...

Code: Select all | TOGGLE FULL SIZE
"""This uses the CLUE as a Bluetooth LE sensor node."""

import time
from adafruit_clue import clue
import adafruit_ble_broadcastnet

print("This is BroadcastNet CLUE sensor:", adafruit_ble_broadcastnet.device_address)

while True:
    measurement = adafruit_ble_broadcastnet.AdafruitSensorMeasurement()

    measurement.temperature = clue.temperature
    measurement.pressure = clue.pressure
    measurement.relative_humidity = clue.humidity
    measurement.acceleration = clue.acceleration
    measurement.magnetic = clue.magnetic

    print(measurement)
    adafruit_ble_broadcastnet.broadcast(measurement)
    time.sleep(30)


It appears to be running correctly, here is some sample output...

code.py output:
This is BroadcastNet CLUE sensor: f82ad603cfc4
<AdafruitSensorMeasurement temperature=29.6365 pressure=1018.17 relative_humidity=30.3227 acceleration=(-0.0346959, 0.638883, -9.56052) magnetic=(48.9915, -19.1318, 142.049) >
<AdafruitSensorMeasurement temperature=29.6564 pressure=1018.19 relative_humidity=30.3242 acceleration=(-0.026321, 0.626919, -9.59761) magnetic=(48.9477, -18.708, 141.903) >
<AdafruitSensorMeasurement temperature=29.659 pressure=1018.18 relative_humidity=30.309 acceleration=(-0.0131605, 0.649651, -9.55693) magnetic=(49.2838, -18.3864, 141.421) >
<AdafruitSensorMeasurement temperature=29.659 pressure=1018.23 relative_humidity=30.2312 acceleration=(-0.0430708, 0.636491, -9.57727) magnetic=(49.9123, -18.1818, 141.333) >
<AdafruitSensorMeasurement temperature=29.6762 pressure=1018.24 relative_humidity=30.1991 acceleration=(0.0, 0.643669, -9.57966) magnetic=(49.2984, -19.0587, 141.128) >


My Raspberry Pi is setup as describe in the guide and running as the Broadcastnet_blinka_bridge...

Raspberry Pi 4 Model B Rev 1.1
Linux raspberrypiBlinkaBridge 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux


Everything looks fine, it gets to "scanning" and hangs, not seeing any data from the Clue....

pi@raspberrypiBlinkaBridge:~ $ cd Adafruit_CircuitPython_BLE_BroadcastNet/examples/
pi@raspberrypiBlinkaBridge:~/Adafruit_CircuitPython_BLE_BroadcastNet/examples $ ls -al
total 48
drwxr-xr-x 3 pi pi 4096 Sep 16 07:40 .
drwxr-xr-x 6 pi pi 4096 Sep 15 20:53 ..
-rw-r--r-- 1 pi pi 1027 Sep 15 20:53 ble_broadcastnet_battery_level_neopixel.py
-rw-r--r-- 1 pi pi 757 Sep 15 20:53 ble_broadcastnet_battery_level.py
-rw-r--r-- 1 pi pi 5681 Sep 15 20:53 ble_broadcastnet_blinka_bridge.py
-rw-r--r-- 1 pi pi 600 Sep 15 20:53 ble_broadcastnet_cpb.py
-rw-r--r-- 1 pi pi 1625 Sep 15 20:53 ble_broadcastnet_expo_backoff.py
-rw-r--r-- 1 pi pi 1282 Sep 15 20:53 ble_broadcastnet_multisensor.py
-rw-r--r-- 1 pi pi 549 Sep 15 20:53 ble_broadcastnet_simpletest.py
drwxr-xr-x 2 pi pi 4096 Sep 15 21:10 __pycache__
-rw-r--r-- 1 pi pi 105 Sep 15 21:10 secrets.py
pi@raspberrypiBlinkaBridge:~/Adafruit_CircuitPython_BLE_BroadcastNet/examples $ which python3
/usr/bin/python3
pi@raspberrypiBlinkaBridge:~/Adafruit_CircuitPython_BLE_BroadcastNet/examples $ python3 -V
Python 3.7.3
pi@raspberrypiBlinkaBridge:~/Adafruit_CircuitPython_BLE_BroadcastNet/examples $ python3 ble_broadcastnet_blinka_bridge.py
This is BroadcastNet bridge: dca63204e0cf

Fetching existing feeds.
{}
scanning


And after several minutes, it eventually crashes...

python3 ble_broadcastnet_blinka_bridge.py
This is BroadcastNet bridge: dca63204e0cf

Fetching existing feeds.
{}
scanning

Traceback (most recent call last):
File "ble_broadcastnet_blinka_bridge.py", line 113, in <module>
adafruit_ble_broadcastnet.AdafruitSensorMeasurement, interval=0.5
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_ble/__init__.py", line 275, 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 92, in matches
fields = self._advertisement_fields
File "/home/pi/.local/lib/python3.7/site-packages/_bleio/scan_entry.py", line 151, in _advertisement_fields
fields.append(self._advertisement_bytes[idx + 1 : idx + field_length])
MemoryError


I would love some ideas to get this project up and running. Thanks!

adafruitguy
 
Posts: 106
Joined: Sat Jun 07, 2014 7:52 am

Re: Broadcastnet Bridge crashing on Pi4

by dmairq on Wed Sep 16, 2020 4:46 pm

Looks similar. I have not heard anything on this thread and long searches of the internets has not shown me any match close enough to resolve it. I dug around in code for a while trying to figure it out but at a certain point got I just grew tired and moved on to a different shiny penny. Sorry

dmairq
 
Posts: 6
Joined: Wed Sep 05, 2018 3:27 pm

Re: Broadcastnet Bridge crashing on Pi4

by adafruitguy on Wed Sep 16, 2020 5:45 pm

I am also experiencing similar challenges on Pi3...

IMG_7724.jpeg
Also tried Pi 3 B+
IMG_7724.jpeg (271.32 KiB) Viewed 74 times


Plenty of output from the Clue...
<AdafruitSensorMeasurement temperature=30.4842 pressure=1013.57 relative_humidity=30.9041 acceleration=(-0.0717846, 0.571884, -9.64068) magnetic=(52.0169, -19.5995, 146.697) >
<AdafruitSensorMeasurement temperature=30.4668 pressure=1013.53 relative_humidity=30.9636 acceleration=(-0.114855, 0.579063, -9.57727) magnetic=(52.2654, -21.2511, 146.346) >
<AdafruitSensorMeasurement temperature=30.4619 pressure=1013.56 relative_humidity=30.9636 acceleration=(-0.0957129, 0.581456, -9.59282) magnetic=(52.0754, -20.4618, 145.995) >
<AdafruitSensorMeasurement temperature=30.4396 pressure=1013.56 relative_humidity=30.9956 acceleration=(-0.0813559, 0.562313, -9.58325) magnetic=(52.1193, -20.1257, 146.609) >
<AdafruitSensorMeasurement temperature=30.4396 pressure=1013.53 relative_humidity=30.9605 acceleration=(-0.0861416, 0.587438, -9.60479) magnetic=(52.0462, -20.1403, 146.302) >
<AdafruitSensorMeasurement temperature=30.4346 pressure=1013.55 relative_humidity=31.9387 acceleration=(-0.119641, 0.58983, -9.59163) magnetic=(52.0169, -20.3888, 145.908) >
<AdafruitSensorMeasurement temperature=30.4545 pressure=1013.55 relative_humidity=31.1482 acceleration=(-0.0945165, 0.579063, -9.58325) magnetic=(51.7392, -20.1403, 146.478) >
<AdafruitSensorMeasurement temperature=30.457 pressure=1013.55 relative_humidity=31.0384 acceleration=(-0.0981057, 0.587438, -9.58923) magnetic=(51.8562, -20.5057, 145.63) >


Pi Hardware & Running...
Raspberry Pi 3 Model B Plus Rev 1.3
Linux raspberrypiBlinkaBridge 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux


Nothing seen on the Pi, from the Clue...

pi@raspberrypiBlinkaBridge:~ $ cd Adafruit_CircuitPython_BLE_BroadcastNet/
pi@raspberrypiBlinkaBridge:~/Adafruit_CircuitPython_BLE_BroadcastNet $ cd examples/
pi@raspberrypiBlinkaBridge:~/Adafruit_CircuitPython_BLE_BroadcastNet/examples $ python3 ble_broadcastnet_blinka_bridge.py
This is BroadcastNet bridge: b827eb636a12

Fetching existing feeds.
{}
scanning


And eventually, it ungracefully dies...
Killed

adafruitguy
 
Posts: 106
Joined: Sat Jun 07, 2014 7:52 am

Please be positive and constructive with your questions and comments.