mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-18 05:42:16 +01:00
Add more Logging to esp_restart (#179)
This commit is contained in:
parent
0072a0f5c8
commit
e4fcfdca83
@ -56,6 +56,8 @@ static void realloc_json_buffer(size_t len)
|
||||
|
||||
if (new_sockbuf == NULL) {
|
||||
fprintf(stderr, "Error: realloc failed in recalloc_sock()\n");
|
||||
ESP_LOGI(TAG, "Restarting System because of ERROR: realloc failed in recalloc_sock");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
@ -79,7 +81,10 @@ char * STRATUM_V1_receive_jsonrpc_line(int sockfd)
|
||||
memset(recv_buffer, 0, BUFFER_SIZE);
|
||||
nbytes = recv(sockfd, recv_buffer, BUFFER_SIZE - 1, 0);
|
||||
if (nbytes == -1) {
|
||||
perror("recv");
|
||||
//perror("recv");
|
||||
ESP_LOGE(TAG, "recv");
|
||||
ESP_LOGI(TAG, "Restarting System because of Error: recv");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
|
@ -308,6 +308,8 @@ static esp_err_t PATCH_update_settings(httpd_req_t * req)
|
||||
|
||||
static esp_err_t POST_restart(httpd_req_t * req)
|
||||
{
|
||||
ESP_LOGI(TAG, "Restarting System because of API Request");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
return ESP_OK;
|
||||
}
|
||||
@ -471,8 +473,8 @@ esp_err_t POST_OTA_update(httpd_req_t * req)
|
||||
}
|
||||
|
||||
httpd_resp_sendstr(req, "Firmware update complete, rebooting now!\n");
|
||||
|
||||
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||
ESP_LOGI(TAG, "Restarting System because of Firmware update complete");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
|
||||
return ESP_OK;
|
||||
|
@ -120,6 +120,9 @@ void POWER_MANAGEMENT_task(void * pvParameters)
|
||||
// chip is coming back from a low/no voltage event
|
||||
if (power_management->frequency_value < 50 && target_frequency > 50) {
|
||||
// TODO recover gracefully?
|
||||
ESP_LOGE(TAG, "Freq %f", power_management->frequency_value);
|
||||
ESP_LOGI(TAG, "Restarting System because of ERROR: low/no voltage event");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
|
@ -82,6 +82,8 @@ void stratum_task(void * pvParameters)
|
||||
GLOBAL_STATE->sock = socket(addr_family, SOCK_STREAM, ip_protocol);
|
||||
if (GLOBAL_STATE->sock < 0) {
|
||||
ESP_LOGE(TAG, "Unable to create socket: errno %d", errno);
|
||||
ESP_LOGI(TAG, "Restarting System because of ERROR: Unable to create socket");
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
esp_restart();
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user