Răsfoiți Sursa

bluetooth setup

Peter 5 ani în urmă
părinte
comite
6d98389e50
1 a modificat fișierele cu 57 adăugiri și 0 ștergeri
  1. 57 0
      software/BananaPiM2+/doku.md

+ 57 - 0
software/BananaPiM2+/doku.md

@@ -4,10 +4,67 @@ http://wiki.banana-pi.org/Banana_Pi_BPI-M2%2B#Raspbian
 
 ``` bash
 
+# Install System
+
 sudo fdisk -l
 
 unzip 2018-11-09-debian-9-stretch-mate-desktop-preview-bpi-m2p-4.4-sd-emmc.img.zip
 
 sudo dd if=2018-11-09-debian-9-stretch-mate-desktop-preview-bpi-m2p-sd-emmc.img of=/dev/mmcblk1 bs=10MB
 
+# Bluetooth Setup
+
+sudo apt install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev
+
+wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.49.tar.xz
+
+tar -xf bluez-5.49.tar.xz
+
+cd bluez-5.49/
+
+./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental
+
+make -j4
+
+sudo make install
+
+sudo adduser pi bluetooth
+
+sudo cp /etc/dbus-1/system.d/bluetooth.conf /etc/dbus-1/system.d/bluetooth.conf.bak
+
+sudo nano /etc/dbus-1/system.d/bluetooth.conf
+
+#add the #comment lines to the bluetooth.conf without the # 
+
+<policy user="root">
+    <allow own="org.bluez"/>
+    <allow send_destination="org.bluez"/>
+    <allow send_interface="org.bluez.Agent1"/>
+    <allow send_interface="org.bluez.MediaEndpoint1"/>
+    <allow send_interface="org.bluez.MediaPlayer1"/>
+    <allow send_interface="org.bluez.Profile1"/>
+    #<allow send_interface="org.bluez.AlertAgent1"/>
+    #<allow send_interface="org.bluez.ThermometerWatcher1"/>
+    #<allow send_interface="org.bluez.HeartRateWatcher1"/>
+    #<allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
+    <allow send_interface="org.bluez.GattCharacteristic1"/>
+    <allow send_interface="org.bluez.GattDescriptor1"/>
+    <allow send_interface="org.bluez.LEAdvertisement1"/>
+    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
+    <allow send_interface="org.freedesktop.DBus.Properties"/>
+  </policy>
+
+  #<!-- allow users of bluetooth group to communicate -->
+  #<policy group="bluetooth">
+  #  <allow send_destination="org.bluez"/>
+  #</policy>
+
+  <policy at_console="true">
+    <allow send_destination="org.bluez"/>
+  </policy>
+
+sudo reboot
+
+
+
 ```