sandropf
Posts: 3
Joined: Thu Mar 15, 2018 1:39 pm

RPI-3 Access Point wpa2 error -22 invalid argument

Thu Mar 15, 2018 4:31 pm

Hi guys, I'm trying to setup a wireless access point in raspberry pi-3.
If I configure to run without password, clients connect fine onto wireless. But when I configure wpa2 with any password, I receive error.

Yes, have another post with this issue, I search on this forum, but none post resolve my problem. Many users told "rpi-upgrade", "apt-get upgrade".
I already do it. rpi-upgrade, apt-get upgrade, apt-get update is alright.


My conf file:

Code: Select all

interface=wlan0
driver=nl80211
ssid=network
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=81234567
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

When I exec hostapd:

Code: Select all

hostapd -d /etc/hostapd/hostapd.conf 
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
nl80211: interface wlan0 in phy phy0
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=2 op=0 soft=0 hard=0
nl80211: Using driver-based off-channel TX
nl80211: Use separate P2P group interface (driver advertised support)
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Failed to register Action frame processing - ignore for now
nl80211: Add own interface ifindex 3
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Create interface iftype 6 (MONITOR)
Failed to create interface mon.wlan0: -95 (Operation not supported)
nl80211: Driver does not support monitor interface type - try to run without it
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=GB
nl80211: 2402-2482 @ 40 MHz
nl80211: 5170-5250 @ 80 MHz
nl80211: 5250-5330 @ 80 MHz
nl80211: 5490-5710 @ 160 MHz
nl80211: 57000-66000 @ 2160 MHz
nl80211: Added 802.11b mode based on 802.11g information
Completing interface initialization
Mode: IEEE 802.11g  Channel: 7  Frequency: 2442 MHz
nl80211: Set freq 2442 (ht_enabled=0 sec_channel_offset=0)
Failed to update rate sets in kernel module
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Flushing old station entries
Could not connect to kernel driver.
Deauthenticate all stations
nl80211: Frame command failed: ret=-22 (Invalid argument) (freq=0 wait=0)
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
nl80211: set_key failed; err=-22 Invalid argument)
Failed to clear default encryption keys (ifname=wlan0 keyidx=0)
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
nl80211: set_key failed; err=-22 Invalid argument)
Failed to clear default encryption keys (ifname=wlan0 keyidx=2)
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
nl80211: set_key failed; err=-22 Invalid argument)
Failed to clear default encryption keys (ifname=wlan0 keyidx=3)
Using interface wlan0 with hwaddr b8:27:eb:2d:dd:2c and ssid 'network'
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=7):
     6e 65 74 77 6f 72 6b                              network         
PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
random: Got 9/20 bytes from /dev/random
random: Only 9/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
GMK - hexdump(len=32): [REMOVED]
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
VLAN: vlan_set_name_type(name_type=2)
nl80211: Set beacon (beacon_set=0)
nl80211: Ignore AP isolation configuration error since isolation is not used
WPA: Start group state machine to set initial keys
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
GTK - hexdump(len=16): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=3 alg=3 addr=0x89168 key_idx=1 set_tx=1 seq_len=0 key_len=16
   broadcast key
wpa_driver_nl80211_set_operstate: operstate 0->1 (UP)
netlink: Operstate: linkmode=-1, operstate=6
Failed to set TX queue parameters for queue 0.
Failed to set TX queue parameters for queue 1.
Failed to set TX queue parameters for queue 2.
Failed to set TX queue parameters for queue 3.
wlan0: Setup of interface done.
RTM_NEWLINK: operstate=1 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
nl80211: if_removed already cleared - ignore event
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
nl80211: if_removed already cleared - ignore event
RTM_NEWLINK: operstate=1 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
nl80211: if_removed already cleared - ignore event
VLAN: vlan_newlink(wlan0)
VLAN: vlan_newlink(wlan0)
The network wireless was generated, but when any client try connect:

Code: Select all

nl80211: Event message available
nl80211: New station 64:6c:b2:64:6a:30
nl80211: Assoc Req IEs - hexdump(len=83): 00 07 6e 65 74 77 6f 72 6b 01 08 82 84 8b 96 24 30 48 6c 32 04 0c 12 18 60 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00 2d 1a 2c 01 03 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 06 00 00 0a 82 00 40
wlan0: STA 64:6c:b2:64:6a:30 IEEE 802.11: associated
STA included RSN IE in (Re)AssocReq
  New STA
wlan0: STA 64:6c:b2:64:6a:30 WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33da20 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
IEEE 802.1X: Ignore STA - 802.1X not enabled or forced for WPS
wlan0: STA 64:6c:b2:64:6a:30 WPA: start authentication
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33da20 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: STA 64:6c:b2:64:6a:30 IEEE 802.1X: unauthorizing port
WPA: 64:6c:b2:64:6a:30 WPA_PTK_GROUP entering state IDLE
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state AUTHENTICATION
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state AUTHENTICATION2
WPA: Re-initialize GMK/Counter on first station
GMK - hexdump(len=32): [REMOVED]
Key Counter - hexdump(len=32): [REMOVED]
GTK - hexdump(len=16): [REMOVED]
wpa_driver_nl80211_set_key: ifindex=3 alg=3 addr=0x89168 key_idx=1 set_tx=1 seq_len=0 key_len=16
   broadcast key
WPA: Assign ANonce - hexdump(len=32): 32 14 0c 18 52 db 10 16 b1 40 c1 eb db 30 23 61 af e9 fe 8d a0 98 77 c4 47 3f 1b 82 ff 67 77 0c
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state INITPSK
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: No monitor socket available for wpa_driver_nl80211_send_frame
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: Use EAPOL-Key timeout of 100 ms (retry counter 1)
wlan0: STA 64:6c:b2:64:6a:30 WPA: EAPOL-Key timeout
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: No monitor socket available for wpa_driver_nl80211_send_frame
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 2)

wlan0: STA 64:6c:b2:64:6a:30 WPA: EAPOL-Key timeout
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: No monitor socket available for wpa_driver_nl80211_send_frame
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 3)
wlan0: STA 64:6c:b2:64:6a:30 WPA: EAPOL-Key timeout
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: No monitor socket available for wpa_driver_nl80211_send_frame
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 4)
wlan0: STA 64:6c:b2:64:6a:30 WPA: EAPOL-Key timeout
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: PTKSTART: Retry limit 4 reached
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state DISCONNECT
hostapd_wpa_auth_disconnect: WPA authenticator requests disconnect: STA 64:6c:b2:64:6a:30 reason 2
nl80211: Frame command failed: ret=-22 (Invalid argument) (freq=0 wait=0)
wlan0: STA 64:6c:b2:64:6a:30 WPA: event 3 notification
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33da20 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
WPA: wpa_sm_step() called recursively
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state DISCONNECTED
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33da20 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: STA 64:6c:b2:64:6a:30 IEEE 802.1X: unauthorizing port
Removing STA 64:6c:b2:64:6a:30 from kernel driver
wlan0: STA 64:6c:b2:64:6a:30 MLME: MLME-DEAUTHENTICATE.indication(64:6c:b2:64:6a:30, 2)
wlan0: STA 64:6c:b2:64:6a:30 MLME: MLME-DELETEKEYS.request(64:6c:b2:64:6a:30)
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33da20 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
nl80211: Event message available
nl80211: Delete station 64:6c:b2:64:6a:30
wlan0: STA 64:6c:b2:64:6a:30 IEEE 802.11: disassociated
wlan0: STA 64:6c:b2:64:6a:30 WPA: event 2 notification
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33da20 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state DISCONNECTED
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33da20 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: STA 64:6c:b2:64:6a:30 IEEE 802.1X: unauthorizing port
nl80211: Event message available
nl80211: New station 64:6c:b2:64:6a:30
nl80211: Assoc Req IEs - hexdump(len=83): 00 07 6e 65 74 77 6f 72 6b 01 08 82 84 8b 96 24 30 48 6c 32 04 0c 12 18 60 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00 2d 1a 2c 01 03 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 06 00 00 0a 82 00 40
wlan0: STA 64:6c:b2:64:6a:30 IEEE 802.11: associated
STA included RSN IE in (Re)AssocReq
  New STA
wlan0: STA 64:6c:b2:64:6a:30 WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33db28 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
IEEE 802.1X: Ignore STA - 802.1X not enabled or forced for WPS
wlan0: STA 64:6c:b2:64:6a:30 WPA: start authentication
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33db28 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: STA 64:6c:b2:64:6a:30 IEEE 802.1X: unauthorizing port
WPA: 64:6c:b2:64:6a:30 WPA_PTK_GROUP entering state IDLE
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state AUTHENTICATION
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state AUTHENTICATION2
WPA: Assign ANonce - hexdump(len=32): 32 14 0c 18 52 db 10 16 b1 40 c1 eb db 30 23 61 af e9 fe 8d a0 98 77 c4 47 3f 1b 82 ff 67 77 0d
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state INITPSK
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: No monitor socket available for wpa_driver_nl80211_send_frame
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: Use EAPOL-Key timeout of 100 ms (retry counter 1)
wlan0: STA 64:6c:b2:64:6a:30 WPA: EAPOL-Key timeout
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: No monitor socket available for wpa_driver_nl80211_send_frame
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 2)
wlan0: STA 64:6c:b2:64:6a:30 WPA: EAPOL-Key timeout
WPA: 64:6c:b2:64:6a:30 WPA_PTK entering state PTKSTART
wlan0: STA 64:6c:b2:64:6a:30 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: No monitor socket available for wpa_driver_nl80211_send_frame
i802_send_eapol - packet len: 131 - failed: 11 (Resource temporarily unavailable)
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 3)
^CSignal 2 received - terminating
wlan0: STA 64:6c:b2:64:6a:30 MLME: MLME-DEAUTHENTICATE.indication(64:6c:b2:64:6a:30, 1)
wlan0: STA 64:6c:b2:64:6a:30 MLME: MLME-DELETEKEYS.request(64:6c:b2:64:6a:30)
wpa_driver_nl80211_set_key: ifindex=3 alg=0 addr=0x33db28 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=64:6c:b2:64:6a:30
nl80211: set_key failed; err=-22 Invalid argument)
Removing station 64:6c:b2:64:6a:30
Flushing old station entries
Could not connect to kernel driver.
Deauthenticate all stations
nl80211: Frame command failed: ret=-22 (Invalid argument) (freq=0 wait=0)
netlink: Operstate: linkmode=0, operstate=6


PS: Already tried use another hostapd.conf that I found here on rpi forum. Nothing works.
Can anyone help please? I really don't like to lost my current status image into this raspberry.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: RPI-3 Access Point wpa2 error -22 invalid argument

Thu Mar 15, 2018 7:05 pm

You shouldn't need to run hostapd. It starts as a service. If you want to check the status

Code: Select all

sudo service hostapd status
It should show active (running)
If you want to run hostapd from the command line, you must stop the service first.

Code: Select all

sudo service hostapd stop

sandropf
Posts: 3
Joined: Thu Mar 15, 2018 1:39 pm

Re: RPI-3 Access Point wpa2 error -22 invalid argument

Fri Mar 16, 2018 11:31 am

SurferTim wrote:
Thu Mar 15, 2018 7:05 pm
You shouldn't need to run hostapd. It starts as a service. If you want to check the status

Code: Select all

sudo service hostapd status
It should show active (running)
If you want to run hostapd from the command line, you must stop the service first.

Code: Select all

sudo service hostapd stop

I know this. I run hostapd as service. But with password client can't connect, so cause of this I run it with this command to be easily debug.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: RPI-3 Access Point wpa2 error -22 invalid argument

Fri Mar 16, 2018 11:49 am

I haven't run into that problem before. Which version Raspbian are you using? I haven't tried v2018-03-13 yet. Are you using the RPi3B or the RPI3B+

Edit: I just set up an access point with v2018-03-13 and the NAT version here, and it works fine.
https://www.raspberrypi.org/documentati ... s-point.md
I don't have a RPi3B+ yet. I'll get one as soon as my supplier gets them back in stock.

sandropf
Posts: 3
Joined: Thu Mar 15, 2018 1:39 pm

Re: RPI-3 Access Point wpa2 error -22 invalid argument

Fri Mar 16, 2018 5:26 pm

I made a system with current iso.
Folders dir, databases, opencv, a lot of vars that gonna be very hard to put in another iso. Currently, I just copy system from 1 rpi to another rpi when I have to create a copy of my product (cloning my dev version to new rpi3, creating the production version). Cause this, I can't install new versions of raspbian or format my sd card to try again.

The solution that I really need is fix this on actual sd state... if there are no alternatives I try to update the version of raspbian.


About my raspbian version:

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian



@Edit

With clear image of raspbian (same version of my current iso) work fine.
Maybe I'll try pass every applications of my iso to a clean install.
Thanks.

Return to “Troubleshooting”