| View previous topic :: View next topic |
| Author |
Message |
the_enigma Apprentice

Joined: 23 Aug 2004 Posts: 210 Location: Brisbane, Aus
|
Posted: Sat Mar 14, 2009 7:07 am Post subject: Bluez - services vs old-daemons |
|
|
Didn't know exactly where this should go, figured bluetooth is wireless at least.
Anyway, Bluez is moving over to "Services" for something something. I didn't quite get all of it, but the gist seems to be that they are moving away from the old daemons, and onto a services model where specific services are run.
See http://wiki.bluez.org/wiki/Services for more detail
The ebuild for bluez-utils-3.36 won't build the old hidd daemon, amongst others, without the "old-daemons" USE flag set. I looked into this "Services" function in Bluez, but I can't seem to understand how to use it. I can read the wiki, and it gives great information if I want to write a program it seems, but I just want to connect my bluetooth mouse.
For now, I've gone back to old-daemons since I know how to run it, but how do I connect to a bluetooth mouse with the new model? |
|
| Back to top |
|
 |
the_enigma Apprentice

Joined: 23 Aug 2004 Posts: 210 Location: Brisbane, Aus
|
Posted: Sat Mar 14, 2009 11:29 pm Post subject: |
|
|
Well, after playing with dbus some more, I think I worked it out.
| Code: | enigma@epsilon ~ $ dbus-send --system --type=method_call --print-reply --dest=org.bluez \
> /org/bluez org.bluez.Manager.ActivateService string:input
method return sender=:1.134 -> dest=:1.137 reply_serial=2
string "org.bluez" |
The above command shows that "sender=:1.134". This will, I'm pretty sure, differ between systems, so check what your output is. We need to use this "sender" values as the destination for all the following commands.
Then I ran | Code: | | # dbus-send --system --type=method_call --print-reply --dest=":1.134" /org/bluez/input org.bluez.input.Manager.ListDevices | Which gives | Code: |
method return sender=:1.134 -> dest=:1.140 reply_serial=2
array [
string "/org/bluez/input/pointing0"
]
|
So I have a "pointing" device set up apparently. To actually connect, I have to run | Code: | | # dbus-send --system --type=method_call --print-reply --dest=":1.134" /org/bluez/input/pointing0 org.bluez.input.Device.Connect | Which gives | Code: |
method return sender=:1.134 -> dest=:1.143 reply_serial=2 |
And then my mouse started working.
I _think_ to connect a new device, you have to first create it with | Code: | | #dbus-send --system --type=method_call --print-reply --dest=":1.134" /org/bluez/input org.bluez.input.Manager.CreateDevice string:00:07:61:D0:21:4D | but my mouse was already listed, so I'm not sure on this.
Hope that helps someone else. I'm still not sure where to put these commands now though.
Last edited by the_enigma on Sun Apr 12, 2009 8:27 am; edited 1 time in total |
|
| Back to top |
|
 |
chris... Apprentice

Joined: 26 Sep 2006 Posts: 174 Location: Melbourne, AU
|
Posted: Sun Apr 12, 2009 7:07 am Post subject: |
|
|
| Code: | | Error org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s"on interface "org.bluez.Manager" doesn't exist |
I get this error? |
|
| Back to top |
|
 |
the_enigma Apprentice

Joined: 23 Aug 2004 Posts: 210 Location: Brisbane, Aus
|
Posted: Sun Apr 12, 2009 8:28 am Post subject: |
|
|
| I just edited my post to make it clearer what commands I was typing, so that might help you. If not, post the full command from your terminal, including what you typed and what it returned exactly. |
|
| Back to top |
|
 |
chris... Apprentice

Joined: 26 Sep 2006 Posts: 174 Location: Melbourne, AU
|
Posted: Sun Apr 12, 2009 12:51 pm Post subject: |
|
|
The first command doesnt work, I entered: | Code: | | dbus-send --system --type=method_call --print-reply --dest=org.bluez /org/bluez org.bluez.Manager.ActivateService string:input |
result: | Code: | | Error org.freedesktop.DBus.Error.UnknownMethod: Method "ActivateService" with signature "s"on interface "org.bluez.Manager" doesn't exist |
I cant continue because I dont get a result from the first command |
|
| Back to top |
|
 |
chris... Apprentice

Joined: 26 Sep 2006 Posts: 174 Location: Melbourne, AU
|
Posted: Sun Apr 12, 2009 9:41 pm Post subject: |
|
|
Deleting the files in /var/lib/bluetooth causes the application to work
This command line still doesn't work |
|
| Back to top |
|
 |
the_enigma Apprentice

Joined: 23 Aug 2004 Posts: 210 Location: Brisbane, Aus
|
Posted: Mon Apr 13, 2009 12:24 am Post subject: |
|
|
| What versions of bluez-libs and bluez-utils are you running? I'm on 3.36 for both, and that method exists for me |
|
| Back to top |
|
 |
chris... Apprentice

Joined: 26 Sep 2006 Posts: 174 Location: Melbourne, AU
|
Posted: Mon Apr 13, 2009 12:55 am Post subject: |
|
|
| i uninstalled bluez-libs and utils and use bluez4 |
|
| Back to top |
|
 |
the_enigma Apprentice

Joined: 23 Aug 2004 Posts: 210 Location: Brisbane, Aus
|
Posted: Mon Apr 13, 2009 1:04 am Post subject: |
|
|
| Well, I have no idea how things work in bluez4, sorry. |
|
| Back to top |
|
 |
jiri.tyr n00b

Joined: 08 Feb 2005 Posts: 26 Location: Czech Republic
|
Posted: Wed Jun 10, 2009 1:49 pm Post subject: |
|
|
If you have difficulties to get your mouse working with the net-wireless/bluez, have a look at this howto:
http://sidux.com/index.php?module=pnWikka&tag=hwBluetooth
You can find the script simple-agent and test-device in the package in distfiles (/usr/portage/distfiles/bluez-4.xx.tar.gz).
Once your mouse is working, it works even after the restart (it needs probably just the bluetooth init script started).
If you wanna use the latest version of bluez (4.41), you can download a patch for the ebuild here:
http://bugs.gentoo.org/attachment.cgi?id=192141 |
|
| Back to top |
|
 |
|