Adafruit_Learning_System_Guides icon indicating copy to clipboard operation
Adafruit_Learning_System_Guides copied to clipboard

update BLE remote control switch; not tested

Open dhalbert opened this issue 6 years ago • 11 comments

This updates the code for https://learn.adafruit.com/circuitpython-ble-remote-control-on-off. Needs testing by @rdagger.

dhalbert avatar Nov 21 '19 20:11 dhalbert

@rdagger do you have time to review this, and still have the hardware set up? Procedure would be to:

  1. Update CircuitPython to 5.0.0-beta.0 (from https://circuitpython.org/downloads)
  2. Update needed libraries to latest (from https://circuitpython.org/libraries)

Thanks.

dhalbert avatar Nov 25 '19 22:11 dhalbert

Did a quick test:

Client code through the following error: File "code.py", line 63, in AttributeError: 'BLEConnection' object has no attribute 'in_waiting'

The server code didn't throw an error but when I tried to connect with the Bluefruit Connect app, I received the following error on my phone: "Uart protocol can not be initialized"

I'm using Adafruit CircuitPython 5.0.0-beta.0-45-gd154d1191 on 2019-11-25; Adafruit Feather nRF52840 Express with nRF52840 and the latest version of CircuitPython Bundle and Adafruit_BLE.

rdagger avatar Nov 25 '19 23:11 rdagger

@rdagger OK, I fixed some code in client.py. I am not getting an error on server.py: it connects fine from my iPhone 6S running the latest OS and app version. What phone are you using?

dhalbert avatar Nov 25 '19 23:11 dhalbert

@dhalbert Google Nexus 6

rdagger avatar Nov 25 '19 23:11 rdagger

Charging up a Samsung Android tablet to check.

dhalbert avatar Nov 25 '19 23:11 dhalbert

I connected with Samsung Tablet, though I had a failed connection first, and then reset the Feather, and it worked second time. Not sure what that was about (maybe leftover connection from iOS).

dhalbert avatar Nov 26 '19 00:11 dhalbert

@dhalbert I restarted my Android phone and the server code is working now using the Bluefruit phone app.

rdagger avatar Nov 26 '19 00:11 rdagger

@dhalbert I spoke too soon. After a few minutes I received the following error from the server code:

Traceback (most recent call last): File "code.py", line 47, in File "code.py", line 45, in File "adafruit_ble/services/nordic.py", line 108, in write File "adafruit_ble/characteristics/stream.py", line 49, in write _bleio.BluetoothError: Unknown soft device error: 3002

rdagger avatar Nov 26 '19 00:11 rdagger

@dhalbert @rdagger given many updates in the BLE core in last 2 months, should this be re-tested?

ladyada avatar Feb 02 '20 18:02 ladyada

it's on my list to rewrite. :)

dhalbert avatar Feb 02 '20 18:02 dhalbert

@dhalbert - is this PR pertinent given the latest work? I'm looking to close open Learn PRs. Thanks

TheKitty avatar Jul 28 '21 20:07 TheKitty