You are not logged in.

#1 2014-09-01 12:00:12

Sventimir
Member
Registered: 2014-09-01
Posts: 16

[SOLVED] Netctl failing where sole wpa_supplicant works

Hello,

after having some difficulties I managed to set matters stright and got my Broadcom BCM43142 wireless card working. I prepared the following config:

$ cat /etc/wpa_supplicant/home.conf
network={
	ssid="TP-LINK"
	#psk="my_secret_passwd"
	psk=.....
}

So I run the following and in spite of reporting some problems, it works:

$ wpa_supplicwpa_supplicant -i wlp8s0 -c /etc/wpa_supplicant/gda.conf -Dwext &
Successfully initialized wpa_supplicant
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
wlp8s0: Trying to associate with e8:de:27:3d:fc:ae (SSID='TP-LINK' freq=2412 MHz)
ioctl[SIOCSIWFREQ]: Operation not supported
wlp8s0: Association request to the driver failed
wlp8s0: Associated with e8:de:27:3d:fc:ae
wlp8s0: WPA: Key negotiation completed with e8:de:27:3d:fc:ae [PTK=CCMP GTK=TKIP]
wlp8s0: CTRL-EVENT-CONNECTED - Connection to e8:de:27:3d:fc:ae completed [id=0 id_str=]

Now, after running $ dhcpcd wlp8s0, network works fine. However It's annoying to have to type those commands every time I boot so I wanted to automate it using netctl just as I did with wired connection. So this is my netctl config:

$ cat /etc/netctl/home
Description='A wpa_supplicant configuration file based wireless connection'
Interface=wlp8s0
Connection=wireless
Security=wpa-config
WPAConfigFile='/etc/wpa_supplicant/home.conf'
WPADriver=wext
IP=dhcp

Now I kill wpa_supplicant and run:

$ netctl start home
Job for netctl@home.service failed. See 'systemctl status netctl@home.service' and 'journalctl -xn' for details.
$ netctl status home
● netctl@homr.service - Networking for netctl profile home
   Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static)
   Active: failed (Result: exit-code) since Mon 2014-09-01 15:25:59 CEST; 2min 0s ago
     Docs: man:netctl.profile(5)
  Process: 4789 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE)
 Main PID: 4789 (code=exited, status=1/FAILURE)

Sep 01 15:25:58 sventimir.net network[4789]: Failed to connect to non-global ctrl_ifname: wlp8s0  error: No such file or directory
Sep 01 15:25:58 sventimir.net network[4789]: Failed to connect to non-global ctrl_ifname: wlp8s0  error: No such file or directory
Sep 01 15:25:58 sventimir.net network[4789]: Failed to connect to non-global ctrl_ifname: wlp8s0  error: No such file or directory
Sep 01 15:25:58 sventimir.net network[4789]: WPA association/authentication failed for interface 'wlp8s0'
Sep 01 15:25:58 sventimir.net network[4789]: Failed to connect to non-global ctrl_ifname: wlp8s0  error: No such file or directory
Sep 01 15:25:58 sventimir.net network[4789]: Failed to connect to non-global ctrl_ifname: wlp8s0  error: No such file or directory
Sep 01 15:25:59 sventimir.net network[4789]: Failed to bring the network up for profile 'home'
Sep 01 15:25:59 sventimir.net systemd[1]: netctl@home.service: main process exited, code=exited, status=1/FAILURE
Sep 01 15:25:59 sventimir.net systemd[1]: Failed to start Networking for netctl profile home.
Sep 01 15:25:59 sventimir.net systemd[1]: Unit netctl@home.service entered failed state.

Has anyone encountered a similar problem?

Last edited by Sventimir (2014-09-01 17:52:04)

Offline

#2 2014-09-01 13:34:39

pezzonovante
Member
Registered: 2013-10-25
Posts: 40

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

Have you considered using Systemd-Networkd for this task? As you already know how to work with wpa_supplicant directly, setting up a wpa_supplicant@wlp8s0.service and systemd-networkd.service will save you the headache of having to debug netctl.

Offline

#3 2014-09-01 13:40:48

Sventimir
Member
Registered: 2014-09-01
Posts: 16

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

I'm new to Arch, so I don't yet know well wich tools can be used for what and how to configure system services. But I'll explore the subject then. Thanks for your tip.

Offline

#4 2014-09-01 13:50:57

pezzonovante
Member
Registered: 2013-10-25
Posts: 40

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

Yes go through the systemd-networkd Wiki page, and for wireless setup follow this thread:

https://bbs.archlinux.org/viewtopic.php?id=178625


This is what I do for wireless conneciton on my laptop:

First of all /etc/systemd/network/10-wireless.network (the name of the file doesn't matter, just make sure it has a .network extension):

[Match]
Name=wlp18s0

[Network]
DHCP=yes

The /etc/wpa_supplicant/wpa_supplicant-wlp18s0.conf file (replace wlp18s0 with your wireless interface name).

Now, enable wpa_supplicant and systemd-network services:

sudo systemctl enable wpa_supplicant@wlp18s0.service
sudo systemctl enable systemd-networkd.service

And reboot your PC to check if it works.

Also it's better to handle the /etc/resolv.conf file yourself if you use systemd-networkd. I use the Google DNS server. So my /etc/resolv.conf file is this:

nameserver 8.8.8.8
nameserver 8.8.4.4

Last edited by pezzonovante (2014-09-01 13:53:54)

Offline

#5 2014-09-01 14:20:35

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

pezzonovante wrote:

it's better to handle the /etc/resolv.conf file yourself if you use systemd-networkd.

You may prefer to do that, but it is equally effective to use systemd-resolved, as described on the systemd-networkd wiki page.

Offline

#6 2014-09-01 15:42:55

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,354

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

Backing up a bit and proceeding down the netctl branch...

Are you running dhcpcd as a service?  If so, and if you are using nectl, don't do that.  Netctl will start dhcpcd when it needs it.  The dhcpcd service conflicts with this.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2014-09-01 16:00:02

Sventimir
Member
Registered: 2014-09-01
Posts: 16

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

ewaller wrote:

Backing up a bit and proceeding down the netctl branch...

Are you running dhcpcd as a service?  If so, and if you are using nectl, don't do that.  Netctl will start dhcpcd when it needs it.  The dhcpcd service conflicts with this.

Not sure. There was no standalone dhcpcd service, but there was enabled a netctl service for wired network, which failed silently as no wire was pluged in. Anyway I disabled it, rebooted, but still the same error occurs.

# systemctl
  UNIT                                                                                     LOAD   ACTIVE SUB       DESCRIPTION
  proc-sys-fs-binfmt_misc.automount                                                        loaded active waiting   Arbitrary Executable File Formats File System Automount Point
  sys-devices-pci0000:00-0000:00:02.0-drm-card0-card0\x2deDP\x2d1-intel_backlight.device   loaded active plugged   /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight
  sys-devices-pci0000:00-0000:00:03.0-sound-card0.device                                   loaded active plugged   Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller
  sys-devices-pci0000:00-0000:00:1b.0-sound-card1.device                                   loaded active plugged   8 Series/C220 Series Chipset High Definition Audio Controller
  sys-devices-pci0000:00-0000:00:1c.1-0000:08:00.0-ieee80211-phy0-rfkill2.device           loaded active plugged   /sys/devices/pci0000:00/0000:00:1c.1/0000:08:00.0/ieee80211/phy0/rfkill2
  sys-devices-pci0000:00-0000:00:1c.1-0000:08:00.0-net-wlp8s0.device                       loaded active plugged   BCM43142 802.11b/g/n
  sys-devices-pci0000:00-0000:00:1c.2-0000:09:00.0-net-enp9s0.device                       loaded active plugged   QCA8172 Fast Ethernet
  sys-devices-pci0000:00-0000:00:1f.0-PNP0C09:00-VPC2004:00-rfkill-rfkill0.device          loaded active plugged   /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/rfkill/rfkill0
  sys-devices-pci0000:00-0000:00:1f.0-PNP0C09:00-VPC2004:00-rfkill-rfkill1.device          loaded active plugged   /sys/devices/pci0000:00/0000:00:1f.0/PNP0C09:00/VPC2004:00/rfkill/rfkill1
  sys-devices-pci0000:00-0000:00:1f.2-ata5-host4-target4:0:0-4:0:0:0-block-sda-sda1.device loaded active plugged   SanDisk_SDSSDHP256G boot
  sys-devices-pci0000:00-0000:00:1f.2-ata5-host4-target4:0:0-4:0:0:0-block-sda-sda2.device loaded active plugged   SanDisk_SDSSDHP256G System
  sys-devices-pci0000:00-0000:00:1f.2-ata5-host4-target4:0:0-4:0:0:0-block-sda-sda3.device loaded active plugged   SanDisk_SDSSDHP256G Var
  sys-devices-pci0000:00-0000:00:1f.2-ata5-host4-target4:0:0-4:0:0:0-block-sda-sda4.device loaded active plugged   SanDisk_SDSSDHP256G Home
  sys-devices-pci0000:00-0000:00:1f.2-ata5-host4-target4:0:0-4:0:0:0-block-sda.device      loaded active plugged   SanDisk_SDSSDHP256G
  sys-devices-pci0000:00-0000:00:1f.2-ata6-host5-target5:0:0-5:0:0:0-block-sr0.device      loaded active plugged   PLDS_DVD-RW_DS8A9SH
  sys-devices-platform-serial8250-tty-ttyS0.device                                         loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS0
  sys-devices-platform-serial8250-tty-ttyS1.device                                         loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS1
  sys-devices-platform-serial8250-tty-ttyS2.device                                         loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS2
  sys-devices-platform-serial8250-tty-ttyS3.device                                         loaded active plugged   /sys/devices/platform/serial8250/tty/ttyS3
  sys-module-configfs.device                                                               loaded active plugged   /sys/module/configfs
  sys-subsystem-net-devices-enp9s0.device                                                  loaded active plugged   QCA8172 Fast Ethernet
  sys-subsystem-net-devices-wlp8s0.device                                                  loaded active plugged   BCM43142 802.11b/g/n
  -.mount                                                                                  loaded active mounted   /
  dev-hugepages.mount                                                                      loaded active mounted   Huge Pages File System
  dev-mqueue.mount                                                                         loaded active mounted   POSIX Message Queue File System
  home.mount                                                                               loaded active mounted   /home
  run-user-1000.mount                                                                      loaded active mounted   /run/user/1000
  sys-kernel-config.mount                                                                  loaded active mounted   Configuration File System
  sys-kernel-debug.mount                                                                   loaded active mounted   Debug File System
  tmp.mount                                                                                loaded active mounted   Temporary Directory
  var.mount                                                                                loaded active mounted   /var
  systemd-ask-password-console.path                                                        loaded active waiting   Dispatch Password Requests to Console Directory Watch
  systemd-ask-password-wall.path                                                           loaded active waiting   Forward Password Requests to Wall Directory Watch
  session-c1.scope                                                                         loaded active running   Session c1 of user sven
  dbus.service                                                                             loaded active running   D-Bus System Message Bus
  getty@tty1.service                                                                       loaded active running   Getty on tty1
  kmod-static-nodes.service                                                                loaded active exited    Create list of required static device nodes for the current kernel
● netctl@home.service                                                                       loaded failed failed    Networking for netctl profile gda
  systemd-backlight@backlight:intel_backlight.service                                      loaded active exited    Load/Save Screen Backlight Brightness of backlight:intel_backlight
  systemd-fsck@dev-sda3.service                                                            loaded active exited    File System Check on /dev/sda3
  systemd-fsck@dev-sda4.service                                                            loaded active exited    File System Check on /dev/sda4
  systemd-journald.service                                                                 loaded active running   Journal Service
  systemd-logind.service                                                                   loaded active running   Login Service
  systemd-modules-load.service                                                             loaded active exited    Load Kernel Modules
  systemd-random-seed.service                                                              loaded active exited    Load/Save Random Seed
  systemd-remount-fs.service                                                               loaded active exited    Remount Root and Kernel File Systems
  systemd-rfkill@rfkill0.service                                                           loaded active exited    Load/Save RF Kill Switch Status of rfkill0
  systemd-rfkill@rfkill1.service                                                           loaded active exited    Load/Save RF Kill Switch Status of rfkill1
  systemd-rfkill@rfkill2.service                                                           loaded active exited    Load/Save RF Kill Switch Status of rfkill2
  systemd-sysctl.service                                                                   loaded active exited    Apply Kernel Variables
  systemd-tmpfiles-setup-dev.service                                                       loaded active exited    Create Static Device Nodes in /dev
  systemd-tmpfiles-setup.service                                                           loaded active exited    Create Volatile Files and Directories
  systemd-udev-trigger.service                                                             loaded active exited    udev Coldplug all Devices
  systemd-udevd.service                                                                    loaded active running   udev Kernel Device Manager
  systemd-update-utmp.service                                                              loaded active exited    Update UTMP about System Boot/Shutdown
  systemd-user-sessions.service                                                            loaded active exited    Permit User Sessions
  systemd-vconsole-setup.service                                                           loaded active exited    Setup Virtual Console
  user@1000.service                                                                        loaded active running   User Manager for UID 1000
  -.slice                                                                                  loaded active active    Root Slice
  system-getty.slice                                                                       loaded active active    system-getty.slice
  system-netctl.slice                                                                      loaded active active    system-netctl.slice
  system-systemd\x2dbacklight.slice                                                        loaded active active    system-systemd\x2dbacklight.slice
  system-systemd\x2dfsck.slice                                                             loaded active active    system-systemd\x2dfsck.slice
  system-systemd\x2drfkill.slice                                                           loaded active active    system-systemd\x2drfkill.slice
  system.slice                                                                             loaded active active    System Slice
  user-1000.slice                                                                          loaded active active    user-1000.slice
  user.slice                                                                               loaded active active    User and Session Slice
  dbus.socket                                                                              loaded active running   D-Bus System Message Bus Socket
  dm-event.socket                                                                          loaded active listening Device-mapper event daemon FIFOs
  lvm2-lvmetad.socket                                                                      loaded active listening LVM2 metadata daemon socket
  systemd-initctl.socket                                                                   loaded active listening /dev/initctl Compatibility Named Pipe
  systemd-journald-dev-log.socket                                                          loaded active running   Journal Socket (/dev/log)
  systemd-journald.socket                                                                  loaded active running   Journal Socket
  systemd-shutdownd.socket                                                                 loaded active listening Delayed Shutdown Socket
  systemd-udevd-control.socket                                                             loaded active running   udev Control Socket
  systemd-udevd-kernel.socket                                                              loaded active running   udev Kernel Socket
  basic.target                                                                             loaded active active    Basic System
  cryptsetup.target                                                                        loaded active active    Encrypted Volumes
  getty.target                                                                             loaded active active    Login Prompts
  graphical.target                                                                         loaded active active    Graphical Interface
  local-fs-pre.target                                                                      loaded active active    Local File Systems (Pre)
  local-fs.target                                                                          loaded active active    Local File Systems
  multi-user.target                                                                        loaded active active    Multi-User System
  network.target                                                                           loaded active active    Network
  paths.target                                                                             loaded active active    Paths
  remote-fs.target                                                                         loaded active active    Remote File Systems
  slices.target                                                                            loaded active active    Slices
  sockets.target                                                                           loaded active active    Sockets
  sound.target                                                                             loaded active active    Sound Card
  swap.target                                                                              loaded active active    Swap
  sysinit.target                                                                           loaded active active    System Initialization
  timers.target                                                                            loaded active active    Timers
  logrotate.timer                                                                          loaded active waiting   Daily rotation of log files
  man-db.timer                                                                             loaded active waiting   Daily man-db cache update
  shadow.timer                                                                             loaded active waiting   Daily verification of password and group files
  systemd-tmpfiles-clean.timer                                                             loaded active waiting   Daily Cleanup of Temporary Directories

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

96 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

I suppose it would be nice to have it solved, because from what I learned so far systemd-networkd serves best for stationary computers that don't change network connections frequently. My machine is a laptop which I happen to journey with from time to time and since I have netctl already working with wired network, it would be nice to use the same tool for wireless.

Last edited by Sventimir (2014-09-01 16:07:56)

Offline

#8 2014-09-01 16:34:51

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

Failed to connect to non-global ctrl_ifname: wlp8s0  error: No such file or directory

It think that is wpa_cli, you could try if adding this to your wpa_supplicant/home.config helps

Last edited by hokasch (2014-09-01 16:35:07)

Offline

#9 2014-09-01 17:38:20

Sventimir
Member
Registered: 2014-09-01
Posts: 16

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

Unfortunately my wpa_supplicant doesn't even recognize these commands:

Sep 01 21:34:09 sventimir.net network[1926]: Successfully initialized wpa_supplicant
Sep 01 21:34:09 sventimir.net network[1926]: Line 5: unknown network field 'ctrl_interface'.
Sep 01 21:34:09 sventimir.net network[1926]: Line 6: unknown network field 'update_config'.
Sep 01 21:34:09 sventimir.net network[1926]: Line 7: failed to parse network block.
Sep 01 21:34:09 sventimir.net network[1926]: Failed to read or parse configuration '/etc/wpa_supplicant/gda.conf'.
Sep 01 21:34:10 sventimir.net network[1926]: The WPA supplicant did not start for interface 'wlp8s0'

Similar errors occur if I try the wpa_supplicant way with the updated config.

Offline

#10 2014-09-01 17:44:42

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

You need to put it above the network={} block, and be wary to not have extra spaces etc in the assignments, wpa_supplicant parsing can be quite picky

Offline

#11 2014-09-01 17:49:04

Sventimir
Member
Registered: 2014-09-01
Posts: 16

Re: [SOLVED] Netctl failing where sole wpa_supplicant works

Below network={} block it works just as fine. Thanks, man! smile

Offline

Board footer

Powered by FluxBB