Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bluez: bluez 5 bluetoothctl does not work with dbus policy packaged #1497

Closed
PolarSolvent opened this issue Jun 28, 2015 · 4 comments
Closed

Comments

@PolarSolvent
Copy link

<policy at_console="true"> I don't know if at_console is supported in openwrt, but it's impractical for devices where there usually is no console.
bluez5 also changed a lot of interface names.

The policy as shipped produces errors like:
Sun Jun 28 01:08:28 2015 auth.notice dbus[628]: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.1" (uid=0 pid=871 comm="bluetoothctl ") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination="org.bluez" (uid=0 pid=638 comm="/usr/bin/bluetoothd -n ")

The policy delivered with bluez sources in bluez-5.30/src/bluetooth.conf is probably a better fit since it has correct interfacenames and does not use the at_console policy. Putting it in /etc/dbus-1/system.d/bluetooth.conf lets you pair devices with bluetoothctl

[bluetooth]# scan on
[bluetooth]# agent on
[bluetooth]# default-agent
[bluetooth]# pair 00:1F:81:00:02:00
Attempting to pair with 00:1F:81:00:02:00
[CHG] Device 00:1F:81:00:02:00 Connected: yes
Request PIN code
[agent] Enter PIN code: 0000
[CHG] Device 00:1F:81:00:02:00 Paired: yes
Pairing successful
@PolarSolvent
Copy link
Author

Something like this might be a solution

diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile
index ebc1646..363bf2c 100644
--- a/utils/bluez/Makefile
+++ b/utils/bluez/Makefile
@@ -142,7 +142,7 @@ define Package/bluez-daemon/install
        $(INSTALL_DIR) $(1)/etc/config
        $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth
        $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/
-       $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bluetooth.conf $(1)/etc/dbus-1/system.d/bluetooth.conf
        $(INSTALL_DIR) $(1)/etc/bluetooth
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf

@RogerLaw
Copy link

RogerLaw commented Feb 5, 2017

this solved my problem

@ecammit
Copy link
Contributor

ecammit commented Mar 13, 2018

This also fixed my issue.

diizzyy added a commit to diizzyy/packages that referenced this issue Apr 30, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte

Based on patch provided by Jack Vogel
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
diizzyy added a commit to diizzyy/packages that referenced this issue Apr 30, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte

Based on patch provided by Jack Vogel
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
diizzyy added a commit to diizzyy/packages that referenced this issue Apr 30, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte

Based on patch provided by Johnny Vogels
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
diizzyy added a commit to diizzyy/packages that referenced this issue May 5, 2018
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte
Drop audio.conf (not needed and deprecated)
Remove bluetooth.dbus as upstream supplies a working copy

Based on patch provided by Johnny Vogels
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
@diizzyy
Copy link
Contributor

diizzyy commented Jun 9, 2018

@hnyman @champtar @thess
Close this

@hnyman hnyman closed this as completed Jun 10, 2018
lynxis pushed a commit to lynxis/packages that referenced this issue Jan 3, 2019
Update bluez to 5.49
Fix issue openwrt#1497
Fix issue openwrt#1503
Cherry pick patches from Alpine Linux repo
Apply --gc-sections, saves about 500kbyte
Drop audio.conf (not needed and deprecated)
Remove bluetooth.dbus as upstream supplies a working copy

Based on patch provided by Johnny Vogels
openwrt#5937

Source:
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/fix-endianness.patch?id=1c6991b32a22be2c905cc1709be1376c4e79e451
https://git.alpinelinux.org/cgit/aports/commit/main/bluez/bluez-5.40-obexd_without_systemd-1.patch?id=980b2d04ae4339594701b33cf9460757c989c94c

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants