Qrome - Added the option to specify a password for OTA

pull/18/head
Chrome Legion 2018-06-07 16:29:32 -07:00
parent 0597e57e43
commit 35d7f9b96f
2 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,7 @@ const boolean INVERT_DISPLAY = false; // true = pins at top | false = pins at th
//#define DISPLAY_SH1106 // Uncomment this line to use the SH1106 display -- SSD1306 is used by default and is most common //#define DISPLAY_SH1106 // Uncomment this line to use the SH1106 display -- SSD1306 is used by default and is most common
boolean ENABLE_OTA = true; // this will allow you to load firmware to the device over WiFi (see OTA for ESP8266) boolean ENABLE_OTA = true; // this will allow you to load firmware to the device over WiFi (see OTA for ESP8266)
String OTA_Password = ""; // Set an OTA password here -- leave blank if you don't want to be prompted for password
//****************************** //******************************
// End Settings // End Settings
//****************************** //******************************

View File

@ -229,6 +229,9 @@ void setup() {
else if (error == OTA_END_ERROR) Serial.println("End Failed"); else if (error == OTA_END_ERROR) Serial.println("End Failed");
}); });
ArduinoOTA.setHostname((const char *)hostname.c_str()); ArduinoOTA.setHostname((const char *)hostname.c_str());
if (OTA_Password != "") {
ArduinoOTA.setPassword(((const char *)OTA_Password.c_str()));
}
ArduinoOTA.begin(); ArduinoOTA.begin();
} }