The best tools to make your project dreams come true

Login or Signup
USD

BeagleBone Green Wireless-Playing Music through a Bluetooth Speaker or Headset

5/25/2016 | By Maker.io Staff

1. Connect your BeagleBone Green to your PC and open the cloud9 IDE.

Alt Text

Figure 1: Open up Cloud9 IDE

2. Start a new terminal

Alt Text

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

Alt Text

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.

Alt Text

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

Alt Text

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

Alt Text

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

Alt Text

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

Alt Text

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

Alt Text

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”\ ”

Alt Text

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

Alt Text

Figure 11: Alsamixer Volume Control

Seeed Studio’s expanded version “Connect your BBGW to your Bluetooth Earphone” may be seen here: http://cc.seeed.cc/project_detail.html?id=1591