diff --git a/printermonitor/Settings.h b/printermonitor/Settings.h index bd4fdb8..0cc3525 100644 --- a/printermonitor/Settings.h +++ b/printermonitor/Settings.h @@ -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 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 //****************************** diff --git a/printermonitor/printermonitor.ino b/printermonitor/printermonitor.ino index 05df0d5..3945f17 100644 --- a/printermonitor/printermonitor.ino +++ b/printermonitor/printermonitor.ino @@ -229,6 +229,9 @@ void setup() { else if (error == OTA_END_ERROR) Serial.println("End Failed"); }); ArduinoOTA.setHostname((const char *)hostname.c_str()); + if (OTA_Password != "") { + ArduinoOTA.setPassword(((const char *)OTA_Password.c_str())); + } ArduinoOTA.begin(); }