adafruit / adafruit/Adafruit_CircuitPython_BLE

CircuitPython Locks Up on Disconnect

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

Description

Using the current time service example on a Adafruit Feather nRF52840 Sense with CircuitPython 5.3 (and on 5.4-beta1):

https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/master/examples/ble_current_time_service.py

I connected the sense with my android phone running the Nordic nRF Connect for Mobile app.

Upon connecting to the sense, it proceeds to print the current time. If you disconnect from the sense via the app (close the tab), depending upon the timing of the disconnect, the sense will either print disconnected, as expected, or lock-up. When it's locked up, it appears that its hung up on the cts.current_time statement (line 28). Because of the delay between the time the app disconnects from the sense and the time the sense detects the disconnect, the program attempts to retrieve the current time even though it is really disconnected. You can increase the odds of reproducing this by changing time.sleep(1) in line 29 to time.sleep(0.1).

When locked-up, it becomes unresponsive and you have to manually reset the board.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.