BeagleBone Green Wireless-Playing Music through a Bluetooth Speaker or Headset
2016-05-25 | By Maker.io Staff
1. Connect your BeagleBone Green to your PC and open the cloud9 IDE.
Figure 1: Open up Cloud9 IDE
2. Start a new terminal
Figure 2: Start a new terminal
3. In the terminal window input the following command to setup the device and load the Bluetooth firmware and script including Bluetooth settings:
bb-w18xx-bluetooth
Figure 3: Load Bluetooth module
4. Type the following command in the terminal to enable the Bluetooth configuration mode:
bluetoothctl
The figure below shows the Bluetooth controller your using on the BeagleBone Green Wireless.
Figure 4: Load the Bluetooth control program
5. Power on your Bluetooth earphone or other audio Bluetooth device and get into the Bluetooth discovery mode.
6. In the terminal window in Cloud9 IDE type the following command to search for Bluetooth devices around your BeagleBone Green Wireless board:
scan on
Figure 5: Scan for Bluetooth Devices
Here I can see my Bluetooth device name is “QY7”, and the hardware address I want to connect is “1C:52:16:06:72:71”.
7. Once you have recognized the Bluetooth device make a note of the ID and then type the following command to turn off the Bluetooth searching:
scan off
Figure 6: Turn off Bluetooth Scan
8. To pair with the Bluetooth device type the following into the terminal, ensuring the device ID is correct:
pair 1C:52:16:06:72:71
Figure 7: Pair with your Bluetooth Device
You should see that you have successfully paired with your device as shown in Figure 7.
9. Once paired you will need to add the Bluetooth device to a list of trusted devices by typing the following command:
trust 1C:52:16:06:72:71
Figure 8: Add your device to a list of trusted devices
10. And Finally to connect to the Bluetooth Device type the following command in to connect:
connect 1C:52:16:06:72:71
Figure 9: Connect to your Bluetooth Device
Congratulations your device is connected to the BeagleBone Green Wireless using Bluetooth, now let’s play some music and listen to it through your Bluetooth audio device.
11. To exit the Bluetooth Control mode in the terminal, simply type the following:
quit
12. Plug your USB thumb disk into one of the BeagleBone Green Wireless USB ports with music files inside.
13. To mount the USB drive, type the following in the terminal:
mount /dev/sda1/ /mnt/
Now the USB disk path is in the /mnt path
14. To play the music files on your USB drive we are going to use mpg123 which is already pre-installed on the BBG Wireless. Type the following with the name of your music file:
mpg123 /mnt/Fix\ music.mp3
TIP: If there is space in the name of your music file,you need to type it as”\ ”
Figure 10: Playing music on the BBG Wireless using Bluetooth
Now you should hear the music playing through your Bluetooth device.
15. If you wish to control the Audio volume on the BeagleBone Green Wireless then you can type the following in the terminal:
Alsamixer
Figure 11: Alsamixer Volume Control
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum