0

I just received my Raspberry Pi 3 B+ with onboard dual band WiFi. I have a 5GHz Access point that my iPhone ( and MacBook ) connects to just fine. I am using wpa_supplicant on the Pi to manually attempt to connect to this Access Point.

The Pi can find the access point in it's scans, but cannot connect - wpa_cli always returns CTRL-EVENT-ASSOC-REJECT status_code=16.

I would appreciate any ideas on how to get the Pi to connect. Thank you.

wlan0 interface is available on boot:

>> ifconfig 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.130  netmask 255.255.255.0  broadcast 192.168.1.255
        ...

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:1b:b8:b3  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

I launch wpa_supplicant like this:

wpa_supplicant -Dnl80211 -iwlan0 -d -c/etc/wpa_supplicant/wpa_supplicant.conf

wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

Then in a different terminal, I use wpa_cli to interact with wpa_supplicant:

>> wpa_cli -i wlan0 -p /run/wpa_supplicant
wpa_cli v2.4
Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.



Interactive mode

> scan
OK
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
> scan_results
bssid / frequency / signal level / flags / ssid
85:26:d9:69:98:19   5240    -42 [WPA2-PSK-CCMP][ESS]    MyNetwork
f0:79:59:73:08:f0   2462    -59 [WPA2-PSK-CCMP][WPS][ESS]   RAGE_2.4G
74:d0:2b:86:b8:a8   2442    -73 [WPA2-PSK-CCMP][ESS]    Muscle Bagger Garage 5GHz1_RPT2G
04:bf:6d:e4:76:d1   2412    -76 [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][WPS][ESS]   CenturyLink6140
34:12:98:06:4d:d4   2437    -76 [WPA2-PSK-CCMP][ESS]    Duncanson
> add_network 0
0
> set_network 0 ssid "MyNetwork"
OK
> set_network 0 psk "test1234"
OK
> enable_network 0
OK
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
<3>Trying to associate with 84:16:f9:09:08:89 (SSID='MyNetwork' freq=5240 MHz)
<3>CTRL-EVENT-ASSOC-REJECT status_code=16
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
<3>Trying to associate with 84:16:f9:09:08:89 (SSID='MyNetwork' freq=5240 MHz)
<3>CTRL-EVENT-ASSOC-REJECT status_code=16
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
<3>Trying to associate with 84:16:f9:09:08:89 (SSID='MyNetwork' freq=5240 MHz)
<3>CTRL-EVENT-ASSOC-REJECT status_code=16
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 
<3>Trying to associate with 84:16:f9:09:08:89 (SSID='MyNetwork' freq=5240 MHz)
<3>CTRL-EVENT-ASSOC-REJECT status_code=16
<3>CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MyNetwork" auth_failures=1 duration=10 reason=CONN_FAILED
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-RESULTS 
<3>WPS-AP-AVAILABLE 

The relevant part of the wpa_supplicant log is shown here:

nl80211: Connect request send successfully
wlan0: Setting authentication timeout: 10 sec 0 usec
EAPOL: External notification - EAP success=0
EAPOL: External notification - EAP fail=0
EAPOL: External notification - portControl=Auto
nl80211: Ignored event (cmd=46) for foreign interface (ifindex 3 wdev 0x0)
nl80211: Drv Event 46 (NL80211_CMD_CONNECT) received for wlan0
nl80211: Connect event (status=16 ignore_next_local_disconnect=0)
wlan0: Event ASSOC_REJECT (13) received
wlan0: CTRL-EVENT-ASSOC-REJECT status_code=16
CTRL_IFACE monitor sent successfully to /tmp/wpa_ctrl_17737-2\x00
wlan0: Radio work 'connect'@0x1db5a78 done in 0.064055 seconds
Added BSSID 85:26:d9:69:98:19 into blacklist
Continuous association failures - consider temporary network disabling
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MyNetwork" auth_failures=1 duration=10 reason=CONN_FAILED
CTRL_IFACE monitor sent successfully to /tmp/wpa_ctrl_17737-2\x00
wlan0: Blacklist count 7 --> request scan in 10000 ms
wlan0: Setting scan request: 10.000000 sec
wlan0: State: ASSOCIATING -> DISCONNECTED
nl80211: Set wlan0 operstate 0->0 (DORMANT)
netlink: Operstate: ifindex=3 linkmode=-1 (no change), operstate=5 (IF_OPER_DORMANT)
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
EAPOL: External notification - EAP success=0

On the server side, the hostapd daemon does not show any messages when the connect "fails" from the RPI's perspective.

When the iPhone successfully connects, hostapd on my access point shows this:

nl80211: Event message available
nl80211: Drv Event 19 (NL80211_CMD_NEW_STATION) received for wlan0
nl80211: New station 88:66:a5:ed:86:61
nl80211: Assoc Req IEs - hexdump(len=87): 00 0d 4b 6c 61 73 74 6c 65 53 65 72 76 65 72 01 08 8c 12 98 24 b0 48 60 6c 21 02 02 13 24 0a 24 04 34 04 64 0c 95 04 a5 01 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 0c 00 dd 0b 00 17 f2 0a 00 01 04 00 00 00 00 dd 09 00 10 18 02 00 00 10 00 00
wlan0: Event ASSOC (0) received
wlan0: STA 88:66:a5:ed:86:61 IEEE 802.11: associated
STA included RSN IE in (Re)AssocReq
  New STA
ap_sta_add: register ap_handle_timer timeout for 88:66:a5:ed:86:61 (300 seconds - ap_max_inactivity)
nl80211: Set STA flags - ifname=wlan0 addr=88:66:a5:ed:86:61 total_flags=0x60 flags_or=0x0 flags_and=0xfffffff1 authorized=0
wlan0: STA 88:66:a5:ed:86:61 WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=0x7fe61c98 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=88:66:a5:ed:86:61
IEEE 802.1X: Ignore STA - 802.1X not enabled or forced for WPS
wlan0: STA 88:66:a5:ed:86:61 WPA: start authentication
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=0 addr=0x7fe61c98 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=88:66:a5:ed:86:61
nl80211: Set STA flags - ifname=wlan0 addr=88:66:a5:ed:86:61 total_flags=0x60 flags_or=0x0 flags_and=0xfffffffe authorized=0
wlan0: STA 88:66:a5:ed:86:61 IEEE 802.1X: unauthorizing port
WPA: 88:66:a5:ed:86:61 WPA_PTK_GROUP entering state IDLE
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state AUTHENTICATION
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state AUTHENTICATION2
WPA: Re-initialize GMK/Counter on first station
Get randomness: len=32 entropy=1
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
Get randomness: len=16 entropy=0
GTK - hexdump(len=16): [REMOVED]
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x7f6515f0 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
Get randomness: len=32 entropy=0
WPA: Assign ANonce - hexdump(len=32): 3e fc c9 c4 71 47 77 42 60 c2 f1 13 0b 11 e3 90 2d 72 3f 59 77 22 81 49 5c 47 5a b8 f9 34 fc 81
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state INITPSK
Searching a PSK for 88:66:a5:ed:86:61 prev_psk=(nil)
Searching a PSK for 88:66:a5:ed:86:61 prev_psk=(nil)
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state PTKSTART
wlan0: STA 88:66:a5:ed:86:61 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=1 kde_len=0 keyidx=0 encr=0)
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 01
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 1)
wlan0: hostapd_new_assoc_sta: reschedule ap_handle_timer timeout for 88:66:a5:ed:86:61 (300 seconds - ap_max_inactivity)
wlan0: Event EAPOL_RX (24) received
IEEE 802.1X: 121 bytes from 88:66:a5:ed:86:61
   IEEE 802.1X: version=2 type=3 length=117
WPA: Received EAPOL-Key from 88:66:a5:ed:86:61 key_info=0x10a type=2 key_data_length=22
WPA: Received Key Nonce - hexdump(len=32): 02 99 eb 34 53 2e 99 72 9a 36 d1 b6 72 4d c9 35 49 ab d9 50 35 7e ab f2 50 36 81 b5 f9 29 36 b7
WPA: Received Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 01
wlan0: STA 88:66:a5:ed:86:61 WPA: received EAPOL-Key frame (2/4 Pairwise)
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state PTKCALCNEGOTIATING
Searching a PSK for 88:66:a5:ed:86:61 prev_psk=(nil)
WPA: PTK derivation - A1=84:16:f9:09:08:89 A2=88:66:a5:ed:86:61
WPA: Nonce1 - hexdump(len=32): 3e fc c9 c4 71 47 77 42 60 c2 f1 13 0b 11 e3 90 2d 72 3f 59 77 22 81 49 5c 47 5a b8 f9 34 fc 81
WPA: Nonce2 - hexdump(len=32): 02 99 eb 34 53 2e 99 72 9a 36 d1 b6 72 4d c9 35 49 ab d9 50 35 7e ab f2 50 36 81 b5 f9 29 36 b7
WPA: PMK - hexdump(len=32): [REMOVED]
WPA: PTK - hexdump(len=48): [REMOVED]
WPA: KCK - hexdump(len=16): [REMOVED]
WPA: KEK - hexdump(len=16): [REMOVED]
WPA: TK - hexdump(len=16): [REMOVED]
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state PTKCALCNEGOTIATING2
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state PTKINITNEGOTIATING
wlan0: STA 88:66:a5:ed:86:61 WPA: sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=1 mic=1 ack=1 install=1 pairwise=1 kde_len=46 keyidx=1 encr=1)
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 02
Plaintext EAPOL-Key Key Data - hexdump(len=56): [REMOVED]
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 1)
wlan0: Event EAPOL_RX (24) received
IEEE 802.1X: 99 bytes from 88:66:a5:ed:86:61
   IEEE 802.1X: version=2 type=3 length=95
WPA: Received EAPOL-Key from 88:66:a5:ed:86:61 key_info=0x30a type=2 key_data_length=0
WPA: Received Key Nonce - hexdump(len=32): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
WPA: Received Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 02
wlan0: STA 88:66:a5:ed:86:61 WPA: received EAPOL-Key frame (4/4 Pairwise)
WPA: 88:66:a5:ed:86:61 WPA_PTK entering state PTKINITDONE
wpa_driver_nl80211_set_key: ifindex=4 (wlan0) alg=3 addr=0x7fe61c98 key_idx=0 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   addr=88:66:a5:ed:86:61
wlan0: AP-STA-CONNECTED 88:66:a5:ed:86:61
nl80211: Set STA flags - ifname=wlan0 addr=88:66:a5:ed:86:61 total_flags=0x61 flags_or=0x1 flags_and=0xffffffff authorized=1
wlan0: STA 88:66:a5:ed:86:61 IEEE 802.1X: authorizing port
wlan0: STA 88:66:a5:ed:86:61 RADIUS: starting accounting session 39D7F418B38F246F
wlan0: STA 88:66:a5:ed:86:61 WPA: pairwise key handshake completed (RSN)

According to the hostapd source code the failure is due to:

/** Association rejected during connection attempt */
#define WPA_EVENT_ASSOC_REJECT "CTRL-EVENT-ASSOC-REJECT "

It seems as though 802.11 ac authentication with Raspberry Pi 3B+'s onboard radio does not associate with the hostapd file that follows ( even though the iPhone and MacBook work and connect at 802.11ac speeds ). If I uncomment the 80211ac line in the following file, the connection works, but speed is slow:

interface=wlan0
driver=nl80211
country_code=US
ssid=MyNetwork
hw_mode=a

channel=48
#ieee80211ac=1                # 802.11ac support
ieee80211d=1
ieee80211h=1

macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=test1234
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
beacon_int=100
auth_algs=3
wmm_enabled=1         # QoS support
eap_reauth_period=360000000
  • Is there any reason you aren't using the default networking on Raspbian? Have you tried connecting via the GUI? – Milliways Mar 22 '18 at 1:22
  • Yes I’ve tried the pixel GUI, and wicd, and wpa_gui, they all fail to connect. I went with wpa_cli since it is the standard Linux way of WiFi connections. – PhilBot Mar 22 '18 at 1:25
  • You could try manually configuring wpa_supplicant How to set up networking/WiFi – Milliways Mar 22 '18 at 3:04
  • And you use a fresh flashed Raspbian Stretch 2018-03-13, right? – Ingo Mar 22 '18 at 16:28
  • Yes the very latest image ( with Pixel GUI ) and I’ve upgraded all packages with apt-get – PhilBot Mar 22 '18 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.