Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bluez - services vs old-daemons
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
the_enigma
Apprentice
Apprentice


Joined: 23 Aug 2004
Posts: 210
Location: Brisbane, Aus

PostPosted: Sat Mar 14, 2009 7:07 am    Post subject: Bluez - services vs old-daemons Reply with quote

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
View user's profile Send private message
the_enigma
Apprentice
Apprentice


Joined: 23 Aug 2004
Posts: 210
Location: Brisbane, Aus

PostPosted: Sat Mar 14, 2009 11:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 174
Location: Melbourne, AU

PostPosted: Sun Apr 12, 2009 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message
the_enigma
Apprentice
Apprentice


Joined: 23 Aug 2004
Posts: 210
Location: Brisbane, Aus

PostPosted: Sun Apr 12, 2009 8:28 am    Post subject: Reply with quote

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
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 174
Location: Melbourne, AU

PostPosted: Sun Apr 12, 2009 12:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 174
Location: Melbourne, AU

PostPosted: Sun Apr 12, 2009 9:41 pm    Post subject: Reply with quote

Deleting the files in /var/lib/bluetooth causes the application to work
This command line still doesn't work
Back to top
View user's profile Send private message
the_enigma
Apprentice
Apprentice


Joined: 23 Aug 2004
Posts: 210
Location: Brisbane, Aus

PostPosted: Mon Apr 13, 2009 12:24 am    Post subject: Reply with quote

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
View user's profile Send private message
chris...
Apprentice
Apprentice


Joined: 26 Sep 2006
Posts: 174
Location: Melbourne, AU

PostPosted: Mon Apr 13, 2009 12:55 am    Post subject: Reply with quote

i uninstalled bluez-libs and utils and use bluez4
Back to top
View user's profile Send private message
the_enigma
Apprentice
Apprentice


Joined: 23 Aug 2004
Posts: 210
Location: Brisbane, Aus

PostPosted: Mon Apr 13, 2009 1:04 am    Post subject: Reply with quote

Well, I have no idea how things work in bluez4, sorry.
Back to top
View user's profile Send private message
jiri.tyr
n00b
n00b


Joined: 08 Feb 2005
Posts: 26
Location: Czech Republic

PostPosted: Wed Jun 10, 2009 1:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum