166 ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); |
165 ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); |
167 http_cleanup(client); |
166 http_cleanup(client); |
168 goto updateerr; |
167 goto updateerr; |
169 } |
168 } |
170 ESP_LOGI(TAG, "Continue upgrade application"); |
169 ESP_LOGI(TAG, "Continue upgrade application"); |
|
170 screen_updating("Begin download", "New version"); |
171 } else { |
171 } else { |
172 ESP_LOGE(TAG, "Received package is not fit len"); |
172 ESP_LOGE(TAG, "Received package is not fit len"); |
173 http_cleanup(client); |
173 http_cleanup(client); |
174 goto updateerr; |
174 goto updateerr; |
175 } |
175 } |
195 } |
195 } |
196 if (esp_ota_end(update_handle) != ESP_OK) { |
196 if (esp_ota_end(update_handle) != ESP_OK) { |
197 ESP_LOGE(TAG, "esp_ota_end failed!"); |
197 ESP_LOGE(TAG, "esp_ota_end failed!"); |
198 goto updateerr; |
198 goto updateerr; |
199 } |
199 } |
200 snprintf(temp, 63, "Ok %d bytes", binary_file_length); |
|
201 screen_updating("Begin download", temp); |
|
202 |
200 |
203 /* |
201 /* |
204 * Here we have new version, install and boot it. |
202 * Here we have new version, install and boot it. |
205 */ |
203 */ |
206 err = esp_ota_set_boot_partition(update_partition); |
204 err = esp_ota_set_boot_partition(update_partition); |