mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 13:46:36 +00:00
Add OTA_PASSWORD
This commit is contained in:
parent
d73d6b19d5
commit
3751608c0e
@ -34,8 +34,8 @@ bool otaUpdateCheck()
|
|||||||
HTTPClient updateClient;
|
HTTPClient updateClient;
|
||||||
Log.notice(TAG_OTA, F("UPDATE: Checking update URL: %s"), otaUrl.c_str());
|
Log.notice(TAG_OTA, F("UPDATE: Checking update URL: %s"), otaUrl.c_str());
|
||||||
|
|
||||||
// wifiUpdateClientSecure.setInsecure();
|
// wifiUpdateClientSecure.setInsecure();
|
||||||
// wifiUpdateClientSecure.setBufferSizes(512, 512);
|
// wifiUpdateClientSecure.setBufferSizes(512, 512);
|
||||||
updateClient.begin(wifiUpdateClientSecure, otaUrl.c_str());
|
updateClient.begin(wifiUpdateClientSecure, otaUrl.c_str());
|
||||||
|
|
||||||
int httpCode = updateClient.GET(); // start connection and send HTTP header
|
int httpCode = updateClient.GET(); // start connection and send HTTP header
|
||||||
@ -49,7 +49,7 @@ bool otaUpdateCheck()
|
|||||||
updateClient.end();
|
updateClient.end();
|
||||||
|
|
||||||
if(jsonError) { // Couldn't parse the returned JSON, so bail
|
if(jsonError) { // Couldn't parse the returned JSON, so bail
|
||||||
Log.error(TAG_OTA, F("JSON parsing failed: %s"), jsonError.c_str());
|
dispatch_json_error(TAG_OTA, jsonError);
|
||||||
// mqttClient.publish(mqttStateJSONTopic,
|
// mqttClient.publish(mqttStateJSONTopic,
|
||||||
// String(F("{\"event\":\"jsonError\",\"event_source\":\"updateCheck()\",\"event_description\":"
|
// String(F("{\"event\":\"jsonError\",\"event_source\":\"updateCheck()\",\"event_description\":"
|
||||||
// "\"Failed to parse incoming JSON command with error\"")) +
|
// "\"Failed to parse incoming JSON command with error\"")) +
|
||||||
@ -159,6 +159,10 @@ void otaSetup(void)
|
|||||||
#endif
|
#endif
|
||||||
ArduinoOTA.setRebootOnSuccess(false); // We do that ourselves
|
ArduinoOTA.setRebootOnSuccess(false); // We do that ourselves
|
||||||
|
|
||||||
|
#ifdef OTA_PASSWORD
|
||||||
|
ArduinoOTA.setPassword(OTA_PASSWORD);
|
||||||
|
#endif
|
||||||
|
|
||||||
ArduinoOTA.begin();
|
ArduinoOTA.begin();
|
||||||
Log.trace(TAG_OTA, F("Over the Air firmware update ready"));
|
Log.trace(TAG_OTA, F("Over the Air firmware update ready"));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
/* MIT License - Copyright (c) 2020 Francis Van Roie
|
||||||
For full license information read the LICENSE file in the project folder */
|
For full license information read the LICENSE file in the project folder */
|
||||||
|
|
||||||
/***************************************************
|
/***************************************************
|
||||||
// This file contains the default settings that are
|
// This file contains the default settings that are
|
||||||
// burned into the compiled firmware.
|
// burned into the compiled firmware.
|
||||||
//
|
//
|
||||||
@ -39,6 +39,7 @@
|
|||||||
#define OTA_SERVER ""
|
#define OTA_SERVER ""
|
||||||
#define OTA_PORT 80
|
#define OTA_PORT 80
|
||||||
#define OTA_URL ""
|
#define OTA_URL ""
|
||||||
|
#define OTA_PASSWORD ""
|
||||||
|
|
||||||
/***************************************************
|
/***************************************************
|
||||||
* Syslog Settings
|
* Syslog Settings
|
||||||
|
Loading…
x
Reference in New Issue
Block a user