On Tue, 2018-12-11 at 10:15 -0500, Jane Wyngaard via networkmanager-
list wrote:
> Hi,
> 
> I just started using the python dbus API, but am having some
> difficulties, hoping someone here might be able to help me?   (I did
> find the old thread in this list with an example script but API has
> changed so much that no longer works even with significant changes).
> 
> In brief:
> - I can successfully configure and use an ADHOC network using (1)
> manual edits of host file (after disabling NetworkManager), and (2)
> using iwconfig.  
> - I can create an ADHOC with nm-applette gui but cannot connect to
> it.  
> - What I need to do is create an adhoc with dbus but the attached
> script which works perfectly to create a hotspot (with mode 'ap')
> fails with bellow syslog messages when mode is 'adhoc'
> 
> It looks like it creates the connection fine and even attempts to
> activate but then hits some weird authentication issue I can't debug?

Hi,


while the script is not particularly elegant (e.g. it keeps polling
whether the profile is fully activate), it should work fine in
principle. It also succeeds to create a profile, but activation fails
later on.

This has nothing to do with D-Bus API. You can create the exact same
profile with nmcli and encounter the same problem.

What I mean, is that when I try `nmcli connection up MyAdhoc`, the
activation also fails (just like with the python script).
The question is, why it fails. But I don't know...


General tip: enabling level=TRACE logging is helpful (see [1]).
Also, check what is happening with `nmcli connection` and `nmcli
device`.

[1] 
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/contrib/fedora/rpm/NetworkManager.conf#n28


best,
Thomas

> 
> Any chance someone has a working dbus API Adhoc network setup script
> they could share with me?
> --------------------
> */var/log/syslog*
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4386] keyfile: add connection /etc/NetworkManager/system-
> connections/MyAdhoc-bac3019c-6be0-4d07-9617-c91a5438f422 (bac3019c-
> 6be0-4d07-9617-c91a5438f422,"MyAdhoc")
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4397] audit: op="connection-add" uuid="bac3019c-6be0-
> 4d07-9617-c91a5438f422" name="MyAdhoc" pid=18019 uid=1000
> result="success"
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4479] device (wlp4s0): disconnecting for new activation
> request.
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4479] device (wlp4s0): state change: activated ->
> deactivating (reason 'new-activation', sys-iface-state: 'managed')
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4480] manager: NetworkManager state is now
> CONNECTED_LOCAL
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4594] audit: op="connection-activate" uuid="bac3019c-
> 6be0-4d07-9617-c91a5438f422" name="MyAdhoc" pid=18019 uid=1000
> result="success"
> Dec 11 10:12:01 Squid dbus-daemon[878]: [system] Activating via
> systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-
> org.freedesktop.nm-dispatcher.service' requested by ':1.5229' (uid=0
> pid=17463 comm="/usr/sbin/NetworkManager --no-daemon "
> label="unconfined")
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4600] device (wlp4s0): state change: deactivating ->
> disconnected (reason 'new-activation', sys-iface-state: 'managed')
> Dec 11 10:12:01 Squid avahi-daemon[961]: Withdrawing address record
> for fe80::d80d:7c02:f195:d84f on wlp4s0.
> Dec 11 10:12:01 Squid avahi-daemon[961]: Leaving mDNS multicast group
> on interface wlp4s0.IPv6 with address fe80::d80d:7c02:f195:d84f.
> Dec 11 10:12:01 Squid avahi-daemon[961]: Interface wlp4s0.IPv6 no
> longer relevant for mDNS.
> Dec 11 10:12:01 Squid systemd[1]: Starting Network Manager Script
> Dispatcher Service...
> Dec 11 10:12:01 Squid dbus-daemon[878]: [system] Successfully
> activated service 'org.freedesktop.nm_dispatcher'
> Dec 11 10:12:01 Squid systemd[1]: Started Network Manager Script
> Dispatcher Service.
> Dec 11 10:12:01 Squid nm-dispatcher: req:1 'connectivity-change': new
> request (1 scripts)
> Dec 11 10:12:01 Squid nm-dispatcher: req:1 'connectivity-change':
> start running ordered scripts...
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4951] dhcp4 (wlp4s0): canceled DHCP transaction, DHCP
> client pid 17430
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.4951] dhcp4 (wlp4s0): state changed bound -> done
> Dec 11 10:12:01 Squid avahi-daemon[961]: Withdrawing address record
> for 10.38.83.150 on wlp4s0.
> Dec 11 10:12:01 Squid avahi-daemon[961]: Leaving mDNS multicast group
> on interface wlp4s0.IPv4 with address 10.38.83.150.
> Dec 11 10:12:01 Squid kernel: [510680.306141] wlp4s0:
> deauthenticating from 88:1d:fc:e2:f0:1d by local choice (Reason:
> 3=DEAUTH_LEAVING)
> Dec 11 10:12:01 Squid wpa_supplicant[963]: wlp4s0: CTRL-EVENT-
> DISCONNECTED bssid=88:1d:fc:e2:f0:1d reason=3 locally_generated=1
> Dec 11 10:12:01 Squid avahi-daemon[961]: Interface wlp4s0.IPv4 no
> longer relevant for mDNS.
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5097] device (wlp4s0): Activation: starting connection
> 'MyAdhoc' (bac3019c-6be0-4d07-9617-c91a5438f422)
> Dec 11 10:12:01 Squid NetworkManager[17463]: <warn> 
> [1544541121.5105] sup-iface[0x562fafaded90,wlp4s0]: connection
> disconnected (reason -3)
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5106] device (wlp4s0): supplicant interface state:
> completed -> disconnected
> Dec 11 10:12:01 Squid nm-dispatcher: req:2 'down' [wlp4s0]: new
> request (1 scripts)
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5171] device (wlp4s0): state change: disconnected ->
> prepare (reason 'none', sys-iface-state: 'managed')
> Dec 11 10:12:01 Squid nm-dispatcher: req:2 'down' [wlp4s0]: start
> running ordered scripts...
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5173] manager: NetworkManager state is now CONNECTING
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5201] device (wlp4s0): state change: prepare -> config
> (reason 'none', sys-iface-state: 'managed')
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5206] device (wlp4s0): Activation: (wifi) access point
> 'MyAdhoc' has security, but secrets are required.
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5206] device (wlp4s0): state change: config -> need-auth
> (reason 'none', sys-iface-state: 'managed')
> Dec 11 10:12:01 Squid gsd-sharing[2928]: Failed to StopUnit service:
> GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit gnome-user-
> share-webdav.service not loaded.
> Dec 11 10:12:01 Squid gsd-sharing[2928]: Failed to StopUnit service:
> GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit rygel.service
> not loaded.
> Dec 11 10:12:01 Squid gsd-sharing[2928]: Failed to StopUnit service:
> GDBus.Error:org.freedesktop.systemd1.NoSuchUnit: Unit gnome-remote-
> desktop.service not loaded.
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5244] device (wlp4s0): state change: need-auth -> prepare
> (reason 'none', sys-iface-state: 'managed')
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5249] device (wlp4s0): state change: prepare -> config
> (reason 'none', sys-iface-state: 'managed')
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5263] device (wlp4s0): Activation: (wifi) connection
> 'MyAdhoc' has security, and secrets exist.  No new secrets needed.
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5264] Config: added 'ssid' value 'Adhoc'
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5264] Config: added 'mode' value '1'
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5264] Config: added 'frequency' value '2412'
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5264] Config: added 'freq_list' value '2412'
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5264] Config: added 'key_mgmt' value 'NONE'
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5264] Config: added 'wep_key0' value '<hidden>'
> Dec 11 10:12:01 Squid NetworkManager[17463]: <info> 
> [1544541121.5264] Config: added 'wep_tx_keyidx' value '0'
> Dec 11 10:12:01 Squid wpa_supplicant[963]: Note: nl80211 driver
> interface is not designed to be used with ap_scan=2; this can result
> in connection failures
> Dec 11 10:12:03 Squid org.gnome.Shell.desktop[2783]:
> [6088:6116:1211/101203.508607:ERROR:connection_factory_impl.cc(400)]
> Failed to connect to MCS endpoint with error -105
> Dec 11 10:12:03 Squid wpa_supplicant[963]: wlp4s0: Trying to
> associate with SSID 'Adhoc'
> Dec 11 10:12:03 Squid wpa_supplicant[963]: Could not set interface
> wlp4s0 flags (UP): Device or resource busy
> Dec 11 10:12:03 Squid wpa_supplicant[963]: nl80211: Failed to set
> interface into IBSS mode
> Dec 11 10:12:03 Squid wpa_supplicant[963]: wlp4s0: Association
> request to the driver failed
> Dec 11 10:12:03 Squid wpa_supplicant[963]: wlp4s0: Trying to
> associate with SSID 'Adhoc'
> Dec 11 10:12:03 Squid wpa_supplicant[963]: wlp4s0: Association
> request to the driver failed
> Dec 11 10:12:04 Squid wpa_supplicant[963]: wlp4s0: Trying to
> associate with SSID 'Adhoc'
> Dec 11 10:12:04 Squid wpa_supplicant[963]: wlp4s0: Association
> request to the driver failed
> Dec 11 10:12:05 Squid wpa_supplicant[963]: wlp4s0: Trying to
> associate with SSID 'Adhoc'
> Dec 11 10:12:05 Squid wpa_supplicant[963]: wlp4s0: Association
> request to the driver failed
> Dec 11 10:12:05 Squid wpa_supplicant[963]: wlp4s0: CTRL-EVENT-SSID-
> TEMP-DISABLED id=0 ssid="Adhoc" auth_failures=1 duration=10
> reason=CONN_FAILED
> 
> 
> ++++++++++++++++
> Jane Wyngaard, PhD
> 
> Data Science Technologist
> Centre for Research Computing
> University of Notre Dame
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/networkmanager-list

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list
  • Adhoc via dbus API? Jane Wyngaard via networkmanager-list
    • Re: Adhoc via dbus API? Thomas Haller via networkmanager-list

Reply via email to