Hi all!<br><br>I'm trying to subscribe to a NetworkManager signal in order to detect when a new Internet connection is made and detect if its of a certain type.<br>Basically we've got public Wifi at school but you have to enter your login information in a web form after connecting.<br>
What I'm trying to do is detect when i connect to that specific Wifi and auto connect all that with python using httplib and dbus.<br><br>This is what i've come up with so far:<br><br><br>import dbus<br>from dbus.mainloop.glib import DBusGMainLoop<br>
<br>NM_DBUS_SERVICE = "org.freedesktop.NetworkManager"<br>NM_DBUS_OBJECT_PATH = "/org/freedesktop/NetworkManager"<br>NM_DBUS_INTERFACE = NM_DBUS_SERVICE<br><br>DBusGMainLoop(set_as_default=True)<br><br>
bus = dbus.SystemBus()<br><br>def new_connection_handler(device):<br> print device<br><br>bus.add_signal_receiver(new_connection_handler, 'DeviceNowActive', NM_DBUS_INTERFACE)<br><br><br>But i dont get any feedback even when unplugging a device, or a turning my wifi off and back on.<br>
<br>I wasn't sure where to post that, feel free to redirect me somewhere else. All i found about NetworkManager dbus api is <a href="http://people.redhat.com/dcbw/NetworkManager/NetworkManager%20DBUS%20API.txt">that</a><br>
<br>Simon<br>