Samsung Android phone don't want to connect to Fedora AP

This looks like a weird problem to me, and I’m not sure if the Samsung or Fedora side is to blame. I’m slightly more suspicious of the Fedora side, why I’m trying to ask here.

For a long time I’ve used a Fedora machine as our residential WiFi acess point using hostapd, currently at 2.9-2.fc31. For some time, one Samsung Galaxy A3 phone is refusing to connect to the Fedora AP. Other units do connect fine, and this phone connects fine to other networks. It is the particular combination of phone and Fedora AP that fails.

There has been some occasional problems recently with other units connecting to this network. It doesn’t happen at all as often. Still, that fact is why I suspect the Fedora side slightly more.

In the journal, I can see how the phone does get a connection, but no DHCP requests shows up. If I use wireshark on the interface, that tells the same story.

dec 21 20:28:13 mimmi hostapd[1264475]: wlo1: STA 14:1f:78:3e:76:5c IEEE 802.11: authenticated
dec 21 20:28:13 mimmi hostapd[1264475]: wlo1: STA 14:1f:78:3e:76:5c IEEE 802.11: associated (aid 1)
dec 21 20:28:14 mimmi hostapd[1264475]: wlo1: STA 14:1f:78:3e:76:5c RADIUS: starting accounting session 85A19B90D0B2649C
dec 21 20:28:14 mimmi kernel: rtlwifi: -----hwsec_cam_bitmap: 0x0 entry_idx=4
dec 21 20:28:14 mimmi hostapd[1264475]: wlo1: STA 14:1f:78:3e:76:5c WPA: pairwise key handshake completed (RSN)

20:18:51.985558 EAPOL key (3) v2, len 95
20:18:52.008084 EAPOL key (3) v1, len 117
20:18:52.008308 EAPOL key (3) v2, len 151
20:18:52.017658 EAPOL key (3) v1, len 95
20:18:52.017890 14:1f:78:3e:76:5c (oui Unknown) > Broadcast Null Unnumbered, xid, Flags [Response], length 6: 01 00

When other units connect, the sequence is the same, but it is immediately followed by a DHCPDISCOVER package. Nothing like that shows up here.

I took a look in the log from the phone using adb logcat. There it does say it sends a DHCP discover request.

12-21 12:06:47.901 2722 2732 I art : Background sticky concurrent mark sweep GC freed 157395(9MB) AllocSpace objects, 11(412KB) LOS objects, 17% free, 48MB/58MB, paused 4.970ms total 123.671ms
12-21 12:06:47.991 2722 2881 D wifi : onLinkStatsResults: radio_stat.on_time = 46382
12-21 12:06:47.991 2722 2881 D wifi : onLinkStatsResults: radio_stat.tx_time = 857
12-21 12:06:47.991 2722 2881 D wifi : onLinkStatsResults: radio_stat.rx_time = 1010
12-21 12:06:47.992 2722 2881 D wifi : android_net_wifi_getLinkLayerStats: radio_stat.on_time = 46382
12-21 12:06:47.992 2722 2881 D wifi : android_net_wifi_getLinkLayerStats: radio_stat.tx_time = 857
12-21 12:06:47.992 2722 2881 D wifi : android_net_wifi_getLinkLayerStats: radio_stat.rx_time = 1010
12-21 12:06:47.992 2722 2877 D WifiP2pService: InactiveState{ what=143375 }
12-21 12:06:47.993 2722 2948 E WifiWatchdogStateMachine: Unhandled message { when=-1ms what=131307 obj=start target=com.android.internal.util.StateMachine$SmHandler } in state NotConnectedState
12-21 12:06:47.993 2722 2877 D WifiP2pService: P2pEnabledState{ what=143375 }
12-21 12:06:48.001 2722 11099 D DhcpClient: Broadcasting DHCPDISCOVER
12-21 12:06:48.005 2722 11099 D SamsungAlarmManager: setExact Listener (T:2/F:9/AC:false) 20191221T120650 - CU:1000/CP:2722

The problem may have started when I did some hardware upgrades of the Fedora server, among other things I replaced the WiFi card. The current one reports like this in lspci

05:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188EE Wireless Network Adapter (rev 01)

At first I was a bit suspicious about the “rtlwifi” message from the kernel in the journal. But it shows up also when other units connects successfully, and some googling made me think it is a red herring.

Does anyone have an idea what the problem could be, and/or how to debug it further?

Maybe it’s due to AP wifi settings.

You could check on dd-wrt or openwrt forums. There were certain parameter settings which could cause some clients to fail to connect… unfortunately I don’t remember which.

Also, make sure it’s not something basic like the AP being in N/AC only mode when the client is G, for example.

In my debugging I have experimented with different hw_mode settings in hostapd.conf to see if it made any difference, but it didn’t. Now I’m back to G, which was what I used before the problems started.

I’ll have a look at the forums you suggest, and see if I can get any further. Thanks for the pointer!