BLE Intermittent Crashing

Another update.

Last night I established a connection, made sure I could read and write, then left it overnight. I checked about two hours in and still had a connection. In the morning the device had disconnected but I didn't have any errors. I assumed it might have been because I wasn't keeping the connection alive via a "ping" of some kind.

I changed the program to toggle the value on for 10 seconds, then off again, every 5 minutes. In addition to reading the state every 2 seconds. Everything worked properly for about 6 hours at which the device disconnected. I could not scroll far enough up the terminal to see if there was an error, but Node-RED appeared not to have crashed or reset, but was generating an error every 2 seconds due to trying to read from a disconnected device.

I checked right before I had to step out for some errands and upon seeing the disconnection without any errors I closed my laptop in frustration which turned off my Arduino. When I came back and turned on the laptop again I was able to reconnect without restarting my Node-RED program.

I'm still going to try the other BLE packages to try to get better results but I fear this might be the sort of thing I run into with any of them. I'm going to check again, but I don't think I can use a catch node to catch the disconnect state. I would feel better if I could at least detect a disconnect so that I could attempt to reconnect. Is there another way besides a catch node to catch an error?