Hello Sir,
I am using ESP32 WROOM Chip. I have configured ESP32 as AP and Station mode same time.
As I configured ESP32 as both modes, For AP mode SSID I have given as "SSID1" and for Station Mode, I have given SSID as "AnandRaman"
I am able to connect the ESP32 station to my home router SSID which is "AnandRaman" and I can get the IP address and the internet
when I am selecting the SSID from my mobile wifi list, I am getting error like I (62922) wifi:max connection, deauth!
s_wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
esp_netif_create_default_wifi_sta();
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
esp_event_handler_instance_t instance_any_id;
esp_event_handler_instance_t instance_got_ip;
ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,ESP_EVENT_ANY_ID,&event_handler,NULL,&instance_any_id));
ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,IP_EVENT_STA_GOT_IP,&event_handler,NULL,&instance_got_ip));
ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,ESP_EVENT_ANY_ID,&wifi_event_handler,NULL,NULL));
wifi_config_t wifi_config1 = {
.ap = {
.ssid = EXAMPLE_ESP_WIFI_AP_SSID,
.password = EXAMPLE_ESP_WIFI_AP_PASS,
},
};
wifi_config_t wifi_config2 = {
.sta = {
.ssid = EXAMPLE_ESP_WIFI_SSID,
.password = EXAMPLE_ESP_WIFI_PASS,
},
};
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_APSTA));
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_AP, &wifi_config1));
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config2));
ESP_ERROR_CHECK(esp_wifi_start());
Can we connect ESP32 with AP mode and Staton Mode same time ??
error: wifi:max connection, deauth
Please find the attachment. Thanks
Not able to connect SSID at Mobile WiFi List for MODE_APSTA [ error: wifi:max connection, deauth ]
Not able to connect SSID at Mobile WiFi List for MODE_APSTA [ error: wifi:max connection, deauth ]
- Attachments
-
- esp32.jpeg (30.18 KiB) Viewed 4060 times
Last edited by Kunjan on Fri Feb 04, 2022 8:42 am, edited 2 times in total.
Re: Showing Wrong SSID and not able to connect at Mobile WiFi List for MODE_APSTA
is it possible to connect ESP32 Chip with AP Mode and Station mode simultaneously using ESP-IDF? If yes then can you guide me how?
Re: Not able to connect SSID at Mobile WiFi List for MODE_APSTA [ error: wifi:max connection, deauth ]
Hi,
You need to set max_connection field in wifi_ap_config_t:
You need to set max_connection field in wifi_ap_config_t:
Code: Select all
wifi_config_t wifi_config1 = {
.ap = {
.ssid = EXAMPLE_ESP_WIFI_AP_SSID,
.password = EXAMPLE_ESP_WIFI_AP_PASS,
.max_connection = 5 // If not set the default value is 0, is why you cannot connect
},
};
Who is online
Users browsing this forum: No registered users and 48 guests