Closed michprev closed 6 years ago
If you are not going to set all values you should wifi_config_t wifi_config = { 0 };
What happens if you reboot does (1582) nvs: nvs_get ap.max.conn 1
change to 4
as @negativekelvin says, the error message:
I (172692) wifi: max stations already connected to ap!
e8:2a:44:6f:60:01, AID = 0
is telling the truth.
You have Wifi AP configured for only 1 connection. and your cellphone is first in line.
Chuck.
No it is definitely weird because "max stations" comes at 34s but SYSTEM_EVENT_AP_STACONNECTED does not come until 47s. Then even after SYSTEM_EVENT_AP_STADISCONNECTED there is no free slot. You should check esp_wifi_ap_get_sta_list().
If you are not going to set all values you should wifi_config_t wifi_config = { 0 };
Whoops, I did not post the whole code.
wifi_config_t wifi_config;
wifi_config.ap.authmode = WIFI_AUTH_WPA_WPA2_PSK;
wifi_config.ap.beacon_interval = 100;
wifi_config.ap.channel = 7;
wifi_config.ap.max_connection = 4;
std::strcpy((char *) wifi_config.ap.password, CONFIG_FLYHERO_WIFI_WPA2_PASSPHRASE);
std::strcpy((char *) wifi_config.ap.ssid, CONFIG_FLYHERO_WIFI_SSID);
wifi_config.ap.ssid_hidden = !CONFIG_FLYHERO_WIFI_SSID_VISIBLE;
wifi_config.ap.ssid_len = 0;
You should check esp_wifi_ap_get_sta_list()
I have modified the app to print num of stations every 500 ms. WIth the same app I managed to connect with my phone and tablet without a problem (num of stations 2
).
I (2556) wifi: mode : softAP (30:ae:a4:0a:c2:4d)
D (2560) event: SYSTEM_EVENT_AP_START
V (2560) event: enter default callback
V (2562) tcpip_adapter: check: local, if=1 fn=0x40137ff0
0x40137ff0: tcpip_adapter_start_api at /home/michal/git/esp-idf/components/tcpip_adapter/tcpip_adapter_lwip.c:1082
D (2569) tcpip_adapter: dhcp server start:(ip: 192.168.4.1, mask: 255.255.255.0, gw: 192.168.4.1)
V (2576) tcpip_adapter: call api in lwip: ret=0x0, give sem
V (2582) tcpip_adapter: check: remote, if=1 fn=0x40137ff0
0x40137ff0: tcpip_adapter_start_api at /home/michal/git/esp-idf/components/tcpip_adapter/tcpip_adapter_lwip.c:1082
V (2588) event: exit default callback
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
I (28274) wifi: max stations already connected to ap! <station>e8:2a:44:6f:60:01, AID = 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
num of stations 1
I (37819) wifi: max stations already connected to ap! <station>e8:2a:44:6f:60:01, AID = 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 1
num of stations 1
I (43665) wifi: max stations already connected to ap! <station>e8:2a:44:6f:60:01, AID = 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
num of stations 0
EDIT: The problem does not exist on the same laptop on Win 10. Also erasing ESP flash does not help anymore.
This appeared in my dmesg log after unsuccessfull connection to ESP:
[ 805.521802] wlp3s0: authenticate with 30:ae:a4:0a:c2:4d
[ 805.551588] wlp3s0: send auth to 30:ae:a4:0a:c2:4d (try 1/3)
[ 805.553497] wlp3s0: authenticated
[ 807.004842] wlp3s0: aborting authentication with 30:ae:a4:0a:c2:4d by local choice (Reason: 3=DEAUTH_LEAVING)
I would say that I have problems with my Qualcomm Atheros QCA9377 driver but I don't quite understand why ESP claims that max stations are already connected.
Set your log level to debug
Set your log level to debug
On ESP? I have set it to verbose.
Oh ok sorry. That is weird that num of stations 1
without any events. Something your WiFi driver on Debian is doing that confuses esp32, not sure which has the bug.
Reinstalling Network Manager on my system made this issue appear less often. I strongly believe that the problem is on my system rather than on ESP.
Environment
git rev-parse --short HEAD
to get the commit id.): 22da5f6deProblem Description
I am unable to connect to ESP AP with my laptop with error message
wifi: max stations already connected to ap! <station>e8:2a:44:6f:60:01, AID = 0
(e8:2a:44:6f:60:01 is MAC of my laptop) while Android phone connects without a problem (f4:f5:db:c4:c8:7d MAC of Android phone).First I have been using
Then I changed
wifi_config.ap.max_connection
to 4 but the problem still persisted => resetting the chip did not help. After runningmake erase_flash
and reflashing the app the problem disappeared.Debug Logs