esp_garden git · master
Distributed ESP sensor and actuator system (garden)
C++ 70.7% Markdown 18% C 10.7%git clone https://git.christianimmanuel.de/embedded/esp_garden.gitwget https://git.christianimmanuel.de/embedded/esp_garden/archive/esp_garden.tar.gzFix error logging
client_pump/main/ClientPump.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client_pump/main/ClientPump.cpp b/client_pump/main/ClientPump.cpp index 2f2746a..5b75e93 100644 --- a/client_pump/main/ClientPump.cpp +++ b/client_pump/main/ClientPump.cpp @@ -81,7 +81,7 @@ void init_WiFi() { ESP_ERROR_CHECK(esp_wifi_start()); // Scan and set channel - int32_t channel = get_WiFiChannel(ssid); + int32_t channel = get_WiFiChannel(WIFI_SSID); if (channel > 0) { esp_wifi_set_promiscuous(true); ESP_ERROR_CHECK(esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE)); @@ -108,7 +108,7 @@ void on_DataRecv(const esp_now_recv_info *info, const uint8_t *data, int len) { memcpy(msg, data, len); msg[len] = '\0'; - ESP_LOGI("Received from server: %s", msg); + ESP_LOGI(TAG, "Received from server: %s", msg); if (strncmp(msg, "p:", 2) == 0) { @@ -138,7 +138,7 @@ void on_DataRecv(const esp_now_recv_info *info, const uint8_t *data, int len) { if (!esp_now_is_peer_exist(info->src_addr)) { esp_err_t add_status = esp_now_add_peer(&peer); if (add_status != ESP_OK) { - ESP_LOGI(TAG, "Failed to add peer before sending ACK, err=%d", add_status); + ESP_LOGE(TAG, "Failed to add peer before sending ACK, err=%d", add_status); return; } } @@ -148,7 +148,7 @@ void on_DataRecv(const esp_now_recv_info *info, const uint8_t *data, int len) { if (result == ESP_OK) ESP_LOGI(TAG, "Sent acknowledgment: thanks"); else - ESP_LOGI(TAG, "Failed to send acknowledgment, err=%d", result); + ESP_LOGE(TAG, "Failed to send acknowledgment, err=%d", result); // --- Copy data from message --- // make sure we keep old data before memcpy @@ -176,7 +176,7 @@ void on_DataRecv(const esp_now_recv_info *info, const uint8_t *data, int len) { return; } } else { - ESP_LOGI(TAG, "Failed to parse message"); + ESP_LOGE(TAG, "Failed to parse message"); } } received_starting_message = false; @@ -185,7 +185,7 @@ void on_DataRecv(const esp_now_recv_info *info, const uint8_t *data, int len) { void init_EspNow() { if (esp_now_init() != ESP_OK) { - ESP_LOGI("init_EspNow", "ESP NOW init failed"); + ESP_LOGE("init_EspNow", "ESP NOW init failed"); while (true); } esp_now_register_recv_cb(on_DataRecv);