Pi_Bluetooth


SOME TUTORIALS:
https://gist.github.com/actuino/9548329d1bba6663a63886067af5e4cb

Note: pi-bluetooth and bluez are needed but should be already installed on recent Raspbian.

Install:
sudo apt-get install pulseaudio pulseaudio-module-bluetooth

Do This:
sudo usermod -G bluetooth -a pi
sudo reboot

pulseaudio --start

If it complains about not being able to spawn a local server, run
pax11publish -r; /usr/bin/pulseaudio --start


app:
bluetoothctl

Commands:
power on
agent on
scan on
wait for the device to be discovered, note it's address
pair 
trust 
connect  wait for the confirmation, then
quit

To Test : aplay something.wav

If you get this error:
----
[bluetooth]# power on
Failed to set power on: org.bluez.Error.Blocked
----

RUN THIS COMMAND

rfkill unblock all

related article: https://gist.github.com/actuino/9548329d1bba6663a63886067af5e4cb

-----------------
PLAYING A WAVE:
aplay something.wav

SENDING USB MIC TO BLUETOOTH ( I invented Mr Mickrophone )
arecord --device hw:1,0 -c1 -d 0 -r 48100 -f S16_LE -V mono  | aplay