# HG changeset patch # User Michiel Broek # Date 1621349543 -7200 # Node ID 24cb415af7873a2bb61107d644b21d4edd3a7a42 # Parent bac0a860f5dd9f5574f4be9f32f7390bc34c5ff7 Version 0.3.13. Recipe import parse BMS_COOLING_TO to set the cooling temperature. diff -r bac0a860f5dd -r 24cb415af787 CMakeLists.txt --- a/CMakeLists.txt Mon May 17 22:38:43 2021 +0200 +++ b/CMakeLists.txt Tue May 18 16:52:23 2021 +0200 @@ -2,7 +2,7 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(PROJECT_VER "0.3.12") +set(PROJECT_VER "0.3.13") set(PROJECT_NAME "brewboard") include($ENV{IDF_PATH}/tools/cmake/project.cmake) diff -r bac0a860f5dd -r 24cb415af787 image/version.txt --- a/image/version.txt Mon May 17 22:38:43 2021 +0200 +++ b/image/version.txt Tue May 18 16:52:23 2021 +0200 @@ -1,1 +1,1 @@ -0.3.12f +0.3.13 diff -r bac0a860f5dd -r 24cb415af787 main/brewboard.c --- a/main/brewboard.c Mon May 17 22:38:43 2021 +0200 +++ b/main/brewboard.c Tue May 18 16:52:23 2021 +0200 @@ -85,9 +85,17 @@ // Just to debug, list the /spiffs filesystem. #if 0 DIR *dir = opendir("/spiffs"); + struct stat st; + char strftime_buf[64], filename[280]; struct dirent* de = readdir(dir); while (de) { - printf("%s\n", de->d_name); + snprintf(filename, 279, "/spiffs/%s", de->d_name); + if (stat(filename, &st) == 0) { + strftime(strftime_buf, sizeof(strftime_buf), "%a, %d %b %Y %T %z", localtime(&(st.st_mtime))); + printf("%5ld %s %s\n", st.st_size, strftime_buf, filename); + } else { + printf("%d %s\n", stat(filename, &st), de->d_name); + } de = readdir(dir); } closedir(dir); diff -r bac0a860f5dd -r 24cb415af787 main/recipes.c --- a/main/recipes.c Mon May 17 22:38:43 2021 +0200 +++ b/main/recipes.c Tue May 18 16:52:23 2021 +0200 @@ -150,6 +150,8 @@ strncat(recipe.Name, char_data_buffer, 127); } else if ((_xml_depth == 3) && (strcmp("BOIL_TIME", _xml_element[2]) == 0)) { recipe.BoilTime = atoi(char_data_buffer); + } else if ((_xml_depth == 3) && (strcmp("BMS_COOLING_TO", _xml_element[2]) == 0)) { + recipe.CoolTemp = atoi(char_data_buffer); } else if ((_xml_depth == 5) && (strcmp("HOPS", _xml_element[2]) == 0) && (strcmp("HOP", _xml_element[3]) == 0)) { /* * Hops that are added during the boil. @@ -333,6 +335,7 @@ int done; _xml_depth = 0; _xml_tun_temp = 0.0; + recipe.CoolTemp = 20.0; XML_SetElementHandler(parser, startElement, endElement); XML_SetCharacterDataHandler(parser, char_data); @@ -363,7 +366,6 @@ break; } } - recipe.CoolTemp = 20.0; #if 0 printf("Recipe: %s\n", recipe.Name); diff -r bac0a860f5dd -r 24cb415af787 main/task_http.c --- a/main/task_http.c Mon May 17 22:38:43 2021 +0200 +++ b/main/task_http.c Tue May 18 16:52:23 2021 +0200 @@ -192,6 +192,7 @@ * If we have a If-Modified-Since parameter, compare that with the current * filedate on disk. If It's the same send a 304 response. * Cannot work on /spiffs. + * Update 18-05-2021 it seems better on idf 4.2.1 but still not correct. */ #if 0 time_t Now; @@ -202,7 +203,7 @@ strftime(strftime_buf, sizeof(strftime_buf), "%a, %d %b %Y %T %z", &timeInfo); sprintf(header, "HTTP/1.1 304 Not Modified\r\nDate: %s\r\n\r\n", strftime_buf); netconn_write(conn, header, strlen(header), NETCONN_NOCOPY); - ESP_LOGI(TAG, "http_sendfile %s Not Modified, ok", temp_url); + ESP_LOGI(TAG, "%s sendfile %s Not Modified, ok", ipstr, temp_url); return; } #endif