CANDY-LINE / node-red-contrib-generic-ble

A Node-RED node set for providing access to generic BLE peripheral GATT characteristics.
Apache License 2.0
24 stars 22 forks source link

Feature suggestion: Automatically reconnect #35

Open JasonBSteele opened 4 years ago

JasonBSteele commented 4 years ago

Hi,

I am using a Nano BLE Sense device to listen for sounds, and then infer what they are. If the sound is other than background noise it sends a Notify to the central.

This all works fine, but the Nano device is prone to the occasional disconnection due to it's weak radio. Unfortunately this means I need to connect again, and this is currently done with an Inject. I guess I could monitor the status and send a connect message if it disconnects but I prefer it if the "config" node could reconnect automatically if a check box is checked.

Also if subscribed for events it would need to resubscribe.

dbaba commented 4 years ago

Interesting. Let me try it.

JasonBSteele commented 4 years ago

I set up a Status listening node to connect when disconnected. This deals with the issue most of the time, however occasionally the status is stuck at disconnected or missing. In these cases I find it necessary to go back into the config node and untick the scanning checkbox, then tick it again. When I do this it immediately finds the device and then the status listener does the connection.

dbaba commented 4 years ago

I observed that while reproducing an issue. Scanning on/off commands seem to be required in some cases.