Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given

7,495

Probably the issue is with your hostname. Give some name with a period in it. eg: "localhost.mine" or simply "localhost"

You can set hostname via GNOME Control Center -> Details -> Overview -> Set Device name.

After setting a good hostname, create the hotspot again.

Share:
7,495

Related videos on Youtube

GabLeRoux
Author by

GabLeRoux

I'm a programmer, I speak french, english and python. Read my stuff on gableroux.com Want a cool .pythonrc file? Click me!

Updated on September 18, 2022

Comments

  • GabLeRoux
    GabLeRoux almost 2 years

    I'm currently trying to share a wireless network from arch-linux. There is a button in the network settings that should allow me to do it:

    Network settings "Use as Hotspot..."

    I hit the "Turn On" button as that's exactly what I'm looking for!

    Wi-Fi Hotspot popup Turn On

    But in the terminal with the following command:

    $ sudo journalctl -xef
    
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.8790] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.8928] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.8967] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9001] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9011] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9019] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9029] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9037] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9046] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9055] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch NetworkManager[477]: <info>  [1478176793.9064] audit: op="connection-add-activate" pid=12673 uid=1000 result="fail" reason="A 'wireless' setting with a valid SSID is required if no AP path was given."
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    Nov 03 08:39:53 zbookarch gnome-control-c[12673]: Failed to add new connection: (2) A 'wireless' setting with a valid SSID is required if no AP path was given.
    

    There's some doc here and there I'm still reading, but I haven't found anything concerning this error yet other than the exact error message in some source code here:

    https://github.com/lcp/NetworkManager/blob/master/src/nm-device-wifi.c#L1211

    A friend tested on Fedora and it worked out of the box, he found an ESSID setting that matches his created wifi here:

    /etc/sysconfig/network-scripts/ifcfg-Hotspot
    

    But I don't have this path on Arch Linux.

    there is this Software_access_point wiki page on arch that may contain some information on how to create a hotspot. I'll follow that later, but if someone has some information on the error, that'd be great :)

    My network card should be compatible:

    $ iw list
    
    Wiphy phy0
    ...
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * P2P-client
                 * P2P-GO
                 * P2P-device
    

    (Requires AP)

    $ lspci -k | grep -A 3 -i network
    
    3d:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)
            Subsystem: Intel Corporation Dual Band Wireless-AC 7260
            Kernel driver in use: iwlwifi
            Kernel modules: iwlwifi
    

    iwlwifi can be found in the following list:

    | Driver                                             | Manufacturer        | cfg80211 | AP      | IBSS | mesh | monitor | PHY modes  | Buses                    |
    |----------------------------------------------------|---------------------|----------|---------|------|------|---------|------------|--------------------------|
    | iwlwifi                                            | Intel               | yes      | yes (6) | yes  | no   | yes     | A/B/G/N/AC | PCI-E                    |
    

    It really looks like it supports AP.

    first attempt

    I tried using hotspotd

    I created a python2.7 virtualenv and installed hotspotd==0.1.4, then I installed hostapd and dnsmasq.

    $ sudo pacman -S hostapd
    $ mkvirtualenv -p $(which python27) hotspot
    $ workon hotspot
    $ pip install hotspotd==0.1.4
    $ sudo hotspotd -h
    
    usage: hotspotd [-h] [-v] {start,stop,configure}
    
    A small daemon to create a wifi hotspot on linux
    
    positional arguments:
      {start,stop,configure}
    
    optional arguments:
      -h, --help            show this help message and exit
      -v, --verbose
    
    
    $ sudo hotspotd configure
    
    Verifying connections
    Wifi interface found: wlp61s0
    Network interface found: enp0s25:
    Enter an IP address for your ap [192.168.45.1] :
    Enter SSID [joe_ssid] :
    Enter 10 digit password [1234567890] :
    created hostapd configuration: run.conf
    {'wlan': 'wlp61s0', 'SSID': 'joe_ssid', 'ip': '192.168.45.1', 'netmask': '255.255.255.0', 'password': '1234567890', 'inet': 'enp0s25:'}
    Configuration saved
    
    
    $ sudo hotspotd start -v 
    
    command: ps aux |grep hostapd |grep -v grep
    Verifying interfaces
    command: ifconfig
    done.
    created interface: mon.wlp61s0 on IP: 192.168.45.1
    command: ifconfig wlp61s0 up 192.168.45.1 netmask 255.255.255.0
    
    wait..
    command: sleep 2
    command: ps aux |grep dnsmasq |grep -v grep
    command: ps aux |grep hostapd |grep -v grep
    enabling forward in sysctl.
    command: sysctl -w net.ipv4.ip_forward=1
    net.ipv4.ip_forward = 1
    creating NAT using iptables: wlp61s0<->enp0s25:
    command: iptables -P FORWARD ACCEPT
    command: iptables --table nat --delete-chain
    command: iptables --table nat -F
    command: iptables --table nat -X
    command: iptables -t nat -A POSTROUTING -o enp0s25: -j MASQUERADE
    command: iptables -A FORWARD -i enp0s25: -o wlp61s0 -j ACCEPT -m state --state RELATED,ESTABLISHED
    command: iptables -A FORWARD -i wlp61s0 -o enp0s25: -j ACCEPT
    command: iptables -A OUTPUT --out-interface wlp61s0 -j ACCEPT
    command: iptables -A INPUT --in-interface wlp61s0 -j ACCEPT
    running dnsmasq
    command: dnsmasq --dhcp-authoritative --interface=wlp61s0 --dhcp-range=192.168.45.20,192.168.45.100,255.255.255.0,4h
    
    running hostapd
    wait..
    command: sleep 2
    command: hostapd -B /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
    Configuration file: /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
    Could not read interface wlan0 flags: No such device
    nl80211: Driver does not support authentication/association or connect commands
    nl80211: deinit ifname=wlan0 disabled_11b_rates=0
    Could not read interface wlan0 flags: No such device
    nl80211 driver initialization failed.
    wlan0: interface state UNINITIALIZED->DISABLED
    wlan0: AP-DISABLED 
    hostapd_free_hapd_data: Interface wlan0 wasn't started
    
    hotspot is running.
    

    I don't know why that wlan0 is being used so I tried to edit /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf, replaced wlan0 with my deteceted wlp61s0:

    $ sudo hotspotd start -v
    
    command: ps aux |grep hostapd |grep -v grep
    Verifying interfaces
    command: ifconfig
    done.
    created interface: mon.wlp61s0 on IP: 192.168.45.1
    command: ifconfig wlp61s0 up 192.168.45.1 netmask 255.255.255.0
    
    wait..
    command: sleep 2
    command: ps aux |grep dnsmasq |grep -v grep
    command: ps aux |grep hostapd |grep -v grep
    enabling forward in sysctl.
    command: sysctl -w net.ipv4.ip_forward=1
    net.ipv4.ip_forward = 1
    creating NAT using iptables: wlp61s0<->enp0s25:
    command: iptables -P FORWARD ACCEPT
    command: iptables --table nat --delete-chain
    command: iptables --table nat -F
    command: iptables --table nat -X
    command: iptables -t nat -A POSTROUTING -o enp0s25: -j MASQUERADE
    command: iptables -A FORWARD -i enp0s25: -o wlp61s0 -j ACCEPT -m state --state RELATED,ESTABLISHED
    command: iptables -A FORWARD -i wlp61s0 -o enp0s25: -j ACCEPT
    command: iptables -A OUTPUT --out-interface wlp61s0 -j ACCEPT
    command: iptables -A INPUT --in-interface wlp61s0 -j ACCEPT
    running dnsmasq
    command: dnsmasq --dhcp-authoritative --interface=wlp61s0 --dhcp-range=192.168.45.20,192.168.45.100,255.255.255.0,4h
    
    running hostapd
    wait..
    command: sleep 2
    command: hostapd -B /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
    Configuration file: /home/gableroux/.virtualenvs/hotspot/lib/python2.7/site-packages/hotspotd/run.conf
    nl80211: Could not configure driver mode
    nl80211: deinit ifname=wlp61s0 disabled_11b_rates=0
    nl80211 driver initialization failed.
    wlp61s0: interface state UNINITIALIZED->DISABLED
    wlp61s0: AP-DISABLED 
    hostapd_free_hapd_data: Interface wlp61s0 wasn't started
    
    hotspot is running.
    

    Still no hotspot. I searched for that error

    nl80211: Could not configure driver mode

    I found this related question

    I tried the recommanded command:

    $ sudo iwconfig wlp61s0 mode master
    
    Error for wireless request "Set Mode" (8B06) :
        SET failed on device wlp61s0 ; Invalid argument.
    

    Well well, sounds like it could be my network card after all.

    That's definitely way easier on MacOS :/

    Edit: I can no longer reproduce this problem since I moved to Fedora and things are mostly working out of the box now. Thanks for your help :)

    • schrieveslaach
      schrieveslaach over 7 years
      Did you solve that problem? My laptop behaves the same way on arch.
    • GabLeRoux
      GabLeRoux over 7 years
      Nope, not yet. I tried with both my internal wifi adapter and a usb wifi adapter but no luck. Always that same error message.
  • GabLeRoux
    GabLeRoux over 7 years
    Thanks for the suggestion, I tried this but it's still lfailing. I used the following documentation to change my hostname, renamed it from zbookarch to zbookarch.local, tried again and I still get the same error (I rebooted just n case, but no success). The Details view does display my new hostname correctly.
  • Mohammed Sadiq
    Mohammed Sadiq over 7 years
    In that case, can you try setting hostname to simply "localhost". Try setting device name the way said above (as opposed to commands like hostname' or /etc/hostname`). when I set my device name to "my.localhost" my hostname is set to "my-localhost". GNOME is trying to be oversmart.
  • GabLeRoux
    GabLeRoux over 7 years
    I'm on arch linux, Gnome version 3.22.2 and Gnome Control Center doesn't let me change my Device name, see following screenshot, no such 'Set Device name'. Anyway, I tried again with hostname set to localhost but I still get the same error. This really sound like a missing default configuration with AP SSID name I don't know where.
  • GabLeRoux
    GabLeRoux over 7 years
    Thanks for your answer, but I moved to fedora 25 lately and the hotspot button in settings works out of the box now as shown here.