imx6ull AP WIFI HOSTAPD (et_key failed; err=-22 Invalid argument)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6ull AP WIFI HOSTAPD (et_key failed; err=-22 Invalid argument)

Jump to solution
266 Views
mariusoctavian
Contributor III

Hello
I installed Debian on a imx6ull (is a dart board) as in these instructions

DEBIAN 

So far here are the configs involved in running an access point using HOSTAPD

 

# Kernel
Linux imx6ul-var-dart 4.9.88-gaaecf0961617

# hostapd -v
hostapd v2.4
User space daemon for IEEE 802.11 AP management,
IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Copyright (c) 2002-2015, Jouni Malinen <j@w1.fi> and contributors

# network/interfaces
auto eth1
iface eth1 inet static
    address 10.5.5.1
    network 10.5.5.0
    netmask 255.255.255.0
    broadcast 10.5.5.255


auto wlan0
iface wlan0 inet static
    address 10.5.5.1
    network 10.5.5.0
    netmask 255.255.255.0
    broadcast 15.5.5.255


auto br0
iface br0 inet static
    address 10.5.5.1
    network 10.5.5.0
    netmask 255.255.255.0
    broadcast 10.5.5.255
    bridge-ports eth1 wlan0

# /etc/hostapd/hostapd.conf
country_code=US
interface=wlan0
ssid=myappname
channel=7
hw_mode=g
macaddr_acl=0
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=whatever
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
#ieee80211n=1   <<  these makes no difference
#wmm_enabled=1
#driver=nl80211

# drivers
~# lsmod
Module                  Size  Used by
bridge                109494  0
stp                     2328  1 bridge
brcmfmac              196341  0
brcmutil                8440  1 brcmfmac
ip_tables              11987  0

# ifconfig
br0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.5.5.1  netmask 255.255.255.0  broadcast 10.5.5.255
        ether f8:dc:7a:35:95:ea  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
### uplink
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.105  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::fadc:7aff:fe35:95eb  prefixlen 64  scopeid 0x20<link>
        ether f8:dc:7a:35:95:eb  txqueuelen 1000  (Ethernet)
        RX packets 1389  bytes 677332 (661.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 530  bytes 26862 (26.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.5.5.1  netmask 255.255.255.0  broadcast 10.5.5.255
        ether f8:dc:7a:35:95:ea  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

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 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

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.5.5.1  netmask 255.255.255.0  broadcast 15.5.5.255
        ether 00:25:ca:38:16:6f  txqueuelen 1000  (Ethernet)
        RX packets 82  bytes 13838 (13.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13  bytes 1037 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0



 When I am trying to connect I am getting following log

.............................
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
hostapd_setup_bss(hapd=0x245b4e0 (wlan0), first=1)
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
nl80211: Station flush failed: ret=-14 (Bad address)
wlan0: Could not connect to kernel driver
wlan0: Deauthenticate all stations
nl80211: sta_remove -> DEL_STATION wlan0 ff:ff:ff:ff:ff:ff --> 0 (Success)
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) 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=6 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) 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=6 (wlan0) 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 00:25:ca:38:16:6f and ssid "myssid"
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=5):
     6f 63 65 61 6e                                    myssid
PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
random: Got 14/20 bytes from /dev/random
random: Only 14/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
Get randomness: len=32 entropy=0
GMK - hexdump(len=32): [REMOVED]
Get randomness: len=32 entropy=0
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=56): 80 00 00 00 ff ff ff ff ff ff 00 25 ca 38 16 6f 00 25 ca 38 16 6f 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 05 6f 63 65 61 6e 01 08 82 84 8b 96 0c 12 18 24 03 01 07
nl80211: Beacon tail - hexdump(len=41): 2a 01 04 32 04 30 48 60 6c 30 18 01 00 00 0f ac 02 02 00 00 0f ac 04 00 0f ac 02 01 00 00 0f ac 02 00 00 7f 04 00 00 00 02
nl80211: ifindex=6
nl80211: beacon_int=100
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=5):
     6f 63 65 61 6e                                    myssid
  * beacon_int=100
nl80211: hidden SSID not in use
nl80211: privacy=1
nl80211: auth_algs=0x3
nl80211: wpa_version=0x2
nl80211: key_mgmt_suites=0x2
nl80211: pairwise_ciphers=0x18
nl80211: group_cipher=0x8
nl80211: beacon_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: proberesp_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: assocresp_ies - hexdump(len=6): 7f 04 00 00 00 02
WPA: Start group state machine to set initial keys
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
Get randomness: len=16 entropy=0
GTK - hexdump(len=32): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=2 addr=0x4b6434 key_idx=1 set_tx=1 seq_len=0 key_len=32
nl80211: KEY_DATA - hexdump(len=32): [REMOVED]
   broadcast key
nl80211: Set wlan0 operstate 0->1 (UP)
netlink: Operstate: ifindex=6 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
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: interface state COUNTRY_UPDATE->ENABLED
wlan0: AP-ENABLED
wlan0: Setup of interface done.
ctrl_iface not configured!
RTM_NEWLINK: ifi_index=6 ifname=wlan0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: RTM_NEWLINK: ifi_index=6 ifname=wlan0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(wlan0)
........................................   CONNECTING .............................
nl80211: Event message available
nl80211: Drv Event 19 (NL80211_CMD_NEW_STATION) received for wlan0
nl80211: New station e4:42:a6:e8:ac:bf
nl80211: Assoc Req IEs - hexdump(len=111): 00 05 6f 63 65 61 6e 01 08 02 04 0b 16 0c 12 18 24 32 04 30 48 60 6c 21 02 00 16 24 1c 01 01 02 01 03 01 04 01 05 01 06 01 07 01 08 01 09 01 0a 01 0b 01 0c 01 0d 01 0e 01 30 14 01 00 00 0f ac 02 01 00 00 0f ac 04 01 00 00 0f ac 02 80 00 7f 0b 04 00 0a 02 01 40 40 40 00 01 20 3b 11 51 51 53 54 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f
wlan0: Event ASSOC (0) received
wlan0: STA e4:42:a6:e8:ac:bf IEEE 802.11: associated
STA included RSN IE in (Re)AssocReq
  New STA
ap_sta_add: register ap_handle_timer timeout for e4:42:a6:e8:ac:bf (300 seconds - ap_max_inactivity)
nl80211: Set STA flags - ifname=wlan0 addr=e4:42:a6:e8:ac:bf total_flags=0x0 flags_or=0x0 flags_and=0xfffffff1 authorized=0
wlan0: STA e4:42:a6:e8:ac:bf WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=0x2460e50 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=e4:42:a6:e8:ac:bf
nl80211: set_key failed; err=-22 Invalid argument)
IEEE 802.1X: Ignore STA - 802.1X not enabled or forced for WPS
wlan0: STA e4:42:a6:e8:ac:bf WPA: start authentication
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=0x2460e50 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=e4:42:a6:e8:ac:bf
nl80211: set_key failed; err=-22 Invalid argument)
nl80211: Set STA flags - ifname=wlan0 addr=e4:42:a6:e8:ac:bf total_flags=0x0 flags_or=0x0 flags_and=0xfffffffe authorized=0
wlan0: STA e4:42:a6:e8:ac:bf IEEE 802.1X: unauthorizing port
WPA: e4:42:a6:e8:ac:bf WPA_PTK_GROUP entering state IDLE
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state AUTHENTICATION
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state AUTHENTICATION2
WPA: Re-initialize GMK/Counter on first station
random: Cannot read from /dev/random: Resource temporarily unavailable
random: Got 0/6 bytes from /dev/random
random: Only 14/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 to proceed - reject first 4-way handshake
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=32): [REMOVED]
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=2 addr=0x4b6434 key_idx=1 set_tx=1 seq_len=0 key_len=32
nl80211: KEY_DATA - hexdump(len=32): [REMOVED]
   broadcast key
Get randomness: len=32 entropy=0
WPA: Assign ANonce - hexdump(len=32): b7 d4 9d a9 48 72 5c 63 26 93 a9 8f f4 a9 0e d1 bc 3d 28 55 0d 6b 03 3b 6d 43 8c 27 b3 8e c0 0c
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state INITPSK
Searching a PSK for e4:42:a6:e8:ac:bf prev_psk=(nil)
Searching a PSK for e4:42:a6:e8:ac:bf prev_psk=(nil)
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state PTKSTART
wlan0: STA e4:42:a6:e8:ac:bf 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 100 ms (retry counter 1)
hostapd_new_assoc_sta: reschedule ap_handle_timer timeout for e4:42:a6:e8:ac:bf (300 seconds - ap_max_inactivity)
wlan0: Event EAPOL_RX (24) received
IEEE 802.1X: 121 bytes from e4:42:a6:e8:ac:bf
   IEEE 802.1X: version=1 type=3 length=117
WPA: Received EAPOL-Key from e4:42:a6:e8:ac:bf key_info=0x10a type=2 key_data_length=22
WPA: Received Key Nonce - hexdump(len=32): be c4 0a 25 76 14 4b e7 fb e2 f5 09 a4 d3 78 61 01 2f 2c f4 78 5f 74 13 8d da 87 cb 5a 96 24 7b
WPA: Received Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 01
WPA: Reject 4-way handshake to collect more entropy for random number generation
random: Mark internal entropy pool to be ready (count=1/2)
wpa_sta_disconnect STA e4:42:a6:e8:ac:bf
hostapd_wpa_auth_disconnect: WPA authenticator requests disconnect: STA e4:42:a6:e8:ac:bf reason 2
nl80211: sta_remove -> DEL_STATION wlan0 e4:42:a6:e8:ac:bf --> 0 (Success)
wlan0: STA e4:42:a6:e8:ac:bf WPA: event 3 notification
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=0x2460e50 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=e4:42:a6:e8:ac:bf
nl80211: set_key failed; err=-22 Invalid argument)
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state DISCONNECTED
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=0x2460e50 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=e4:42:a6:e8:ac:bf
nl80211: set_key failed; err=-22 Invalid argument)
nl80211: Set STA flags - ifname=wlan0 addr=e4:42:a6:e8:ac:bf total_flags=0x0 flags_or=0x0 flags_and=0xfffffffe authorized=0
wlan0: STA e4:42:a6:e8:ac:bf IEEE 802.1X: unauthorizing port
ap_sta_disconnect: reschedule ap_handle_timer timeout for e4:42:a6:e8:ac:bf (5 seconds - AP_MAX_INACTIVITY_AFTER_DEAUTH)
wlan0: STA e4:42:a6:e8:ac:bf WPA: EAPOL-Key timeout
nl80211: Event message available
nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for wlan0
nl80211: Delete station e4:42:a6:e8:ac:bf
wlan0: Event DISASSOC (1) received
wlan0: STA e4:42:a6:e8:ac:bf IEEE 802.11: disassociated
wlan0: STA e4:42:a6:e8:ac:bf WPA: event 2 notification
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=0x2460e50 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=e4:42:a6:e8:ac:bf
nl80211: set_key failed; err=-22 Invalid argument)
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state DISCONNECTED
WPA: e4:42:a6:e8:ac:bf WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=0x2460e50 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=e4:42:a6:e8:ac:bf
nl80211: set_key failed; err=-22 Invalid argument)
nl80211: Set STA flags - ifname=wlan0 addr=e4:42:a6:e8:ac:bf total_flags=0x0 flags_or=0x0 flags_and=0xfffffffe authorized=0
wlan0: STA e4:42:a6:e8:ac:bf IEEE 802.1X: unauthorizing port
nl80211: sta_remove -> DEL_STATION wlan0 e4:42:a6:e8:ac:bf --> 0 (Success)
ap_free_sta: cancel ap_handle_timer for e4:42:a6:e8:ac:bf

............... LONG TIME PAUSE


random: Got 6/6 bytes from /dev/random
............... AGAIN SOME TIME SPEND HERE
................client connects to previous AP

 

Thank you


0 Kudos
1 Solution
233 Views
mariusoctavian
Contributor III

RESOLVED

-Downloaded hostapd from git
-build & installed
- added /etc/dhcp/dhcp.conf

$hostapd -v
hostapd v2.11-devel-hostap_2_10-1263-g1085e3bdc

cat /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
authoritative;
 
subnet 10.5.5.0 netmask 255.255.255.0 {
 range 10.5.5.100 10.5.5.200;
 option routers 10.5.5.254;
 option domain-name-servers 10.5.5.1, 10.5.5.2;
#option domain-name "mydomain.example";
}

reboot


All good now. can connect and bridged to eth0

View solution in original post

0 Kudos
1 Reply
234 Views
mariusoctavian
Contributor III

RESOLVED

-Downloaded hostapd from git
-build & installed
- added /etc/dhcp/dhcp.conf

$hostapd -v
hostapd v2.11-devel-hostap_2_10-1263-g1085e3bdc

cat /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
authoritative;
 
subnet 10.5.5.0 netmask 255.255.255.0 {
 range 10.5.5.100 10.5.5.200;
 option routers 10.5.5.254;
 option domain-name-servers 10.5.5.1, 10.5.5.2;
#option domain-name "mydomain.example";
}

reboot


All good now. can connect and bridged to eth0

0 Kudos