element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Bluetooth Unleashed Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Bluetooth Unleashed Design Challenge
  • More
  • Cancel
Bluetooth Unleashed Design Challenge
Blog Bluetooth Maze - Connecting the Beaglebone Wireless to a Bluetooth Speaker
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: carmelito
  • Date Created: 11 Jun 2018 2:30 AM Date Created
  • Views 1102 views
  • Likes 3 likes
  • Comments 0 comments
  • beaglebone wireless
  • bluetooth_audio
  • bluetooth unleashed
  • beaglebone black wireless
  • beagleboneblackwireless
  • bluetooth_maze
Related
Recommended

Bluetooth Maze - Connecting the Beaglebone Wireless to a Bluetooth Speaker

carmelito
carmelito
11 Jun 2018

As part of this blog post, the idea is to connect  the Beaglebone Wireless to a bluetooth speaker, so that I can play music via bluetooth, but the idea as part of the bluetooth maze project is to have music play via the Beaglebone Wireless via a USB connected to sound card from soundcloud.com using their APIs, and some local music stored on the SD card connected to the Beaglebone.   Now since the theme of this challenge is "Bluetooth Unleashed" , I wanted to try and checkout how easy it was to connect to the a bluetooth speaker to my 'Hero board the Beaglebone Black Wireless.

image

Here are the steps, and some screenshots, if you are interested in following along, in my case I am using a Vivitar Bluetooth Wireless Speaker .

 

Once you have SSH'ed into your Beaglebone and connected to WiFi router, or connected to terminal via the cloud9 IDE (http://192.168.7.2:3000/ide.html ) , run the following commands

 

apt-get update
apt-get install -y pulseaudio pulseaudio-module-bluetooth
gpasswd -a root pulse-access

 

Then switch on your speaker, and check the led sequence to ensure that it is in discovery mode, and run the following commands

 

scan on
agent on
default-agent

 

image

Now make a note of the device address, which in my case is 00:25:DB:14:53:30 for the speaker, replace this with your device id.

pair 00:25:DB:14:53:30
connect 00:25:DB:14:53:30
trust 00:25:DB:14:53:30

 

Add the following to the end of the file using-  nano /etc/dbus-1/system.conf

 

  <policy user="root">
  <allow own="org.pulseaudio.Server"/>
  <allow send_destination="org.bluez"/>
  <allow send_interface="org.bluez.Manager"/>
  </policy>
  <policy user="pulse">
  <allow own="org.pulseaudio.Server"/>
  <allow send_destination="org.bluez"/>
  <allow send_interface="org.bluez.Manager"/>
  </policy>
  <policy context="default">
  <deny own="org.pulseaudio.Server"/>
  <deny send_destination="org.bluez"/>
  <deny send_interface="org.bluez.Manager"/>
  </policy>
</busconfig>

 

once you save and exit the file, restart the Beaglebone wireless so that the changes can take effect using the command - reboot

 

After reboot is done, run the following commands

LANG=C pulseaudio -vvvv --log-time=1 -D --system --disallow-exit --disable-shm
pactl load-module module-bluetooth-policy
pactl load-module module-bluetooth-discover
echo connect 0A:EC:12:01:02:A9 | bluetoothctl
pactl set-default-sink bluez_sink.00_25_DB_14_53_30

 

And then to play sample wav file that comes as part of alsa

aplay /usr/share/sounds/alsa/Front_Center.wav

If you think the volume is too loud use the command - alsamixer , to reduce the volume

image

Just in case you face an issue were you are not able to here sound out of your speaker, and to check if pactl has setup your speaker as the default output , run the following command as shown in the screenshot above.

pactl stat | grep -i "Default Sink:"

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube