I have created my own block for an automatic reconnect function for BT Classic with my ESP32 using a Clock Block. The function itself works to my satisfaction and tries to reconnect to the last stored/connected device as soon as the connection is lost (within the loop time specified in the clock function).
Please find my simplified block here:
The issue if the device is not anymore available/powered:
The problem with my function is that if the device is not powered and therefore no connection with the block below can be re-established, the block seems to halt the entire app and freezes it for a short period of time until the block is completed (without reconnection). Then the app is running smooth for a very short time until the Clock block calls this function again and it again halts/interrupts the app:
Note: this block is part of the Clock function above, see first if clause
Is the a better way to try to reconnect in the background without any interuption of the app?
Thank you very much.