forked from xiaozhi/xiaozhi-esp32
OTA checkversion增加了一些log, 便于三方开发调试自己的OTA接口 (#568)
* feat(ota): add logging for missing sections in Ota::CheckVersion Add detailed logging to inform when specific sections (activation, mqtt, websocket, server_time, firmware) are not found during the OTA version check. This improves debugging and visibility into the OTA process. * 恢复提示词 --------- Co-authored-by: loadingxv <loadingvx@gmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ dependencies:
|
||||
78/xiaozhi-fonts: "~1.3.2"
|
||||
espressif/led_strip: "^2.4.1"
|
||||
espressif/esp_codec_dev: "~1.3.2"
|
||||
espressif/esp-sr: "^2.0.5"
|
||||
espressif/esp-sr: "==2.0.3"
|
||||
espressif/button: "^3.3.1"
|
||||
espressif/knob: "^1.0.0"
|
||||
espressif/esp_lcd_touch_ft5x06: "~1.0.6"
|
||||
|
||||
13
main/ota.cc
13
main/ota.cc
@@ -107,6 +107,8 @@ bool Ota::CheckVersion() {
|
||||
return false;
|
||||
}
|
||||
|
||||
ESP_LOGI(TAG, "OTA request success: %s", check_version_url_.c_str());
|
||||
|
||||
has_activation_code_ = false;
|
||||
has_activation_challenge_ = false;
|
||||
cJSON *activation = cJSON_GetObjectItem(root, "activation");
|
||||
@@ -129,6 +131,8 @@ bool Ota::CheckVersion() {
|
||||
if (timeout_ms != NULL) {
|
||||
activation_timeout_ms_ = timeout_ms->valueint;
|
||||
}
|
||||
} else {
|
||||
ESP_LOGW(TAG, "No activation code found !");
|
||||
}
|
||||
|
||||
has_mqtt_config_ = false;
|
||||
@@ -144,6 +148,8 @@ bool Ota::CheckVersion() {
|
||||
}
|
||||
}
|
||||
has_mqtt_config_ = true;
|
||||
} else {
|
||||
ESP_LOGW(TAG, "No mqtt section found !");
|
||||
}
|
||||
|
||||
has_websocket_config_ = false;
|
||||
@@ -159,6 +165,8 @@ bool Ota::CheckVersion() {
|
||||
}
|
||||
}
|
||||
has_websocket_config_ = true;
|
||||
} else {
|
||||
ESP_LOGW(TAG, "No websocket section found!");
|
||||
}
|
||||
|
||||
has_server_time_ = false;
|
||||
@@ -182,6 +190,8 @@ bool Ota::CheckVersion() {
|
||||
settimeofday(&tv, NULL);
|
||||
has_server_time_ = true;
|
||||
}
|
||||
} else {
|
||||
ESP_LOGW(TAG, "No server_time section found!");
|
||||
}
|
||||
|
||||
has_new_version_ = false;
|
||||
@@ -210,7 +220,10 @@ bool Ota::CheckVersion() {
|
||||
has_new_version_ = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ESP_LOGW(TAG, "No firmware section found!");
|
||||
}
|
||||
|
||||
cJSON_Delete(root);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user