We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65a1809 commit e2c2c2bCopy full SHA for e2c2c2b
examples/wifi/getting_started/station/main/station_example_main.c
@@ -86,6 +86,15 @@ void wifi_init_sta(void)
86
.password = EXAMPLE_ESP_WIFI_PASS
87
},
88
};
89
+
90
+ /* Setting a password implies station will connect to all security modes including WEP/WPA.
91
+ * However these modes are deprecated and not advisable to be used. Incase your Access point
92
+ * doesn't support WPA2, these mode can be enabled by commenting below line */
93
94
+ if (strlen((char *)wifi_config.sta.password)) {
95
+ wifi_config.sta.threshold.authmode = WIFI_AUTH_WPA2_PSK;
96
+ }
97
98
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
99
ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) );
100
ESP_ERROR_CHECK(esp_wifi_start() );
0 commit comments