Raspberry Pi A2DP In-Car

When I first googled getting A2DP working with the Raspberry Pi I figured it should be fairly simple with the number of articles around outlining clear instructions but to my dismay they all left crucial bits and pieces out required to function properly. On working straight for a couple of days I’ve perfected my In-Car Pi with fully functioning A2DP.

First off, Hats off to the user @bondjames12 over at the RaspberryPi forums (Here) for sharing an image of his working system. However it did not function completely for myself and what I needed it to do.

In this article I’ll cover a couple of basics after writing @bondjames12 image to your Pi that are needed to get your into action.

What you want to do is grab his image, write that to an SD card and pop it in your Pi.

Turn it on, and login as root:root with Putty (DHCP should be enabled so just find what IP it got set too).

First off the bat my Dongle wasn’t being discovered by my iPhone however I could find my iPhone searching from the Pi itself, so I just had to figure out how to make it discoverable.

Since everyones bluetooth dongle is a different MAC address unfortunatly @bondjames12 could not make a setting that reflect everyones different dongles, so to make the neccessary adjustments direct yourself to the folder: cd /var/lib/bluetooth then type in ls -al. If your dongle is supported by the Pi then you should be seeing two folders with a different MAC address on either. For me I differentiated between the two by comparing the dates on both. Delete the MAC address folder that’s the oldest and keep the one which was created recently.

Once thats done, cd xx:xx:xx:xx:xx:xx (Replacing the x’s with your MAC address folder) into the folder. Now go ahead and type sudo nano config

2015-10-25_14-52-54
The contents of the file should be alot less then what I have, Simply copy what I have written into yours (Change the name of course to what you want 🙂 )

[code type=mysql]
name PiAudio
pairable yes
class 0x4e0100
#class 0x4e0420
onmode discoverable
mode discoverable
[/code]

When your finished save that file (Ctrl + X then hitting the appropriate keys to overwrite the existing file).

Reboot your Pi (sudo reboot)

You may also need to restart your bluetooth on your phone. It should now be discoverable!