I have a Rpi Zero W with headless setup and I am trying to connect my bluetooth speaker into my Raspberry Pi W.
I followed this Setup Bluetooth on Raspberry Pi
I followed these steps to be exact
1. sudo bluetoothctl
2. pairable on
3. scan on
4. scan off
5. agent on
6. pair xx:xx:xx:xx:xx:xx
7. trust xx:xx:xx:xx:xx:xx
8. connect xx:xx:xx:xx:xx:xx
9. info xx:xx:xx:xx:xx:xx
... will show the success again (some Information are displayed).
10. exit
The output is as followed:
When I began to pair, I got the following message, the connected becomes "yes"
[bluetooth]# pair FB:58:FA:29:14:20
Attempting to pair with FB:58:FA:29:14:20
[CHG] Device FB:58:FA:29:14:20 Connected: yes
[CHG] Device FB:58:FA:29:14:20 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device FB:58:FA:29:14:20 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device FB:58:FA:29:14:20 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device FB:58:FA:29:14:20 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device FB:58:FA:29:14:20 ServicesResolved: yes
[CHG] Device FB:58:FA:29:14:20 Paired: yes
Pairing successful
I noticed that the prompt changed from [bluetooth] to the name of my Bluetooth Speaker [CS BT 20G]. After which I see that the Connected becomes "no"
[CS BT 20G]
[CHG] Device FB:58:FA:29:14:20 ServicesResolved: no
[CHG] Device FB:58:FA:29:14:20 Connected: no
I checked the paired-devices
[bluetooth]# paired-devices
Device FC:58:FA:29:14:20 MI BT 18I
and apply the trust
[bluetooth]# trust FB:58:FA:29:14:20
[CHG] Device FB:58:FA:29:14:20 Trusted: yes
Changing FB:58:FA:29:14:20 trust succeeded
but when I tried to connect, I am getting this
[bluetooth]# connect FC:58:FA:29:14:20
Attempting to connect to FB:58:FA:29:14:20
Failed to connect: org.bluez.Error.Failed
I ran info and I got these. Notice that the connected = "no"
[bluetooth]# info FC:58:FA:29:14:20
Device FC:58:FA:29:14:20 (public)
Name: MI BT 18I
Alias: MI BT 18I
Class: 0x00260414
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: no
UUID: Headset (00001108-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb)
[bluetooth]#
When I tried to play an mp3 music
omxplayer -o alsa example.mp3
I am not hearing anything. Not sure but why my connection is getting dropped by my rpi?