Advertisement
Guest User

Untitled

a guest
Mar 14th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. https://gist.github.com/0/c73e2557d875446b9603
  2. https://www.pcsuggest.com/linux-bluetooth-setup-hcitool-bluez/
  3.  
  4.  
  5.  
  6.  
  7.  
  8. defaultuser:pi
  9. defaultpass:raspberry
  10.  
  11. Blend Micro
  12. CC:5A:BC:A3:05:6F
  13.  
  14. https://scribles.net/updating-bluez-on-raspberry-pi-5-43-to-5-48/#Step01
  15.  
  16. bluetoothctl -v
  17. sudo apt-get update
  18. sudo apt-get install libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev -y
  19. wget www.kernel.org/pub/linux/bluetooth/bluez-5.48.tar.xz
  20. tar xvf bluez-5.48.tar.xz && cd bluez-5.48
  21. ./configure --prefix=/usr --mandir=/usr/share/man --sysconfdir=/etc --localstatedir=/var --enable-experimental
  22. make -j4
  23. sudo make install
  24. sudo reboot
  25.  
  26. BLUETOOTH PAIRING AND BONDING
  27.  
  28. bluetoothctl
  29. power on
  30. agent on
  31. scan on
  32. connect <addr>
  33.  
  34. Unpair
  35. remove aa:bb:cc:dd:ee:ff
  36.  
  37. sudo rfcomm connect hci0 <bdaddr>
  38.  
  39. to make the binding for /dev/rfcomm0
  40. rfcomm bind 0 <bdaddr> [channel]
  41.  
  42.  
  43.  
  44. systemctl status bluetooth
  45.  
  46.  
  47. hciconfig -a
  48.  
  49.  
  50. systemctl restart bluetooth
  51.  
  52.  
  53. bluetoothctl
  54.  
  55.  
  56. as root, returns list of known addresses in bluez
  57. busctl tree org.bluez
  58.  
  59.  
  60. Checked /etc/dbus-1/system.d/bluetooth.conf, which says users must be in the bluetooth group.
  61. sudo adduser pi bluetooth
  62. newgrp bluetooth
  63.  
  64.  
  65.  
  66. Hello Douglas, thanks for your support and sorry for my late answer. After apt-get update & upgrade I found that I have to
  67. sudo apt-get install bluealsa
  68. to get rid of the
  69. Failed to connect: org.bluez.Error.Failed
  70.  
  71.  
  72. Newer versions of BlueZ tools no longer seem to document the /etc/bluetooth/rfcomm.conf file. It might be that you'll have to always use the full form of the rfcomm bind command to set up your bindings. You might want to add these commands to /etc/rc.local or some custom start-up script, to make them execute automatically at boot time, as the associations won't persist through a reboot.
  73.  
  74. It seems that the last major rebuild of BlueZ internals cost us some of the RFCOMM-related features, like the /etc/bluetooth/rfcomm.conf file. But at least the rfcomm command is still available and can do the job.
  75.  
  76. sudo echo "This is a test" > /dev/rfcomm0
  77.  
  78. sudo nano /etc/bluetooth/rfcomm.conf
  79.  
  80. rfcomm0 {
  81. bind yes;
  82. device CC:5A:BC:A3:05:6F;
  83. channel 0;
  84. comment "Serial Port";
  85. }
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92. I also had the "Failed to obtain handles for "Service Changed" characteristic" messages, and no sound playback over bluetooth (raspberry as playback device).
  93.  
  94. Audio playback now works using /usr/bin/bluealsa-aplay (procedure similar to https://volumio.org/forum/volumio-bluez ... t6130.html).
  95. ("Failed to obtain..." messages are still logged.)
  96.  
  97.  
  98. https://scribles.net/running-ble-advertising-example-code-on-raspbian-stretch/
  99.  
  100. https://scribles.net/tag/bluez/
  101.  
  102.  
  103.  
  104. hciconfig hci0 up
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement