trying to connect to WiFi on ESP32 using credentials from SD card Am trying to connect to Wi-Fi on an ESP32 using credentials i stored on an sd card, am able to read and parse the credential and printing it to the serial monitor shows that the ssid and password is correct but not connecting to Wi-Fi, when i hardcode the Wi-Fi credentials it works what could i be doing wrong
I use the NVS partition to store NON VOLATILE information.
I use this library: NVS library
You can save like string and restore after reset/off.
Example:
#include &lt;Arduino.h&gt;
#include &quot;ArduinoNvs.h&quot;

void setup() {   
    NVS.begin();
    Serial.begin(115200);
    // write to flash
    String set_SSID = &quot;WIFI_name&quot;; 
    NVS.setString(&quot;nvs_wifi_name&quot;, set_SSID ); //upload 1 time. after comment this line and upload again **
    // read from flash
    String get_SSID = NVS.getString(&quot;nvs_wifi_name&quot;);
    Serial.printf(&quot;Wifi name stored %s\n&quot;, get_SSID);
}


void loop() {}