We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adafruit 6.3 and 7 tested on nrf itsybitsy Adafruit CircuitPython 6.3.0 on 2021-06-01; Adafruit ItsyBitsy nRF52840 Express with nRF52840
import gc import time from adafruit_ble import BLERadio ble = BLERadio() devices = set() while True: while ble.connected: connection=ble.connections[0] time.sleep(2) connection.disconnect() print([gc.mem_free(),devices]) time.sleep(5) gc.collect() print("device disconnected, scanning for new devices") print([gc.mem_free(),devices]) for advertisement in ble.start_scan(timeout=10, minimum_rssi=-90): shortname=advertisement.short_name macaddress=advertisement.address devices.add(macaddress) addr = advertisement.address rssi = advertisement.rssi print(["connecting",addr,rssi,gc.mem_free(),devices]) try: ble.connect(advertisement,timeout=5) except: print("can not connect") time.sleep(2) break ble.stop_scan() gc.collect()
Traceback (most recent call last): File "code.py", line 80, in File "adafruit_ble/init.py", line 250, in start_scan MemoryError: memory allocation failed, allocating 42241 bytes
When doing BLE connect and disconnect, "connection.disconnect()" does not release memory after 1 hour memory is exhausted, and finished with error.
Check bellow free memory is droping 3792,2400,2032... etc until error.
[5152, {
No response
The text was updated successfully, but these errors were encountered:
This is believe is the same as adafruit/Adafruit_CircuitPython_BLE#146, which was recently fixed by adafruit/Adafruit_CircuitPython_BLE#147. Please reopen if you think it is a core problem.
Sorry, something went wrong.
No branches or pull requests
CircuitPython version
Code/REPL
Behavior
Traceback (most recent call last):
File "code.py", line 80, in
File "adafruit_ble/init.py", line 250, in start_scan
MemoryError: memory allocation failed, allocating 42241 bytes
Description
When doing BLE connect and disconnect, "connection.disconnect()" does not release memory after 1 hour
memory is exhausted, and finished with error.
Check bellow free memory is droping 3792,2400,2032... etc until error.
[5152, {
}]device disconnected, scanning for new AERAs
[5728, {}]
['connected', , -53, 3792, {}]
[1, 1]
[4272, {}]
device disconnected, scanning for new AERAs
[4848, {}]
['connected', , -56, 2400, {}]
[1, 0]
[3392, {}]
device disconnected, scanning for new AERAs
[3968, {}]
supervisor reload
['connected', , -62, 2032, {}]
[1, 1]
Additional information
No response
The text was updated successfully, but these errors were encountered: