I am using ESP32
, but I assume the question is applicable to esp8266
or Arduino WIFI. That is why I extended my tags. Please let me know if I am wrong.
I have a working sketch that uses WIFI to send http requests.
My current code includes SSID and password in clear text:
const char *ssid = "my_secure_router";
const char *password = "clear_text_password_is_bad";
void initWifi(){
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.println("");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.println(WiFi.status());
Serial.print("*");
}
Serial.print("WiFi connected with IP: ");
Serial.println(WiFi.localIP());
}
While the code is working, I am not able to push the code to a git repository since it includes the password in clear text.
Is there any easy option to eliminate the clear text password from the above code?