From: BuildTools Date: Mon, 8 May 2017 11:07:36 +0000 (+0100) Subject: Require a password to enable OTA mode X-Git-Url: http://stoneship.org.uk/projects/git/?p=doorlock_v1.git;a=commitdiff_plain;h=742bcec915c870289eb04430d9d2ae6c613e216a Require a password to enable OTA mode --- diff --git a/door_wiegand.ino b/door_wiegand.ino index b2ae15f..ee8b2e0 100644 --- a/door_wiegand.ino +++ b/door_wiegand.ino @@ -90,10 +90,13 @@ unsigned long ntp_lasttry = 0; bool ota_enabled = false; - +/* User requests to enable OTA mode */ void enable_ota(void) { if (!ota_enabled) { + if (!server.authenticate(www_username, www_password)) + return server.requestAuthentication(); + Serial.println("Enabling OTA Mode."); ArduinoOTA.begin(); ota_enabled = true;