From f953deaec3a3a16196ddbf36ddc187ed3290d948 Mon Sep 17 00:00:00 2001 From: Mateusz Date: Fri, 25 Sep 2026 16:46:30 +0200 Subject: [PATCH] humidity and pressure --- thermo_sensor/main/thermo_sensor.c | 8 +++++--- thermo_sensor/main/ygg_http_req.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/thermo_sensor/main/thermo_sensor.c b/thermo_sensor/main/thermo_sensor.c index 1968504..3de6729 100644 --- a/thermo_sensor/main/thermo_sensor.c +++ b/thermo_sensor/main/thermo_sensor.c @@ -41,9 +41,11 @@ void sensor_task(void *pvParameters) { ygg_bmp280_read_sensor(&dev_bmp_280); // Najpierw OLED, potem (blokujący) HTTP — żeby ekran // odświeżył się nawet gdy serwer nie odpowiada. - char buf[32]; - snprintf(buf, sizeof(buf), "Temp: %.2f C", - CURR_READOUT.temperature); + char buf[256]; + snprintf(buf, sizeof(buf), "Temp: %.2f C\nHumid: %.2f %%\nPress: %.2f hPa", + CURR_READOUT.temperature, + CURR_READOUT.humidity, + CURR_READOUT.pressure / 100.); ygg_set_display_label(sh_display, label, buf); ygg_send_sensor_readouts(BASE_URL, SENSOR_NAME, diff --git a/thermo_sensor/main/ygg_http_req.c b/thermo_sensor/main/ygg_http_req.c index 65832d3..fe0fb11 100644 --- a/thermo_sensor/main/ygg_http_req.c +++ b/thermo_sensor/main/ygg_http_req.c @@ -21,6 +21,7 @@ char* ygg_send_get(const char *url) { esp_http_client_config_t config = { .url = url, + .timeout_ms = 3000, }; esp_http_client_handle_t client = esp_http_client_init(&config); esp_err_t err = esp_http_client_open(client, 0); @@ -61,6 +62,7 @@ char* ygg_send_post(const char *url, char *post_data) { esp_http_client_config_t config = { .url = url, + .timeout_ms = 3000, }; esp_http_client_handle_t client = esp_http_client_init(&config);