OTA improvements
This commit is contained in:
		
							parent
							
								
									12ad60a0a8
								
							
						
					
					
						commit
						b8e7b4bf48
					
				| @ -118,6 +118,10 @@ int do_ota_update() { | ||||
|   // Fetch the latest firmware version
 | ||||
|   ESP_LOGI(TAG, "Checking latest firmware version on server"); | ||||
|   display(2, "**", "checking version"); | ||||
| 
 | ||||
|   if (WiFi.status() != WL_CONNECTED) | ||||
|     return 1; | ||||
| 
 | ||||
|   const String latest = bintray.getLatestVersion(); | ||||
| 
 | ||||
|   if (latest.length() == 0) { | ||||
| @ -133,6 +137,8 @@ int do_ota_update() { | ||||
|   display(2, "OK", latest.c_str()); | ||||
| 
 | ||||
|   display(3, "**", ""); | ||||
|   if (WiFi.status() != WL_CONNECTED) | ||||
|     return 1; | ||||
|   String firmwarePath = bintray.getBinaryPath(latest); | ||||
|   if (!firmwarePath.endsWith(".bin")) { | ||||
|     ESP_LOGI(TAG, "Unsupported binary format"); | ||||
|  | ||||
| @ -8,8 +8,6 @@ static const char TAG[] = "main"; | ||||
| // helper function
 | ||||
| void do_reset() { | ||||
|   ESP_LOGI(TAG, "Remote command: restart device"); | ||||
|   if (irqHandlerTask != NULL) | ||||
|     vTaskDelete(irqHandlerTask); | ||||
|   LMIC_shutdown(); | ||||
|   vTaskDelay(3000 / portTICK_PERIOD_MS); | ||||
|   esp_restart(); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user