stevepedwards.com/DebianAdmin linux mint IT admin tips info

Pi3 Wifi Setup Problem – RESOLVED; group=netdev Fault?? Eh?

https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

The Pi3 has wifi built in.

Interfaces:

stevee@pi3:~ $ ifconfig

wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:55:ce:f8 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

stevee@PI3:~ $ sudo iwlist wlan0 scan
wlan0 Scan completed :
Cell 01 - Address: 00:50:7F:E6:D1:B8
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=70/70 Signal level=-23 dBm
Encryption key:on
ESSID:"DrayTek"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 9 Mb/s
18 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 12 Mb/s; 24 Mb/s; 48 Mb/s
Mode:Master
Extra:tsf=0000000000000000
Extra: Last beacon: 90ms ago
IE: Unknown: 00074472617954656B
IE: Unknown: 010882848B961224486C
IE: Unknown: 030101
IE: Unknown: 2A0100
IE: Unknown: 32040C183060
IE: Unknown: 2D1A6E1017FFFFFF0001000000000000000000000000000000000000
IE: Unknown: 3D1601050600000000000000000000000000000000000000
IE: Unknown: 3E0100
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
IE: Unknown: 0B050002117A12
IE: Unknown: 7F0101
IE: Unknown: DD07000C4300000000
IE: Unknown: DD1E00904C336E1017FFFFFF0001000000000000000000000000000000000000
IE: Unknown: DD1A00904C3401050600000000000000000000000000000000000000
IE: Unknown: ......blah

stevee@pi3:~ $ wpa_passphrase "APname" "APs Password"

network={
ssid="APname"
#psk="APs Password"
psk=3b457ebcbf7c012ee3b9d4df783acedaf80565a1f7b131f5944aa3d1505c241e
}

stevee@pi3:~ $ sudo  wpa_passphrase "ap" "apPassword" >> /etc/wpa_supplicant/wpa_supplicant.conf

generates form:

network={
ssid="ap"
#psk="apPassword"
psk=xxxxxxxxxxxxxxxxxxxx
}

Hmm...appends of this form - like echo >> also - are not allowed in Raspbian now it seems, why not? Have to use vi instead - which you also can't copy and paste from now either as sudo over SSH - what are they doing to Linux??!!

What's in it after raspi-config wifi country legalities set?

 sudo vi /etc/wpa_supplicant/wpa_supplicant.conf

Adding

network={
ssid="ap"
#psk="apPassword"
psk=xxxxxxxxxxxxxxxxxxxx
}

should be all that's required for most unhidden WPA based home setups as the defaults for other options should not be required except for specific more secure AP settings!

"At this point, wpa-supplicant will normally notice within a few seconds that a change has occurred, and it will try and connect to the network. If it does not, restart the interface with sudo wpa_cli reconfigure."

stevee@pi3:~ $ sudo wpa_cli reconfigure
Selected interface 'p2p-dev-wlan0'

Hmm...or NOT....!

stevee@pi3:~ $ sudo dhclient -v wlan0
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/b8:27:eb:55:ce:f8
Sending on LPF/wlan0/b8:27:eb:55:ce:f8
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 19

Not getting a DHCP offer....

Not a hardware issue because unit can scan the AP ok...

Check for firmware and update wireless-tools...

stevee@PI3:~ $ sudo rpi-update

stevee@PI3:~ $ sudo apt update && sudo apt upgrade
Hit:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Hit:2 http://archive.raspberrypi.org/debian stretch InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

All good...the AP just wont hand out a DHCP address to this unit...

stevee@PI3:~ $ sudo wpa_cli reconfigure
Selected interface 'p2p-dev-wlan0'
OK

In term 1:

stevee@PI3:~ $ sudo dhclient wlan0

In term 2:

stevee@PI3:~ $ sudo tail -f /var/log/syslog

Oct 7 00:43:37 PI3 dhclient[1983]: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 2
Oct 7 00:43:39 PI3 dhclient[1983]: No DHCPOFFERS received.
Oct 7 00:43:39 PI3 dhclient[1983]: No working leases in persistent database - sleeping.

Settings in router are all OK as laptop is connected for WPA/WPA2 and same password, and WPS is enabled...(the scanning for client requests)

AP seems unwilling/unable to give DHCP Addr - is laptop wifi interfering? Check with cable and wifi off...

nope, not interference...

Aah..on reboot:

Stopping Bluetooth service...

Is the pissing wifi for BTooth instead ?

stevee@PI3:~ $ sudo apt-get remove bluez

stevee@PI3:~ $ sudo apt autoremove

Nope!

stevee@PI3:~ $ sudo dhclient -v wlan0

Nope!

Add more relevant encryption info from:

stevee@PI3:~ $ sudo iwlist wlan0 scan

stevee@pi3:~ $ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf

network={
ssid="ap"
#psk="apPassword"
psk=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

pairwise=TKIP CCMP

key_mgmt=WPA-PSK

proto=WPA

}

stevee@PI3:~ $ sudo dhclient -v wlan0

Nope!

Double check AP/password values:

stevee@PI3:~ $ sudo wpa_passphrase "DrayTek" "my_password"

Yep - correct.

WTF!!?

https://www.freebsd.org/cgi/man.cgi?wpa_supplicant.conf(5)

network={
parameter=value
...
}

ssid (required)
Network name (as announced by the access point). An ASCII or hex
string enclosed in quotation marks.

ssid="DrayTek"

Check!

psk WPA preshared key used in WPA-PSK mode. The key is specified as 64 hex digits or as an 8-63 character ASCII passphrase. ASCII passphrases are dynamically converted to a 256-bit key at runtime using the network SSID, or they can be statically converted at configuration time using the wpa_passphrase(8) utility.

psk=xxxxxxxxxxxx

Check!

scan_ssid
SSID scan technique; 0 (default) or 1. Technique 0 scans for the
SSID using a broadcast Probe Request frame while 1 uses a
directed Probe Request frame. Access points that cloak them-
selves by not broadcasting their SSID require technique 1, but
beware that this scheme can cause scanning to take longer to com-
plete.

scan_ssid=0

Check!

proto List of acceptable protocols; one or more of: WPA (IEEE
802.11i/D3.0) and RSN (IEEE 802.11i). WPA2 is another name for
RSN. If not set this defaults to "WPA RSN".

proto=WPA RSN

Check!

key_mgmt
List of acceptable key management protocols; one or more of:
WPA-PSK (WPA pre-shared key), WPA-EAP (WPA using EAP authentica-
tion), IEEE8021X (IEEE 802.1x using EAP authentication and,
optionally, dynamically generated WEP keys), NONE (plaintext or
static WEP keys). If not set this defaults to "WPA-PSK WPA-EAP".

key-mgmt=WPA-PSK

Check!

auth_alg List of allowed IEEE 802.11 authentication algorithms; one or more of: OPEN (Open System authentication, required for WPA/WPA2), SHARED (Shared Key authentication), LEAP (LEAP/Network EAP). If not set automatic selection is used (Open System with LEAP enabled if LEAP is allowed as one of the EAP methods).

Check!

EXAMPLE:

# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
#
# home network; allow all valid ciphers
network={
ssid="home"
scan_ssid=1
key_mgmt=WPA-PSK
psk="very secret passphrase"

}

Has to be another issue - fuck knows!

sudo reboot

stevee@PI3:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.13 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::9cc1:262f:7fa0:eb0f prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:00:9b:ad txqueuelen 1000 (Ethernet)
RX packets 84 bytes 13148 (12.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 93 bytes 14887 (14.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 4 bytes 240 (240.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 240 (240.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:55:ce:f8 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Found this on the web and got:

stevee@pi3:~ $ sudo wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf & dhcpcd wlan0
[1] 1100
control_open: Permission denied
main: pidfile_lock: Permission denied
stevee@pi3:~ $ Successfully initialized wpa_supplicant
CTRL: Invalid group 'netdev update_config=1'
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.

nl80211: deinit ifname=wlan0 disabled_11b_rates=0

Seems the format of the wpa_supplicant.conf is wrong as it sees the group as

netdev update..

unseparated

CTRL: Invalid group 'netdev update_config=1'

stevee@pi3:~ $ sudo vi /etc/wpa_supplicant/wpa_supplicant.conf

#GROUP=netdev

Try only:

stevee@pi3:~ $ sudo wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Successfully initialized wpa_supplicant
p2p-dev-wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=GB
wlan0: Trying to associate with 00:50:7f:e6:d1:b8 (SSID='DrayTek' freq=2412 MHz)
wlan0: Associated with 00:50:7f:e6:d1:b8
wlan0: WPA: Key negotiation completed with 00:50:7f:e6:d1:b8 [PTK=CCMP GTK=TKIP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 00:50:7f:e6:d1:b8 completed [id=0 id_str=]

Looks like the raspi-config additions for country etc. create invalid "netdev" line??

Just get an DHCP address now in other term...

stevee@pi3:~ $ sudo dhcpcd wlan0

sending commands to master dhcpcd process

stevee@pi3:~ $ ifconfig

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255

Fixed It!! RESOLVED!

Later, I also changed to a diff USB key, added minimal "network=" lines of

ssid= and psk=

to a default wpa_supplicant.conf

and did:

stevee@pi3:~ $ sudo wpa_cli reconfigure
Selected interface 'p2p-dev-wlan0'
'RECONFIGURE' command timed out.

Tried again and it connected...it got the IP address:

stevee@pi3:~ $ ifconfig

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.102.113 netmask 255.255.0.0 broadcast 169.254.255.255

seemingly from:

stevee@pi3:~ $ sudo vi /etc/networks

link-local   169.254.0.0

but later, tail showed it dumped it for a DHCP addr:

Oct 7 14:44:08 pi3 avahi-daemon[408]: New relevant interface wlan0.IPv4 for mDNS.

Oct 7 14:44:08 pi3 dhcpcd[612]: wlan0: adding route to 169.254.0.0/16
Oct 7 14:44:08 pi3 avahi-daemon[408]: Registering new address record for 169.254.102.113 on wlan0.IPv4.
Oct 7 14:47:49 pi3 dhcpcd[612]: eth0: Router Advertisement from fe80::250:7fff:fee6:d1b8
Oct 7 14:47:49 pi3 dhcpcd[612]: wlan0: Router Advertisement from fe80::250:7fff:fee6:d1b8
Oct 7 14:50:20 pi3 dhcpcd[612]: wlan0: offered 192.168.1.6 from 192.168.1.1
Oct 7 14:50:20 pi3 dhcpcd[612]: wlan0: probing address 192.168.1.6/24
Oct 7 14:50:26 pi3 dhcpcd[612]: wlan0: leased 192.168.1.6 for 28800 seconds
Oct 7 14:50:26 pi3 avahi-daemon[408]: Registering new address record for 192.168.1.6 on wlan0.IPv4.
Oct 7 14:50:26 pi3 dhcpcd[612]: wlan0: adding route to 192.168.1.0/24
Oct 7 14:50:26 pi3 dhcpcd[612]: wlan0: adding default route via 192.168.1.1
Oct 7 14:50:26 pi3 avahi-daemon[408]: Withdrawing address record for 169.254.102.113 on wlan0.
Oct 7 14:50:26 pi3 avahi-daemon[408]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 169.254.102.113.
Oct 7 14:50:26 pi3 dhcpcd[612]: wlan0: deleting route to 169.254.0.0/16
Oct 7 14:50:26 pi3 avahi-daemon[408]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.6.

stevee@pi3:~ $ ifconfig

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255

Conclusion:

Don't use raspi-config to set your country wifi settings! Or just comment out

#Group=netdev

in /etc/wpa_supplicant/wpa_supplicant.conf

For possible corruption, run fsck at reboot (now):

sudo shutdown -r -F now

Hahahahaha...dork!...also check your router doesn't have a limited amount of DHCP addresses for it's pool!! Like 15 in my case, so was on the limit for some requests at times depending on if my 8 hr leases expired in time too! I've got between 10 and 17 addresses used at any time...duh - now I've set pool to 20...dickhead...

See why I don't do IT now in my senility...?

Handy to know if wifi is off in BIOS or Fkey...

rfkill list
0: hp-wifi: Wireless LAN
Soft blocked: no
Hard blocked: no

Comments are closed.

Post Navigation