There is nearly no issue with connecting and disconnecting. The "BLE Connected" block correctly reports "true" while it is connected. However, I suspect there might be a problem related to registering with the services. My testing procedure is as follows:
- Connect.
- Send a command string.
- Disconnect.
- Wait for 2 seconds and then repeat from step 1.
Additionally, I implemented code in MicroBlocks to send messages every second when BLE is connected. I discovered that the problem occurs on both ends. During my tests, when the phone is unable to send any messages to the ESP32, the ESP32 also cannot send messages to the phone, even though BLE appears to be connected.