Procházet zdrojové kódy

Improve log message when web UI is incomplete (#1716)

* improve warning if version.txt is missing

* typo

* show round duration in log

Co-authored-by: CaCO3 <caco@ruinelli.ch>
CaCO3 před 3 roky
rodič
revize
014dc88112

+ 1 - 2
code/components/jomjol_fileserver_ota/server_file.cpp

@@ -920,8 +920,7 @@ std::string unzip_new(std::string _in_zip_file, std::string _target_zip, std::st
 
     // Get and print information about each file in the archive.
     int numberoffiles = (int)mz_zip_reader_get_num_files(&zip_archive);
-    ESP_LOGI(TAG, "Numbers of files to be extrated: %d", numberoffiles);
-
+    ESP_LOGI(TAG, "Numbers of files to be extracted: %d", numberoffiles);
 
     sort_iter = 0;
     {

+ 3 - 1
code/components/jomjol_tfliteclass/server_tflite.cpp

@@ -818,6 +818,7 @@ void task_autodoFlow(void *pvParameter)
     {
         LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, "----------------------------------------------------------------"); // Clear separation between runs
         std::string _zw = "Round #" + std::to_string(++countRounds) + " started";
+        time_t roundStartTime = getUpTime();
         LogFile.WriteToFile(ESP_LOG_INFO, TAG, _zw); 
         fr_start = esp_timer_get_time();
 
@@ -848,7 +849,8 @@ void task_autodoFlow(void *pvParameter)
         string zwtemp = "CPU Temperature: " + stream.str();
         LogFile.WriteToFile(ESP_LOG_DEBUG, TAG, zwtemp); 
 
-        LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Round #" + std::to_string(countRounds) + " completed");
+        LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Round #" + std::to_string(countRounds) + 
+                " completed (" + std::to_string(getUpTime() - roundStartTime) + " seconds)");
 
         fr_delta_ms = (esp_timer_get_time() - fr_start) / 1000;
         if (auto_intervall > fr_delta_ms)

+ 1 - 0
code/main/main.cpp

@@ -223,6 +223,7 @@ extern "C" void app_main(void)
 
     if (getHTMLcommit().substr(0, 7) != std::string(GIT_REV).substr(0, 7)) { // Compare the first 7 characters of both hashes
         LogFile.WriteToFile(ESP_LOG_WARN, TAG, std::string("Web UI version (") + getHTMLcommit() + ") does not match firmware version (" + std::string(GIT_REV) + ") !");
+        LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Please make sure to setup the SD-Card properly (check the wiki) or re-install using the update_*.zip!");    
     }
 
     std::string zw = getCurrentTimeString("%Y%m%d-%H%M%S");