-
Notifications
You must be signed in to change notification settings - Fork 397
Connecting_Bluetooth_device_to_Phoniebox
Taken from the Phoniebox@GitHub issues forum
Connecting your Raspberry Pi Phoniebox to Bluetooth speakers or headsets:
- Have a finished Phoniebox running (this howto was tested on the Phoniebox Classic meaning: no Spotify, version 1.1.7)
- Tested on Raspberry Pi Zero W
- Raspbian Image "2018-10-09-raspbian-stretch-lite"
- Phoniebox 1.1.7 Classic - without Spotify
Make an update and install the required software:
Note
The package bluealsa
isn't available anymore since bullseye.
For bookworm you can use bluez-alsa-utils
instead.
sudo apt update && sudo apt upgrade
sudo apt install bluealsa
sudo reboot
The reboot is necessary!
Switch on your Bluetooth speakers / gadgets. Then:
sudo bluetoothctl
And type in the following commands in this order:
power on
agent on
scan on
Now the Phoniebox is looking for nearby Bluetooth equipment, which looked like this in my case:
pi@phoniebox:~ $ sudo bluetoothctl
[NEW] Controller B8:27:EB:26:53:17 phoniebox [default]
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# agent on
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller B8:27:EB:26:53:17 Discovering: yes
[NEW] Device FC:58:FA:DD:AA:D2 MD 43438
Note down the Mac address of your hardware, we need it later. In my case:
[NEW] Device FC:58:FA:DD:AA:D2 MD 43438
Now the pairing happens. This is what I did, you need to replace the MAC address with the one from your hardware:
pair FC:58:FA:DD:AA:D2
trust the hardware
trust FC:58:FA:DD:AA:D2
connect to the hardware
connect FC:58:FA:DD:AA:D2
Stop the discovery mode
scan off
exit
Create a new file
sudo nano /etc/asound.conf
This is the content of the new file (in my case, again use your MAC address). I called my device here pcm.btspeaker
. You can change that name to e.g. pcm.sonosspeaker`
pcm.btspeaker {
type plug
slave.pcm {
type bluealsa
service "org.bluealsa"
device "FC:58:FA:DD:AA:D2"
profile "a2dp"
delay -20000
}
hint {
show on
description "Medion Partybox"
}
}
Try if it works. If you used a different name than pcm.btspeaker
you need to change it in the following command:
aplay -D btspeaker /usr/share/sounds/alsa/Front_Center.wav
Almost done, you need to edit the mpd.conf
file:
sudo nano /etc/mpd.conf
Look for audio_output
and edit some lines. In my case to this:
type "alsa"
name "My ALSA Device"
device "btspeaker" # see https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/284#issuecomment-443497319
mixer_type "software" # optional
Done and good luck! Questions, suggestion, etc in the thread linked at the top of this document.
If you like Phoniebox, consider: buy me a coffee or PayPal
- Code: https://github.com/MiczFlor/RPi-Jukebox-RFID
- Phoniebox home page: English | Deutsch
Phoniebox is a contactless jukebox for the Raspberry Pi, playing audio files, playlists, podcasts, web streams and spotify triggered by RFID cards. All plug and play via USB, no soldering iron needed. Update: if you must, it now also features a howto for adding GPIO buttons controls.
Visit Phoniebox.de
π₯ Version 3
- β Releases
- π΅ Install Jukebox Version 3
- π Report a bug
- π Propose a feature
- βοΈ Feature Status
- π Documentation
- π©βπ» Development
- βοΈ Contributing
- π¦ Code
πΆ Version 2
- β Releases
- π΅ Install Jukebox Version 2
- π Report a bug
- βοΈ Features
- π Documentation
- βοΈ Contributing
- π¦ Code
Version 2 Pages
-
Setup / Upgrades
- Synchronising Phonieboxes in a local network
- Smart Home remote control with MQTT
- Hardware Pinout Overview
- Systemwide Equalizer
- Phoniebox with read-only Filesystem
- HiFiBerry Soundcard Details
- WM8960 Hi-Fi HAT
- PAM8403 Amplifier Power Off
- TPA3118 Amplifier Power Off and EMI improvement
- External Non USB Audio DAC ES9023, PCM5102, etc.
- On-board LEDs with fibre optics
- Setting GPIOs at boot time
- Stop on removal with USB RFID Reader
- Firmware update improves audio out
- Architecture