First commit

This commit is contained in:
Snorky 2025-01-09 19:30:41 +01:00
parent 8e2631b2d1
commit 0b2ffdf4b7
2 changed files with 6 additions and 8 deletions

View File

@ -29,7 +29,7 @@ static void event_handler(void* arg, esp_event_base_t event_base,
if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
esp_wifi_connect(); esp_wifi_connect();
} else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY) { if (s_retry_num < CONFIG_ESP_MAXIMUM_RETRY) {
esp_wifi_connect(); esp_wifi_connect();
s_retry_num++; s_retry_num++;
ESP_LOGI(TAG, "retry to connect to the AP"); ESP_LOGI(TAG, "retry to connect to the AP");
@ -72,8 +72,8 @@ void wifi_init_sta(void)
wifi_config_t wifi_config = { wifi_config_t wifi_config = {
.sta = { .sta = {
.ssid = EXAMPLE_ESP_WIFI_SSID, .ssid = CONFIG_ESP_WIFI_SSID,
.password = EXAMPLE_ESP_WIFI_PASS, .password = CONFIG_ESP_WIFI_PASS,
/* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (password len => 8). /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (password len => 8).
* If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value * If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value
* to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to * to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to

View File

@ -1,11 +1,9 @@
#include "esp_event.h" #include "esp_event.h"
#define EXAMPLE_ESP_WIFI_SSID "Freebox_nomap" #define CONFIG_ESP_WIFI_SSID "YourSSID"
#define EXAMPLE_ESP_WIFI_PASS "anthedoniconfutarissuggestu2insignans" #define CONFIG_ESP_WIFI_PASS "YourPASSWORD"
/* #define EXAMPLE_ESP_WIFI_SSID "TheGame" #define CONFIG_ESP_MAXIMUM_RETRY 3
#define EXAMPLE_ESP_WIFI_PASS "totototoQ" */
#define EXAMPLE_ESP_MAXIMUM_RETRY 3
#if CONFIG_ESP_WPA3_SAE_PWE_HUNT_AND_PECK #if CONFIG_ESP_WPA3_SAE_PWE_HUNT_AND_PECK
#define ESP_WIFI_SAE_MODE WPA3_SAE_PWE_HUNT_AND_PECK #define ESP_WIFI_SAE_MODE WPA3_SAE_PWE_HUNT_AND_PECK