Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] python / dbus issue
@ 2007-11-23  2:22 thHog
  2007-11-23 12:12 ` Manuel Naranjo
  0 siblings, 1 reply; 3+ messages in thread
From: thHog @ 2007-11-23  2:22 UTC (permalink / raw)
  To: bluez-devel

Hi,

I tried my first python script for accessing bluez through dbus. The bluez
setup is complete and I can scan and connect bluetooth devices using hcitool
and rfcomm tools. The dbus setup is working as well, the "dbus-monitor
--system" shows bluez messages when starting bluez.

But, I tried to run the following python script (and several other examples
from the internet):


import dbus
bus = dbus.SystemBus();
obj = bus.get_object('org.bluez', '/org/bluez')
manager = dbus.Interface(obj, 'org.bluez.Manager')
print manager.ListAdapters()


The output from this script is:

Traceback (most recent call last):
  File "./mydbus.py", line 27, in ?
    print manager.ListAdapters()
  File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 85, in
__call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.4/site-packages/dbus/proxies.py", line 169, in
__call__
    reply_message =
self._connection.send_message_with_reply_and_block(message, timeout)
dbus.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method
"ListAdapters" with signature "" on interface "org.bluez.Manager" doesn't
exist

On starting /etc/init.d/bluetooth, dbus-monitor --system shows:

$ dbus-monitor --system
signal sender=org.freedesktop.DBus -> dest=:1.5 path=/org/freedesktop/DBus;
interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.5"
signal sender=org.freedesktop.DBus -> dest=(null destination)
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
member=NameOwnerChanged
   string ":1.6"
   string ""
   string ":1.6"
signal sender=org.freedesktop.DBus -> dest=(null destination)
path=/org/freedesktop/DBus; interface=org.freedesktop.DBus;
member=NameOwnerChanged
   string "org.bluez"
   string ""
   string ":1.6"
signal sender=:1.6 -> dest=(null destination) path=/org/bluez/Manager;
interface=org.bluez.Manager; member=DeviceAdded
   string "/org/bluez/Device/hci0"
signal sender=:1.6 -> dest=(null destination) path=/org/bluez/Device/hci0;
interface=org.bluez.Device; member=Up
signal sender=:1.6 -> dest=(null destination) path=/org/bluez/Device/hci0;
interface=org.bluez.Device; member=PropertyChanged
   string "name"
   string ""

What is wrong here?

Thanks,
--theHog



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bluez-devel] python / dbus issue
  2007-11-23  2:22 [Bluez-devel] python / dbus issue thHog
@ 2007-11-23 12:12 ` Manuel Naranjo
  0 siblings, 0 replies; 3+ messages in thread
From: Manuel Naranjo @ 2007-11-23 12:12 UTC (permalink / raw)
  To: BlueZ development

Hi,
> I tried my first python script for accessing bluez through dbus. The bluez
> setup is complete and I can scan and connect bluetooth devices using hcitool
> and rfcomm tools. The dbus setup is working as well, the "dbus-monitor
> --system" shows bluez messages when starting bluez.
>   
I think it wasn't well installed.
> But, I tried to run the following python script (and several other examples
> from the internet):
> .....
>   
I checked your script and it works for me. Make sure you have the latest
version, and that's installed as it's supposed to be.

If you don't want to mess up with scripts you can check with: dbus-send
--system --type=method_call --print-reply --dest=org.bluez /org/bluez
org.bluez.Manager.ListAdapters

> self._connection.send_message_with_reply_and_block(message, timeout)
> dbus.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method
> "ListAdapters" with signature "" on interface "org.bluez.Manager" doesn't
> exist
>   
How strange you are missing the method ListAdapters which actually exists.

> On starting /etc/init.d/bluetooth, dbus-monitor --system shows:
>
> $ dbus-monitor --system
> signal sender=org.freedesktop.DBus -> dest=:1.5 path=/org/freedesktop/DBus;
> ......
>   
What does it show when running the script?

> What is wrong here?
>   
Maybe you missed something when passing the arguments to configure and
built.

Cheers,
Manuel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bluez-devel] python / dbus issue
@ 2007-11-23 20:17 thHog
  0 siblings, 0 replies; 3+ messages in thread
From: thHog @ 2007-11-23 20:17 UTC (permalink / raw)
  To: BlueZ development

----- Oorspronkelijk bericht -----
From: Manuel Naranjo <manuel@aircable.net>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Date: 23-Nov-2007 13:12
Subject: Re: [Bluez-devel] python / dbus issue

> Hi,
> > I tried my first python script for accessing bluez through dbus. The
bluez
> > setup is complete and I can scan and connect bluetooth devices using
hcitool
> > and rfcomm tools. The dbus setup is working as well, the "dbus-monitor
> > --system" shows bluez messages when starting bluez.
> >   
> I think it wasn't well installed.
> > But, I tried to run the following python script (and several other
examples
> > from the internet):
> > .....
> >   
> I checked your script and it works for me. Make sure you have the latest
> version, and that's installed as it's supposed to be.
> 
> If you don't want to mess up with scripts you can check with: dbus-send
> --system --type=method_call --print-reply --dest=org.bluez /org/bluez
> org.bluez.Manager.ListAdapters
> 
> > self._connection.send_message_with_reply_and_block(message, timeout)
> > dbus.DBusException: org.freedesktop.DBus.Error.UnknownMethod: Method
> > "ListAdapters" with signature "" on interface "org.bluez.Manager" doesn't
> > exist
> >   
> How strange you are missing the method ListAdapters which actually exists.
> 
> > On starting /etc/init.d/bluetooth, dbus-monitor --system shows:
> >
> > $ dbus-monitor --system
> > signal sender=org.freedesktop.DBus -> dest=:1.5
path=/org/freedesktop/DBus;
> > ......
> >   
> What does it show when running the script?
> 
> > What is wrong here?
> >   
> Maybe you missed something when passing the arguments to configure and
> built.

Upgrading to v3.20 fixed it. Thanks :-)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-23 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-23  2:22 [Bluez-devel] python / dbus issue thHog
2007-11-23 12:12 ` Manuel Naranjo
  -- strict thread matches above, loose matches on Subject: below --
2007-11-23 20:17 thHog

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox