diff --git a/CHANGELOG.md b/CHANGELOG.md index 990a8951a..7bcc60791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development ## [9.5.0.8] +### Added +- Command ``WebGetConfig `` if ``#define USE_WEBGETCONFIG`` is enabled to restore/init configuration from external webserver (#13034) + ### Fixed - ESP32 crash when PSRAM is absent and ``BOARD_HAS_PSRAM`` set (#13037) - MQTT TLS related connection timing errors (#13033) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index bc67bca02..b09ab4f05 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -105,6 +105,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Command ``SetOption127 1`` to force Wi-Fi in no-sleep mode even if ``Sleep 0`` is not enabled - Command ``SetOption128 0|1`` web referer check disabling HTTP API commands if set to 0. Default set to 1 for backward compatibility [#12828](https://github.com/arendst/Tasmota/issues/12828) - Command ``SetSensor1..127 0|1`` to globally disable individual sensor driver +- Command ``WebGetConfig `` if ``#define USE_WEBGETCONFIG`` is enabled to restore/init configuration from external webserver [#13034](https://github.com/arendst/Tasmota/issues/13034) - Neopool commands ``NPPHRes``, ``NPCLRes`` and ``NPIonRes`` [#12813](https://github.com/arendst/Tasmota/issues/12813) - Support for second DNS server - Support for (Yeelight) Mi Desk Pro using binary tasmota32solo1.bin diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index b3d60d277..c0802790d 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -461,6 +461,7 @@ // #define USE_JAVASCRIPT_ES6 // Enable ECMAScript6 syntax using less JavaScript code bytes (fails on IE11) #define USE_ENHANCED_GUI_WIFI_SCAN // Enable Wi-Fi scan output with BSSID (+0k5 code) // #define USE_WEBSEND_RESPONSE // Enable command WebSend response message (+1k code) +// #define USE_WEBGETCONFIG // Enable restoring config from external webserver (+0k6) #define USE_EMULATION_HUE // Enable Hue Bridge emulation for Alexa (+14k code, +2k mem common) #define USE_EMULATION_WEMO // Enable Belkin WeMo emulation for Alexa (+6k code, +2k mem common) // #define USE_CCLOADER // Enable CCLoader FW upgrade tool (for CC25xx devices) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 9c08bebfb..10ca8a7fb 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -3124,7 +3124,7 @@ int WebGetConfig(char *buffer) RemoveSpace(buffer); // host = |[192.168.178.86:80,admin:joker| String url = ResolveToken(buffer); - DEBUG_CORE_LOG(PSTR("WEB: Config Uri |%s|"), url.c_str()); + DEBUG_CORE_LOG(PSTR("WEB: Config Uri '%s'"), url.c_str()); WiFiClient http_client; HTTPClient http; @@ -3137,7 +3137,7 @@ int WebGetConfig(char *buffer) int len = http.getSize(); if ((len <= sizeof(TSettings)) && SettingsBufferAlloc()) { uint8_t *buff = settings_buffer; - if (len==-1) len = sizeof(TSettings); + if (len == -1) { len = sizeof(TSettings); } while (http.connected() && (len > 0)) { size_t size = stream->available(); if (size) { @@ -3177,7 +3177,6 @@ int WebGetConfig(char *buffer) } #endif // USE_WEBGETCONFIG - bool JsonWebColor(const char* dataBuf) { // Default (Dark theme) @@ -3337,6 +3336,8 @@ void CmndWebSend(void) #ifdef USE_WEBGETCONFIG void CmndWebGetConfig(void) { + // WebGetConfig http://myserver:8000/tasmota/conf/%id%.dmp where %id% is expanded to device mac address + // WebGetConfig http://myserver:8000/tasmota/conf/Config_demo_9.5.0.8.dmp if (XdrvMailbox.data_len > 0) { uint32_t result = WebGetConfig(XdrvMailbox.data); char stemp1[20];