0

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?

Thanks

7
  • How can I restore the ability to make a bluetooth connection? seems to be a question about your phone ... why are you not asking at a site that deals with android phones? – jsotola Feb 26 at 19:05
  • Did my custom app break something? ... only you can determine the answer to that, because you are the one who knows what custom app actually is – jsotola Feb 26 at 19:09
  • 1
    Do you still have the Bluedot server running on the RPi? The Connection failed - no usable services on this device is typically when your client/phone is looking for a Bluetooth service on the RPi and doesn't find it running. You say you have removed the pairing and so I suspect that is why it is likely it now doesn't connect. Having bluetoothctl open in a different terminal is always a good idea when your are debugging. As is looking at service bluetooth status occasionally or have journalctl -f -u bluetooth in another terminal. – ukBaz Feb 27 at 8:06
  • @jsotola I should have mentioned this in my question (will update), I know the problem isn't the phone because I can still use my phone to connect to other BT devices as normal, yet when I try to connect any other BT device to the RPi I get the same problem... My question about restoring the ability to connect could have been put more bluntly as 'how do I fix the RPi's bluetooth'. The custom app also seems not to be the problem as it works with other devices (question updated again). Thanks – S. Dunnim Feb 27 at 11:16
  • 1
    That Failed to set privacy: Rejected (0x0b) is an error message I have seen before but I can't find the previous answer. From memory I seem to remember it was BlueZ firmware issue on the Raspberry Pi. You can find what version you have with dpkg -l | grep bluez. Doing an apt upgrade might be a good idea. You might also want to take a look at: github.com/martinohanlon/BlueDot/issues/160 – ukBaz Feb 27 at 12:10
1

I had a similar problem connecting to Androids, and wrote this interface to eliminate bluez - but it will only connect the Pi as a client to Android as a server, not the other way round.

https://github.com/petzval/btferret

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.