gitbls/autoAP

endless loop when ssid correct but psk not

Opened this issue · 3 comments

ukena commented

I have the following issue when using autoAP: If the wifi ssid is correct but the passwort not it will run in an endless loop with the following logs:

Feb 06 14:08:06 user systemd[1]: Started WPA supplicant daemon (interface-specific version).
Feb 06 14:08:06 user root[308]: autoAP: Waiting for wpa_supplicant to come online
Feb 06 14:08:07 user wpa_supplicant[452]: Successfully initialized wpa_supplicant
Feb 06 14:08:07 user root[308]: autoAP: Waiting for wpa_supplicant to come online
Feb 06 14:08:08 user root[308]: autoAP: Waiting for wpa_supplicant to come online
Feb 06 14:08:09 user root[308]: autoAP: wpa_supplicant online, starting wpa_cli to monitor wpa_supplicant messages
Feb 06 14:08:11 user wpa_supplicant[452]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE
Feb 06 14:08:12 user wpa_supplicant[452]: wlan0: Trying to associate with SSID 'FRITZ!Box 7590 TN'
Feb 06 14:08:17 user wpa_supplicant[452]: wlan0: Associated with 2c:91:ab:43:c2:d7
Feb 06 14:08:17 user wpa_supplicant[452]: wlan0: CTRL-EVENT-CONNECTED - Connection to 2c:91:ab:43:c2:d7 completed [id=0 id_str=]
Feb 06 14:08:17 user wpa_supplicant[452]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Feb 06 14:08:17 user root[537]: autoAP wlan0 state CONNECTED
Feb 06 14:08:18 user wpa_supplicant[452]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=DE
Feb 06 14:08:18 user root[537]: autoAP: CONNECTED in station mode, configuring client
Feb 06 14:08:21 user wpa_supplicant[452]: wlan0: CTRL-EVENT-DISCONNECTED bssid=2c:91:ab:43:c2:d7 reason=2
Feb 06 14:08:21 user wpa_supplicant[452]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 06 14:08:21 user wpa_supplicant[452]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE
Feb 06 14:08:21 user wpa_supplicant[452]: wlan0: Trying to associate with SSID 'FRITZ!Box 7590 TN'
Feb 06 14:08:21 user root[554]: autoAP wlan0 state DISCONNECTED
Feb 06 14:08:21 user root[554]: autoAP: Client disconnected, configuring as AP
Feb 06 14:08:21 user root[554]: autoAP: Configuring wlan0 as an Access Point
Feb 06 14:08:23 user root[564]: /usr/local/bin/autoAP-local: Access Point
Feb 06 14:08:27 user wpa_supplicant[452]: wlan0: Associated with dc:39:6f:a7:98:f1
Feb 06 14:08:27 user wpa_supplicant[452]: wlan0: CTRL-EVENT-CONNECTED - Connection to dc:39:6f:a7:98:f1 completed [id=0 id_str=]
Feb 06 14:08:27 user wpa_supplicant[452]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Feb 06 14:08:27 user root[593]: autoAP wlan0 state CONNECTED
Feb 06 14:08:27 user root[593]: autoAP: CONNECTED in station mode, configuring client
Feb 06 14:08:27 user root[593]: autoAP: Configuring wlan0 as a Wireless Client
Feb 06 14:08:28 user wpa_supplicant[452]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=COUNTRY_IE type=COUNTRY alpha2=DE
Feb 06 14:08:29 user root[604]: /usr/local/bin/autoAP-local: Client
Feb 06 14:08:31 user wpa_supplicant[452]: wlan0: CTRL-EVENT-DISCONNECTED bssid=dc:39:6f:a7:98:f1 reason=2
Feb 06 14:08:31 user wpa_supplicant[452]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
Feb 06 14:08:31 user wpa_supplicant[452]: wlan0: CTRL-EVENT-REGDOM-CHANGE init=USER type=COUNTRY alpha2=DE
Feb 06 14:08:31 user wpa_supplicant[452]: wlan0: Trying to associate with SSID 'FRITZ!Box 7590 TN'
Feb 06 14:08:31 user root[607]: autoAP wlan0 state DISCONNECTED
Feb 06 14:08:31 user root[607]: autoAP: Client disconnected, configuring as AP
Feb 06 14:08:31 user root[607]: autoAP: Configuring wlan0 as an Access Point
Feb 06 14:08:33 user root[639]: /usr/local/bin/autoAP-local: Access Point
Feb 06 14:08:37 user wpa_supplicant[452]: wlan0: Associated with 2c:91:ab:43:c2:d7
Feb 06 14:08:37 user wpa_supplicant[452]: wlan0: CTRL-EVENT-CONNECTED - Connection to 2c:91:ab:43:c2:d7 completed [id=0 id_str=]
Feb 06 14:08:37 user wpa_supplicant[452]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0

Those messages continues and the access point won't come alive.
I tried to investigate on why it behave like this but I couldn't figure it out. Do you have any ideas?

Interesting. Presumably it works correctly if you supply a correct SSID and password?

I'll have a look at this to see if it can be improved, but won't be able to get to it for a while.

ukena commented

Yes exactly. And when providing a wrong ssid it also works as intended (going in access point). Only if the password is wrong but the ssid is in range. I assume it tries to associate with the wifi which somehow triggers autoAP to think it is connected but then no connection can be established which will trigger the access point mode. And this over and over again.
Thank you and if you need anymore logs or stuff, I am glad to help.

ukena commented

I still try to find the cause for this behavior. When running while true; do wpa_cli -i wlan0 status && echo "" && sleep 1; done it shows the following:

wpa_state=ASSOCIATING
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

wpa_state=ASSOCIATING
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

bssid=dc:39:6f:a7:98:f1
freq=2462
ssid=FRITZ!Box 7590 TN
id=1
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.16.1
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

bssid=dc:39:6f:a7:98:f1
freq=2462
ssid=FRITZ!Box 7590 TN
id=1
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.16.1
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

bssid=dc:39:6f:a7:98:f1
freq=2462
ssid=FRITZ!Box 7590 TN
id=1
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.16.1
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

wpa_state=ASSOCIATING
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

wpa_state=ASSOCIATING
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

wpa_state=ASSOCIATING
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

bssid=dc:39:6f:a7:98:f1
freq=2462
ssid=FRITZ!Box 7590 TN
id=1
mode=station
pairwise_cipher=CCMP
group_cipher=TKIP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.16.1
p2p_device_address=ba:27:eb:09:12:99
address=b8:27:eb:09:12:99
uuid=5aa1fcdd-6cff-544b-bc42-f46449c40ac1

I don't understand why the wpa_state is COMPLETED since the password is wrong and no internet connection can be established. I tested a few other things which didn't solved it. Just wanted to share those logs and I will continue to look into this issue but I doubt that I will be able to solve it.