I'm trying to communicate between my RPi4 and a custom Android app on my phone via bluetooth. I had paired the devices, established a connection, and was even sending data over a serial connection, using the Bluedot server on the RPi, and an 'off-the-shelf' BT terminal app for Android.
However, when I tried to connect using my custom App, the app said the connection failed (I didn't have bluetoothctl open at the time so unsure how the RPi responded). I have stopped using the custom app and now can't even make a bluetooth connection. When I tried to connect, the connection would show up as 'on' in the terminal for a second, then show up as 'off'. I tried unpairing the phone and the Pi, rebooting the pi, uninstalling blueman, and reinstalling blueman when that didn't work. Now the connection won't even show up for a second, and if I try to connect using the RPi's BT UI, I get the message 'Connection failed - no usable services on this device'. (Very similar to this problem, although the accepted answer in that case doesn't help me here, as I know I had it working before...)
My Android mobile bluetooth is working as I have tested it on other devices; I have also tested other devices with the RPi and there is a similar problem, so there is definitely something wrong with the RPi.
How would I fix the bluetooth on the RPi? Would it be best to do a complete rewrite of the OS?