View Full Version : Connecting to dbus over tcp

April 15th, 2012, 02:06 AM
I wrote a simple python program to play and pause banshee music player.
While its working on my own machine, I have trouble doing it to a remote computer, connected to the same router (LAN).
I edited the session.conf of the remote machine, to add this line:


and here is my program:

import dbus


proxy_object=bus_obj.get_object('org.bansheeprojec t.Banshee',

dbus_interface='org.bansheeproject.Banshee.PlayerE ngine')

var=raw_input("\nPress\n1 to play\n2 to pause\n3 to exit\n")

while (var!="3"):
var=raw_input("\nPress\n1 to play\n2 to pause\n3 to exit\n")

if var=="1":
print "playing..."

elif var=="2":
print "pausing"

This is what i get when i try to execute it
Traceback (most recent call last):
File "dbus3.py", line 4, in <module>
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 125, in __new__
bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket "localhost:12434" Connection refused

What am I doing wrong here?
should i edit /usr/lib/python2.7/dist-packages/dbus/bus.py

April 15th, 2012, 10:48 AM
ok, here is the deal
when i add
to to /etc/dbus-1/session.conf, then reboot, hoping it would start listening on reboot,
It never boots. It gets stuck on loading screen and occasionally, a black screen with the following text flashes:

Pulseaudio Configured For Per-user Sessions Saned Disabled;edit/etc/default/saned
so, when i go ctrl+alt+f1 , change session.conf to original state and reboot, it boots properly.

Whats all that about?
How can I make dbus daemon listen for tcp connections, without encountering problems?