3

I have managed to turn my Raspberry Pi into an access point following these instructions:

Access point as WiFi router/repeater with additional WiFi-dongle

However, everything connects to the access point except my android devices (A Samsung Galaxy Note 8 and a Samsung Galaxy S5).

A similar problem is presented in this question:

Android cannot connect to Pi's wlan

However, the answer given there does not apply to me since I have the file /etc/systemd/network/08-wlan0.network exactly as in the first link. (hence with DHCP server activated):

[Match]
Name=wlan0
[Network]
Address=192.168.4.1/24
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 1.1.1.1

How can I fix it?

Further information:

Problem Description

Both my devices can see the network. The Galaxy Note 8 keeps trying to connect, when I insert the password it says "Connecting..." under the SSID for approximately 3 seconds stops showing the message for 2 seconds and then keeps trying to connect. Almost the same with the Galaxy S5 with the difference that it also writes "Obtaining IP address" before stopping and then keeps retrying.

Check on DHCP (as apparently is a known issue, see the second link)

Journalctl does not seem to show DHCP requests, hence I have extended the log as described here:

https://superuser.com/questions/1187633/how-to-debug-systemd-networkd

Launching journalctl -b -u systemd-networkd, I have tried to reconnect several times with my android devices From 12:16 on, however, I see only two DHCP server requests.

Jan 11 12:14:28 raspberrypi systemd-networkd[855]: Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/network1/link/_33 interface=org.freedesktop.DBus.Properties member=PropertiesCh
Jan 11 12:16:04 raspberrypi systemd-networkd[855]: DHCP SERVER: REQUEST (rebinding/renewing) (0x4f98fb1a)
Jan 11 12:16:04 raspberrypi systemd-networkd[855]: DHCP SERVER: ACK (0x4f98fb1a)
Jan 11 12:17:39 raspberrypi systemd-networkd[855]: DHCP SERVER: REQUEST (rebinding/renewing) (0x26d7c444)
Jan 11 12:17:39 raspberrypi systemd-networkd[855]: DHCP SERVER: ACK (0x26d7c444)

Check on wpa_supplicant@wlan0.service

I get

root@raspberrypi:~ # journalctl -b -u wpa_supplicant@wlan0.service 
-- Logs begin at Sat 2020-01-11 10:03:13 CST, end at Sat 2020-01-11 12:28:44 CST. --
Jan 11 10:03:16 raspberrypi systemd[1]: Started WPA supplicant daemon (interface-specific version).
Jan 11 10:03:17 raspberrypi wpa_supplicant[352]: Successfully initialized wpa_supplicant
Jan 11 10:03:17 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
Jan 11 10:03:21 raspberrypi wpa_supplicant[352]: wlan0: Could not connect to kernel driver
Jan 11 10:03:21 raspberrypi wpa_supplicant[352]: Using interface wlan0 with hwaddr **DeviceMac** and ssid "**Device_SSID**"
Jan 11 10:03:21 raspberrypi wpa_supplicant[352]: wlan0: interface state UNINITIALIZED->ENABLED
Jan 11 10:03:21 raspberrypi wpa_supplicant[352]: wlan0: AP-ENABLED
Jan 11 10:03:21 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-CONNECTED - Connection to **DeviceMac** completed [id=0 id_str=]
Jan 11 10:04:47 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 10:04:47 raspberrypi wpa_supplicant[352]: wlan0: AP-STA-CONNECTED **MAC_OF_PC1**
Jan 11 10:05:12 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 10:05:12 raspberrypi wpa_supplicant[352]: wlan0: AP-STA-CONNECTED **MAC_OF_PC2**
Jan 11 10:05:19 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Jan 11 10:05:19 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
Jan 11 10:06:06 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 10:06:14 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 10:06:21 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 11:04:32 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Jan 11 11:04:33 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=US
Jan 11 11:13:47 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 11:13:55 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:16:25 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:16:32 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:16:32 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:16:48 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:16:55 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:17:03 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:17:15 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:18:17 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:18:25 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:18:33 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:18:41 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:18:49 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:18:57 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:19:05 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:19:13 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:20:15 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:20:23 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:20:31 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:28:22 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:28:29 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:28:37 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 11 12:28:44 raspberrypi wpa_supplicant[352]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0

At least I see the connection attempts at their right times as CTRL-EVENT-SUBNET-STATUS-UPDATE status=0.

I have also tried to submit a wrong password, in this case I get:

Jan 11 12:37:12 raspberrypi wpa_supplicant[352]: wlan0: AP-STA-POSSIBLE-PSK-MISMATCH **PhoneAddress**
Jan 11 12:37:13 raspberrypi wpa_supplicant[352]: wlan0: AP-STA-POSSIBLE-PSK-MISMATCH **PhoneAddress**
Jan 11 12:37:14 raspberrypi wpa_supplicant[352]: wlan0: AP-STA-POSSIBLE-PSK-MISMATCH **PhoneAddress**
Jan 11 12:37:15 raspberrypi wpa_supplicant[352]: wlan0: AP-STA-POSSIBLE-PSK-MISMATCH **PhoneAddress**

Ipv6?

I found out that in order to download updates faster it was convenient to switch off RasPi Ipv6. Could this interfere? I had this doubt since when I connected to the network from a Windows machine I found out in the WiFi properties that there is a Link-local IPv6 address. Since it is often claimed that Link-local is what is not supported in android, it might be that the Ipv6 settings are necessary for android to connect to a wifi network. But how to switch on IPv6 and set DHCP inside systemd-networkd?

However from this:

https://stackoverflow.com/questions/37978595/what-triggers-assigning-ipv6-link-local-address-in-android

I deduce that android devices are capable of getting a link-local Ipv6 address.

Another similar question

Access Point not working for Android phones

But the answers do not make sense to me.

I have tried to change /etc/systemd/network/08-wlan0.network to

[Match]
Name=wlan0
[Network]
Address=10.10.11.1/24
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 1.1.1.1

then from ifconfig on my laptop I get:

wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.10.11.72  netmask 255.255.255.0  broadcast 10.10.11.255
        inet6 fe80::aeee:ee4:1a78:6517  prefixlen 64  scopeid 0x20<link>
        ether **MACADDRESS**  txqueuelen 1000  (Ethernet)
        RX packets 15397  bytes 8998330 (8.9 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9034  bytes 2177688 (2.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And still can not connect from mobile. I also changed it to Address=192.168.0.0/24 and I couldn't connect this time also from the pcs, however from journalctl -b -u wpa_supplicant@wlan0.service I got a different error from the pcs and the from the android devices (and the error given to the android devices is the same old one).

Jan 12 09:33:43 raspberrypi wpa_supplicant[359]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 12 09:33:47 raspberrypi wpa_supplicant[359]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 12 09:33:51 raspberrypi wpa_supplicant[359]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 12 09:34:07 raspberrypi wpa_supplicant[359]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 12 09:34:11 raspberrypi wpa_supplicant[359]: wlan0: AP-STA-DISCONNECTED f8:54:b8:85:45:01
Jan 12 09:34:16 raspberrypi wpa_supplicant[359]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 12 09:34:25 raspberrypi wpa_supplicant[359]: wlan0: AP-STA-DISCONNECTED 60:14:b3:6d:a0:af
Jan 12 09:34:26 raspberrypi wpa_supplicant[359]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Jan 12 09:34:26 raspberrypi wpa_supplicant[359]: wlan0: AP-STA-CONNECTED 60:14:b3:6d:a0:af
Jan 12 09:35:11 raspberrypi wpa_supplicant[359]: wlan0: AP-STA-DISCONNECTED 60:14:b3:6d:a0:af

Debugging from Android

Thanks to adb shell I was able to launch dumpsys wifi on my galaxy S5, and I got

Working connection

01-12 14:16:22.185 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=33 state=6 BSSID=00:00:00:00:00:00 SSID=**PhoneNetwork**]
01-12 14:16:22.185 - Event [IFNAME=wlan0 Associated with **PhoneHotspotMAC**]
01-12 14:16:22.211 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=33 state=7 BSSID=**PhoneHotspotMAC** SSID=**PhoneNetwork**]
01-12 14:16:22.211 - Event [IFNAME=wlan0 WPA: RX message 1 of 4-Way Handshake from 6E.3F.F0 (ver=2)]
01-12 14:16:22.212 - Event [IFNAME=wlan0 WPA: Sending EAPOL-Key 2/4]
01-12 14:16:22.231 - Event [IFNAME=wlan0 WPA: RX message 3 of 4-Way Handshake from 6E.3F.F0 (ver=2)]
01-12 14:16:22.233 - Event [IFNAME=wlan0 WPA: Sending EAPOL-Key 4/4]
01-12 14:16:22.234 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=33 state=8 BSSID=**PhoneHotspotMAC** SSID=**PhoneNetwork**]
01-12 14:16:22.235 - Event [IFNAME=wlan0 WPA: Key negotiation completed with **PhoneHotspotMAC** [PTK=CCMP GTK=CCMP]]
01-12 14:16:22.235 - Event [IFNAME=wlan0 CTRL-EVENT-CONNECTED - Connection to **PhoneHotspotMAC** completed [id=33 id_str=]]
01-12 14:16:22.236 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=33 state=9 BSSID=**PhoneHotspotMAC** SSID=**PhoneNetwork**]
01-12 14:16:22.242 - wlan0: 4486:IFNAME=wlan0 GET FREQUENCY -> 2457
01-12 14:16:22.242 - wlan0: 4487:IFNAME=wlan0 SET_NETWORK 33 verified_password 1 -> true
01-12 14:16:22.251 - wlan0: 4488:IFNAME=wlan0 SAVE_CONFIG -> true
01-12 14:16:22.255 - wlan0: 4489:IFNAME=wlan0 SET pno 0 -> true
01-12 14:16:22.277 - wlan0: 4490:IFNAME=wlan0 PKTCNT_POLL -> TXGOOD=26571
TXBAD=508
RXGOOD=753
01-12 14:16:22.360 - wlan0: 4491:IFNAME=wlan0 DRIVER BTCOEXMODE 1 -> true
01-12 14:16:22.365 - wlan0: 4492:IFNAME=wlan0 DRIVER SETSUSPENDMODE 0 -> true
01-12 14:16:22.366 - wlan0: 4493:IFNAME=wlan0 SET ps 0 -> true
01-12 14:16:22.383 - wlan0: 4494:IFNAME=wlan0 LIST_NETWORKS -> network id / ssid / bssid / flags

Not working connection

01-12 14:16:59.083 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=32 state=6 BSSID=00:00:00:00:00:00 SSID=**RasPiNetwork**]
01-12 14:16:59.084 - Event [IFNAME=wlan0 Associated with **RasPiMAC**]
01-12 14:16:59.084 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=32 state=7 BSSID=**RasPiMAC** SSID=**RasPiNetwork**]
01-12 14:16:59.085 - Event [IFNAME=wlan0 WPA: RX message 1 of 4-Way Handshake from DC.FF.96 (ver=2)]
01-12 14:16:59.086 - Event [IFNAME=wlan0 WPA: Sending EAPOL-Key 2/4]
01-12 14:16:59.093 - Event [IFNAME=wlan0 WPA: RX message 3 of 4-Way Handshake from DC.FF.96 (ver=2)]
01-12 14:16:59.095 - Event [IFNAME=wlan0 WPA: Sending EAPOL-Key 4/4]
01-12 14:16:59.095 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=32 state=8 BSSID=**RasPiMAC** SSID=**RasPiNetwork**]
01-12 14:17:03.112 - Event [IFNAME=wlan0 CTRL-EVENT-BIGDATA-DISCONNECT 2 36 1 2 dc:a6:32 2462 20 -40 72 2 0 x x 0 -92 0 0]
01-12 14:17:03.112 - Event [IFNAME=wlan0 CTRL-EVENT-DISCONNECTED bssid=**RasPiMAC** reason=2]
01-12 14:17:03.113 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=32 state=0 BSSID=**RasPiMAC** SSID=**RasPiNetwork**]
01-12 14:17:03.212 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=-1 state=3 BSSID=00:00:00:00:00:00 SSID=]
01-12 14:17:03.219 - Event [IFNAME=wlan0 CTRL-EVENT-SCAN-STARTED ]
01-12 14:17:05.402 - wlan0: 4581:IFNAME=wlan0 SET pno 0 -> true
01-12 14:17:05.404 - wlan0: 4582:IFNAME=wlan0 SCAN -> false
01-12 14:17:06.984 - wlan0: 4583:IFNAME=wlan0 SET pno 0 -> true
01-12 14:17:06.985 - wlan0: 4584:IFNAME=wlan0 SCAN -> false
01-12 14:17:07.024 - Event [IFNAME=wlan0 CTRL-EVENT-SCAN-RESULTS ]
01-12 14:17:07.024 - Event [IFNAME=wlan0 WPS-AP-AVAILABLE ]
01-12 14:17:07.043 - Event [IFNAME=wlan0 Trying to associate with **RasPiMAC** (SSID='**RasPiNetwork**' freq=2462 MHz level=-38) ]
01-12 14:17:07.046 - Event [IFNAME=wlan0 CTRL-EVENT-STATE-CHANGE id=32 state=5 BSSID=00:00:00:00:00:00 SSID=**RasPiNetwork**]
01-12 14:17:07.077 - wlan0: 4585:IFNAME=wlan0 LIST_NETWORKS -> network id / ssid / bssid / flags

Apparently (reason = 2) (https://www.cisco.com/assets/sol/sb/WAP371_Emulators/WAP371_Emulator_v1-0-1-5/help/Apx_ReasonCodes2.html) stands for "Previous authentication no longer valid".

Possible Path to a solution

From here

https://community.ui.com/questions/Android-devices-always-disconnecting-on-AP-AC-Pro/8512e697-1720-43b0-b0ee-591686b7f458?page=1

I got that "So somehow, having Multicast / Broadcast on my network kicks my Android devices". I don't even know how to check if my hotspot has those or can avoid those.

Here this multicast issue is vaguely addressed:

https://stackoverflow.com/questions/13221736/android-device-not-receiving-multicast-package

In particular the comment "This page has a wealth of information about which IP to use as per your needs. " reminds me of a similar comment in an answer at the link under the section "another similar question" however the link does not seem to help.

Launching systemd-resolve --status I get

Link 4 (wlan0)
      Current Scopes: none
DefaultRoute setting: no
       LLMNR setting: no
MulticastDNS setting: no
  DNSOverTLS setting: no
      DNSSEC setting: allow-downgrade
    DNSSEC supported: yes

However, I still can not connect from my smartphones.

Final Attempt

I have tried to do the whole process again, burning the image on an SD card and so on. Without the net forwarding but only with the access point with systemd... I confirm that android devices can not connect to it. It is incredible that it looks like I am the only one worried about this problem!

For the joy of a commenter

For the joy of a commenter I am posting the result of the following command

pi@raspberrypi:~ $ sudo iw wlan0

The result is incredibly long and I personally doubt that it works with systemd-networkd. Here it is: https://pastebin.com/h6r46mB8

Serious debugging

After launching sudo /sbin/wpa_supplicant -d -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -Dnl80211,wext -iwlan0 I got

https://pastebin.com/nBkm3SNx

  • Comments are not for extended discussion; this conversation has been moved to chat. – goldilocks Jan 13 at 20:17
  • What Raspberry Pi version do you use? Is it a RPi 4B? – Ingo Jan 19 at 23:47
1
+50

I have tested the setup with a Huawai smartphone Android version 4.0.3 and a FAIRPHONE Android version 9. Both phones connected without any problems so it is difficult for me to debug an error that isn't present. Here are some ideas:

From your tests the problem seems to be WiFi asoziation, the step before getting an ip address. So you should focus on wpa_supplicant. The first test could be to explecitely define the encryption method. This was in the past WPA but nowadays improved to WPA2 or also named RSN. But WPA is sometimes still used. Check with both settings. In /etc/wpa_supplicant/wpa_supplicant-wlan0.conf add the option proto=RSN WPA (will first use RSN then WPA) and both single settings. Have also an attention to your correct country= setting so it looks similar to this:

rpi ~$ sudo cat /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=nn

network={
    ssid="RPiNet"
    mode=2
    key_mgmt=WPA-PSK
    proto=RSN WPA
    # proto=RSN
    # proto=WPA
    psk="verySecretPassword"
    frequency=2412
}

If this doesn't help then use a very simple stand alone access point with latest configuration updates to reduce side effects. Setup it as shown in Setting up a Raspberry Pi as an access point - the easy way in section ♦ Setting up a stand alone access point.

After a fresh flashed Raspbian Buster image and update/full-upgrade you should first do sudo apt install tcpdump. Maybe you will look at the traffic on the interfaces. Later you don't have an internet connection for installations. After setup you should add option DNSSEC=no to /etc/systemd/resolved.conf and reboot to disable DNS record signing. There is a known bug as shown in Sporadic "DNSSEC validation failed" — "no-signature" #12388.

Now try connecting your Android phones. If it fails then start wpa_supplicant in foreground debug mode and inspect its output.

rpi ~$ sudo systemctl stop wpa_supplicant@wlan0.service
rpi ~$ sudo /sbin/wpa_supplicant -d -c/etc/wpa_supplicant/wpa_supplicant-wlan0.conf -Dnl80211,wext -iwlan0

If wpa_supplicant has started with a bunch of detailed low level messages, then try to connect a phone. Take time for inspecting the verbose output from the connection attempt, look for failing messages and it lines before.

UPDATE with comparing the debug output from wpa_supplicant:
I have reactivated my old SAMSUNG GALAXY S II with Android 4.1.2. It also connects without any problems. Here are the part of your wpa_supplicant debug output where it differs from mine:

hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=1 ack=1 install=1 pairwise=1 kde_len=28 keyidx=0 encr=0)
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 02
WPA: EAPOL-Key MIC using HMAC-SHA1
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 1)
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - EAPOL-Key timeout
WPA: 6c:c7:ec:4c:3f:f0 WPA_PTK entering state PTKINITNEGOTIATING
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=1 ack=1 install=1 pairwise=1 kde_len=28 keyidx=0 encr=0)
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 03
WPA: EAPOL-Key MIC using HMAC-SHA1
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 2)
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - EAPOL-Key timeout
WPA: 6c:c7:ec:4c:3f:f0 WPA_PTK entering state PTKINITNEGOTIATING
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=1 ack=1 install=1 pairwise=1 kde_len=28 keyidx=0 encr=0)
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 04
WPA: EAPOL-Key MIC using HMAC-SHA1
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 3)
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - EAPOL-Key timeout
WPA: 6c:c7:ec:4c:3f:f0 WPA_PTK entering state PTKINITNEGOTIATING
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=1 ack=1 install=1 pairwise=1 kde_len=28 keyidx=0 encr=0)
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 05
WPA: EAPOL-Key MIC using HMAC-SHA1
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 4)
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - EAPOL-Key timeout
WPA: 6c:c7:ec:4c:3f:f0 WPA_PTK entering state PTKINITNEGOTIATING
hostapd_logger: STA 6c:c7:ec:4c:3f:f0 - PTKINITNEGOTIATING: Retry limit 4 reached
WPA: 6c:c7:ec:4c:3f:f0 WPA_PTK entering state DISCONNECT

But from my GALAXY S II it should look like this:

hostapd_logger: STA 98:0c:82:ba:7a:aa - sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=1 ack=1 install=1 pairwise=1 kde_len=28 keyidx=0 encr=0)
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 02
WPA: EAPOL-Key MIC using HMAC-SHA1
WPA: Use EAPOL-Key timeout of 1000 ms (retry counter 1)
l2_packet_receive: src=98:0c:82:ba:7a:aa len=99
wlan0: RX EAPOL from 98:0c:82:ba:7a:aa
IEEE 802.1X: 99 bytes from 98:0c:82:ba:7a:aa
   IEEE 802.1X: version=1 type=3 length=95
WPA: Received EAPOL-Key from 98:0c:82:ba:7a:aa key_info=0x10a type=254 mic_len=16 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
hostapd_logger: STA 98:0c:82:ba:7a:aa - received EAPOL-Key frame (4/4 Pairwise)
WPA: EAPOL-Key MIC using HMAC-SHA1
WPA: 98:0c:82:ba:7a:aa WPA_PTK entering state PTKINITDONE

Until step 3 of the 4-Way Handshake there is no difference but then receiving an EAPOL-Key timed out on your RasPi. It retried 4 times and then entered state DISCONNECT, never reaching state PTKINITDONE. Timeout is set to 1000 ms. I have looked at /usr/share/doc/wpa_supplicant/examples/wpa_supplicant.conf and asked google if there is a way to increase this timeout without success. All what I have found was that this could be a driver problem so an idea was to use the older wext driver but this doesn't support AP mode (mode=2). I don't really belief it's a hardware or firmware problem. I guess it is an issue with an app or driver that you only run on your android devices. Have a look at it.

|improve this answer|||||
  • Thank you! I have modified wpa_supplicant as you suggested and I copied the log. Do you think that it might be a Samsung issue? bugzilla.redhat.com/show_bug.cgi?id=1647184 – ThePunisher Jan 21 at 4:36
  • 1
    @ThePunisher Don't know. I have an old Samsung Galaxy II. I will test with it, just a moment please ... – Ingo Jan 21 at 9:22
  • 1
    @ThePunisher I have updated the question for some time. – Ingo Feb 3 at 9:02
1

I ended up here with the same issue.

After some Googling + trial and error, was able to resolve the issue by upgrading wpa supplicant to v2.9 by building it manually using the follow config (source https://bugzilla.redhat.com/show_bug.cgi?id=1647184#c2):

CONFIG_TLS=internal
CONFIG_INTERNAL_LIBTOMMATH=y
CONFIG_INTERNAL_LIBTOMMATH_FAST=y

CONFIG_IEEE8021X_EAPOL=y

CONFIG_ERP=y
CONFIG_EAP_MD5=y
CONFIG_MSCHAPV2=y
CONFIG_EAP_TLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PSK=y
CONFIG_EAP_PAX=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_SIM=y
CONFIG_EAP_AKA=y
CONFIG_EAP_AKA_PRIME=y
CONFIG_EAP_VENDOR_TEST=y
CONFIG_EAP_TLV=y
CONFIG_EAP_SAKE=y
CONFIG_EAP_GPSK=y
CONFIG_EAP_GPSK_SHA256=y
CONFIG_EAP_EKE=y
CONFIG_EAP_TNC=y
CFLAGS += -DTNC_CONFIG_FILE=\"tnc/tnc_config\"
LIBS += -rdynamic
CONFIG_EAP_FAST=y
CONFIG_EAP_IKEV2=y

CONFIG_IPV6=y
CONFIG_DRIVER_NONE=y
CONFIG_PKCS12=y
CONFIG_CTRL_IFACE=unix

CONFIG_WPA_CLI_EDIT=y

CONFIG_OCSP=y

#CONFIG_ELOOP_POLL=y

CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO=y

CONFIG_IEEE80211W=y
CONFIG_IEEE80211R=y
CONFIG_IEEE80211N=y
CONFIG_IEEE80211AC=y

CONFIG_DEBUG_FILE=y

CONFIG_WPS=y
#CONFIG_WPS_STRICT=y
CONFIG_WPS_UPNP=y
CONFIG_WPS_NFC=y
CONFIG_WPS_ER=y
#CONFIG_WPS_REG_DISABLE_OPEN=y

CONFIG_DRIVER_WEXT=y

CONFIG_DRIVER_NL80211=y
CFLAGS += -I/usr/include/libnl3
CONFIG_LIBNL32=y

CONFIG_IBSS_RSN=y

CONFIG_AP=y
#CONFIG_MESH=y
CONFIG_P2P=y
CONFIG_WIFI_DISPLAY=y

CONFIG_ACS=y

CONFIG_BGSCAN_SIMPLE=y
CONFIG_BGSCAN_LEARN=y

#CONFIG_WPA_TRACE=y
#CONFIG_WPA_TRACE_BFD=y

CONFIG_TDLS=y
#CONFIG_TDLS_TESTING=y
CONFIG_NO_RANDOM_POOL=y

CONFIG_TLSV11=y
CONFIG_TLSV12=y

#CONFIG_HT_OVERRIDES=y
#CONFIG_VHT_OVERRIDES=y

#CONFIG_DEBUG_LINUX_TRACING=y

CONFIG_INTERWORKING=y
CONFIG_HS20=y

CONFIG_AUTOSCAN_EXPONENTIAL=y
CONFIG_AUTOSCAN_PERIODIC=y

CONFIG_EXT_PASSWORD_TEST=y

CONFIG_EAP_UNAUTH_TLS=y

#CONFIG_SAE=y
#CFLAGS += -DALL_DH_GROUPS

CONFIG_WNM=y

CONFIG_FST=y
#CONFIG_FST_TEST=y

#CONFIG_TESTING_OPTIONS=y
#CONFIG_MODULE_TESTS=y

CONFIG_SUITEB=y

CONFIG_MBO=y

#CONFIG_CODE_COVERAGE=y
CFLAGS += -O0 -Wsign-compare
#CONFIG_FILS=y
#CONFIG_FILS_SK_PFS=y
CONFIG_PMKSA_CACHE_EXTERNAL=y
#CONFIG_OWE=y
#CONFIG_DPP=y

CONFIG_DEBUG_SYSLOG=y
|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.