With flash encryption disabled everything works as it should.
However, now that I have flash encryption enabled, my program is no longer able to connect to a wifi network or create an access point.
For example, when trying to create an access point, I only get the message via the console:
E (163) esp_core_dump_flash: No core dump partition found!
E (165) nvs: CONFIG_NVS_ENCRYPTION is enabled, but no partition with subtype nvs_keys
[296][E][WiFiGeneric.cpp:680] wifiLowLevelInit(): esp_wifi_init 4353
[296][E][WiFiAP.cpp:154] softAP(): enable AP first!
My code to connect to a wifi network looks like this:
Code: Select all
IPAddress localIP;
IPAddress localGateway;
IPAddress subnet(255, 255, 0, 0);
bool InitWiFi(String ssid, String pass, String ip, String gateway) {
if (ssid == "") { //Undefined SSID
return false;
}
WiFi.mode(WIFI_STA);
localIP.fromString(ip.c_str());
localGateway.fromString(gateway.c_str());
if (!WiFi.config(localIP, localGateway, subnet)) { //STA Failed to configure
return false;
}
WiFi.begin(ssid.c_str(), pass.c_str());
unsigned long currentMillis = millis();
previousMillis = currentMillis;
while (WiFi.status() != WL_CONNECTED) {
currentMillis = millis();
if (currentMillis - previousMillis >= waitInterval) { //Failed to connect
return false;
}
}
return true;
}
And the code for the access point:
Code: Select all
WiFi.softAP("WifiName", NULL);
Code: Select all
WiFi.mode(WIFI_AP);
WiFi.softAP("WifiName", NULL);
Does anyone have any idea why it stopped working with flash encryption enabled and what I could try to get it working again?