Bluetooth app not working properly, connecting and disconnecting randomly

Any reason why you are using BT instead of BLE?