better error reporting for co2

master
Ondřej Hruška 3 years ago
parent 531d6b51f1
commit 5416debc98
  1. 4
      main/co2_sensor.c

@ -36,6 +36,10 @@ static int mb_write_and_read(uint8_t *buffer, int num, size_t resplen) {
num = uart_read_bytes(CO2_UART_NUM, buffer, resplen, pdMS_TO_TICKS(500)); num = uart_read_bytes(CO2_UART_NUM, buffer, resplen, pdMS_TO_TICKS(500));
ESP_LOGD(TAG, "Received %d bytes", num); ESP_LOGD(TAG, "Received %d bytes", num);
ESP_LOG_BUFFER_HEXDUMP(TAG, buffer, num, ESP_LOG_DEBUG); ESP_LOG_BUFFER_HEXDUMP(TAG, buffer, num, ESP_LOG_DEBUG);
if (num == 0) {
ESP_LOGE(TAG, "No modbus response!");
}
return num; return num;
} }

Loading…
Cancel
Save