p5.ble.js icon indicating copy to clipboard operation
p5.ble.js copied to clipboard

Auto Reconnect?

Open krdarrah opened this issue 6 years ago • 0 comments

Great library, but been trying to get a reconnect project working. Occasionally, my device will disconnect, so I'd like it to just reconnect as soon as possible. On the Chrome BLE sample projects, they do have an example, and that does work... only problem is that the service and characteristics need to be retrieved again? And how can you do this without relaunching the scanner window?
https://googlechrome.github.io/samples/web-bluetooth/automatic-reconnect.html

So upon a successful reconnect, I tried to start notifications on a characteristic, but get an error: p5.ble.js:11166 Uncaught (in promise) DOMException: Characteristic with UUID c97f391f-a6c4-4778-afac-05f797bbdc5f is no longer valid. Remember to retrieve the characteristic again after reconnecting.

Any ideas how this can work? Thanks!

krdarrah avatar Feb 02 '20 04:02 krdarrah