debut evt group

This commit is contained in:
marc 2025-04-25 00:06:10 +02:00
parent ae2288f039
commit be6c9a1dd1
26 changed files with 705 additions and 674 deletions

View File

@ -104,7 +104,8 @@
"am2302_rmt.h": "c",
"bsp_board_extra.h": "c",
"display.h": "c",
"statemanagement.h": "c"
"statemanagement.h": "c",
"communication.h": "c"
},
"idf.pythonInstallPath": "/usr/local/bin/python"
}

View File

@ -7,8 +7,10 @@ set(COMPONENTS main)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
if(${IDF_TARGET} STREQUAL "esp32p4")
set(EXTRA_COMPONENT_DIRS
/home/marc/esp-dev-kits/examples/esp32-p4-function-ev-board/examples/common_components
)
endif()
project(rgb_lcd)

View File

@ -1,11 +0,0 @@
idf_component_register(SRCS "communication.c"
INCLUDE_DIRS "include"
REQUIRES mqtt esp32_p4_function_ev_board esp_wifi esp32_p4_function_ev_board stateManagement)
lvgl_port_create_c_image("images/wifi_ok.png" "images/" "ARGB8888" "NONE")
lvgl_port_create_c_image("images/wifi_ko.png" "images/" "ARGB8888" "NONE")
lvgl_port_create_c_image("images/mqtt_ok.png" "images/" "AUTO" "NONE")
lvgl_port_create_c_image("images/mqtt_ko.png" "images/" "ARGB8888" "NONE")
lvgl_port_add_images(${COMPONENT_LIB} "images/")

View File

@ -1,51 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#elif defined(LV_BUILD_TEST)
#include "../lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_MQTT_KO
#define LV_ATTRIBUTE_MQTT_KO
#endif
static const
LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_MQTT_KO
uint8_t mqtt_ko_map[] = {
0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x39,0x39,0x39,0xff,0xaa,0xa9,0xaa,0xff,0xed,0xed,0xed,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,0xf1,0xf1,0xff,0x83,0x83,0x83,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xe8,
0xb5,0xb3,0xb5,0xfd,0xaa,0xaa,0xaa,0xff,0x8d,0x8d,0x8d,0xff,0x3f,0x3d,0x3f,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x27,0x21,0x27,0xff,0xb6,0xb6,0xb6,0xff,0xfa,0xfa,0xfa,0xff,0xf9,0xf9,0xf9,0xff,0xc3,0xc3,0xc3,0xff,0x4d,0x4d,0x4d,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xdd,0xdd,0xdd,0xff,0x9d,0x9c,0x9d,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x6d,0x6d,0x6d,0xff,0xbd,0xbd,0xbd,0xff,0xb5,0xb5,0xb5,0xff,0x5f,0x5f,0x5f,0xff,0x01,0x01,0x01,0xff,0x00,0x00,0x00,0xff,
0xe7,0xe7,0xe7,0xff,0xee,0xee,0xee,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xec,0xec,0xec,0xff,0x81,0x7f,0x81,0xfe,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x23,0x22,0x23,0xff,0x16,0x16,0x16,0xff,0x01,0x01,0x01,0xff,0x17,0x17,0x17,0xff,0x6a,0x68,0x6a,0xff,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x3e,0x3c,0x3e,0xff,0x98,0x97,0x98,0xff,0xd9,0xd8,0xd9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xfc,0xfc,0xff,0xad,0xac,0xad,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x05,0x05,0x05,0xff,0xd2,0xd2,0xd2,0xff,0xf5,0xf4,0xf5,0xff,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x72,0x71,0x72,0xff,0xe2,0xe2,0xe2,0xff,0xc4,0xc4,0xc4,0xff,0x7f,0x7f,0x7f,0xff,0x09,0x09,0x09,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x3b,0x3b,0x3b,0xff,0xf7,0xf7,0xf7,0xff,0xff,0xff,0xff,0xff,
0xe7,0xe7,0xe7,0xff,0xcf,0xce,0xcf,0xfe,0xa9,0xa9,0xa9,0xff,0x4f,0x4f,0x4f,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x10,0x09,0x10,0xff,0x6a,0x6a,0x6a,0xff,0x38,0x38,0x38,0xff,0x00,0x00,0x00,0xff,0x04,0x04,0x04,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xa7,0xa6,0xa7,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf5,0xf5,0xf5,0xff,0x94,0x94,0x94,0xff,0x1e,0x1e,0x1e,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x12,0x12,0x12,0xff,0xc2,0xc2,0xc2,0xff,0x8d,0x8c,0x8d,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xe4,0xe3,0xe4,0xfe,
0xc5,0xc3,0xc5,0xfe,0xd5,0xd5,0xd5,0xff,0xf0,0xef,0xf0,0xff,0xc7,0xc7,0xc7,0xff,0xb6,0xb6,0xb6,0xff,0x5a,0x5a,0x5a,0xff,0x01,0x01,0x01,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xaf,0xae,0xaf,0xff,0xfd,0xfd,0xfd,0xff,0xed,0xec,0xed,0xff,0x20,0x17,0x20,0xfe,0x00,0x00,0x00,0xff,0x92,0x90,0x92,0xfe,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x19,0x19,0x19,0xff,0x66,0x65,0x66,0xff,0x30,0x30,0x30,0xff,0x03,0x03,0x03,0xff,0x02,0x02,0x02,0xff,0x05,0x05,0x05,0xff,0x00,0x00,0x00,0xff,0x69,0x67,0x69,0xff,0xfb,0xfb,0xfb,0xff,0xff,0xff,0xff,0xff,0xa5,0xa4,0xa5,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x02,0x02,0x02,0xff,0x04,0x04,0x04,0xff,0x4a,0x4a,0x4a,0xff,0xa3,0xa2,0xa3,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xcb,0xcb,0xcb,0xff,0xff,0xff,0xff,0xff,0xe7,0xe6,0xe7,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x63,0x63,0x63,0xff,0xe6,0xe6,0xe6,0xff,0xfb,0xfa,0xfb,0xff,0x51,0x50,0x51,0xff,0x00,0x00,0x00,0xff,0x7c,0x7c,0x7c,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x5d,0x5b,0x5d,0xff,0x00,0x00,0x00,0xff,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x16,0x09,0x16,0xfe,0xf3,0xf2,0xf3,0xff,0xff,0xff,0xff,0xff,0xb7,0xb6,0xb7,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xf6,0xf6,0xf6,0xff,0xff,0xff,0xff,0xff,0xa0,0x9f,0xa0,0xff,0x00,0x00,0x00,0xff,
0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xc6,0xc5,0xc6,0xff,0xff,0xff,0xff,0xff,0xda,0xd9,0xda,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xe1,0xe1,0xe1,0xff,0xff,0xff,0xff,0xff,0xbc,0xbb,0xbc,0xfe,0x00,0x00,0x00,0xff,
0x00,0x00,0x00,0xec,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xaa,0xaa,0xaa,0xff,0xff,0xff,0xff,0xff,0xe7,0xe7,0xe7,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0xcb,0xcb,0xcb,0xff,0xff,0xff,0xff,0xff,0xcb,0xcb,0xcb,0xff,0x00,0x00,0x00,0xe0,
};
const lv_image_dsc_t mqtt_ko = {
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.cf = LV_COLOR_FORMAT_ARGB8888,
.header.flags = 0,
.header.w = 15,
.header.h = 15,
.header.stride = 60,
.data_size = sizeof(mqtt_ko_map),
.data = mqtt_ko_map,
};

View File

@ -1,116 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#elif defined(LV_BUILD_TEST)
#include "../lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_MQTT_OK
#define LV_ATTRIBUTE_MQTT_OK
#endif
static const
LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_MQTT_OK
uint8_t mqtt_ok_map[] = {
0x66,0x00,0x66,0xe0,0xc1,0xb3,0xc1,0xfd,0x99,0x7f,0x99,0xfe,0xe7,0xe3,0xe7,0xfe,
0x6a,0x17,0x6a,0xfe,0x68,0x0a,0x68,0xfe,0xd6,0xce,0xd6,0xfe,0xe8,0xe3,0xe8,0xfe,
0xa5,0x90,0xa5,0xfe,0xce,0xc3,0xce,0xfe,0xcf,0xc5,0xcf,0xfe,0xf5,0xf3,0xf5,0xfe,
0x66,0x00,0x66,0xe1,0xc6,0xbb,0xc6,0xfe,0xff,0xff,0xff,0xff,0x66,0x00,0x66,0xff,
0xd3,0xcb,0xd3,0xff,0xb8,0xaa,0xb8,0xff,0xfb,0xfa,0xfb,0xff,0x72,0x38,0x72,0xff,
0xc2,0xb6,0xc2,0xff,0xb8,0xa9,0xb8,0xff,0x72,0x39,0x72,0xff,0x74,0x3c,0x74,0xff,
0xeb,0xe7,0xeb,0xff,0xfc,0xfb,0xfc,0xff,0xea,0xe7,0xea,0xff,0x9f,0x87,0x9f,0xff,
0xf7,0xf5,0xf7,0xff,0x9d,0x85,0x9d,0xff,0xfe,0xfe,0xfe,0xff,0xfc,0xfc,0xfc,0xff,
0xf3,0xf1,0xf3,0xff,0xb5,0xa6,0xb5,0xff,0xef,0xed,0xef,0xff,0xe6,0xe2,0xe6,0xff,
0xee,0xeb,0xee,0xff,0xf2,0xf0,0xf2,0xff,0xdc,0xd6,0xdc,0xff,0xc5,0xb9,0xc5,0xff,
0xfa,0xf8,0xfa,0xff,0x74,0x3d,0x74,0xff,0x9e,0x86,0x9e,0xff,0x86,0x61,0x86,0xff,
0xe2,0xdd,0xe2,0xff,0x8e,0x6f,0x8e,0xff,0xa3,0x8d,0xa3,0xff,0x6c,0x21,0x6c,0xff,
0xae,0x9c,0xae,0xff,0xb4,0xa4,0xb4,0xff,0xfe,0xfd,0xfe,0xff,0xde,0xd8,0xde,0xff,
0x83,0x5b,0x83,0xff,0x7c,0x4f,0x7c,0xff,0xee,0xec,0xee,0xff,0xaa,0x97,0xaa,0xff,
0xf0,0xee,0xf0,0xff,0xc9,0xbe,0xc9,0xff,0xa4,0x8f,0xa4,0xff,0xea,0xe6,0xea,0xff,
0xc5,0xba,0xc5,0xff,0x90,0x71,0x90,0xff,0xfb,0xfb,0xfb,0xff,0xc9,0xbf,0xc9,0xff,
0x68,0x10,0x68,0xff,0x7f,0x53,0x7f,0xff,0xef,0xec,0xef,0xff,0xe8,0xe4,0xe8,0xff,
0xcb,0xc1,0xcb,0xff,0xe3,0xde,0xe3,0xff,0xb0,0x9f,0xb0,0xff,0x7d,0x50,0x7d,0xff,
0x8a,0x68,0x8a,0xff,0xdf,0xd9,0xdf,0xff,0xe5,0xe1,0xe5,0xff,0xf7,0xf6,0xf7,0xff,
0x96,0x7c,0x96,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,0xff,0xff,0xff,0x00,
0x00,0x0f,0x0f,0x0f,0x0f,0x16,0x11,0x22,0x0e,0x0e,0x20,0x1d,0x0f,0x0f,0x00,
0x01,0x11,0x2e,0x29,0x0f,0x0f,0x0f,0x2f,0x14,0x12,0x0e,0x1f,0x15,0x0f,0x0f,
0x0e,0x0e,0x0e,0x0e,0x2c,0x30,0x0f,0x0f,0x0f,0x2d,0x25,0x0e,0x0e,0x11,0x0f,
0x1a,0x38,0x0e,0x0e,0x0e,0x0e,0x36,0x02,0x0f,0x0f,0x17,0x23,0x0e,0x1e,0x1b,
0x0f,0x0f,0x17,0x37,0x33,0x0e,0x0e,0x0e,0x3c,0x0f,0x0f,0x13,0x24,0x0e,0x1c,
0x0f,0x0f,0x0f,0x0f,0x0f,0x3d,0x18,0x0e,0x0e,0x10,0x0f,0x0f,0x2b,0x12,0x0e,
0x18,0x06,0x15,0x35,0x0f,0x0f,0x40,0x10,0x0e,0x0e,0x39,0x0f,0x0f,0x21,0x0e,
0x0e,0x0e,0x0e,0x12,0x3f,0x16,0x0f,0x0f,0x10,0x0e,0x0e,0x3a,0x0f,0x0f,0x07,
0x09,0x26,0x28,0x0e,0x0e,0x03,0x41,0x0f,0x0f,0x45,0x0e,0x42,0x04,0x0f,0x08,
0x0f,0x0f,0x13,0x27,0x32,0x0e,0x43,0x13,0x0f,0x48,0x19,0x0e,0x31,0x0f,0x0f,
0x0f,0x0f,0x0f,0x0f,0x2a,0x3e,0x0e,0x44,0x0f,0x0f,0x10,0x0e,0x3b,0x0f,0x0f,
0x0f,0x0f,0x0f,0x0f,0x0f,0x14,0x0e,0x19,0x47,0x0f,0x4c,0x0e,0x0e,0x34,0x0f,
0x0f,0x0f,0x0f,0x0f,0x0f,0x05,0x0b,0x0e,0x14,0x0f,0x0f,0x4b,0x0e,0x46,0x0f,
0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0a,0x0e,0x49,0x0f,0x0f,0x4a,0x0e,0x0d,0x0f,
0x00,0x0f,0x0f,0x0f,0x0f,0x0f,0x11,0x0e,0x1a,0x0f,0x0f,0x10,0x0e,0x10,0x0c,
};
const lv_image_dsc_t mqtt_ok = {
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.cf = LV_COLOR_FORMAT_I8,
.header.flags = 0,
.header.w = 15,
.header.h = 15,
.header.stride = 15,
.data_size = sizeof(mqtt_ok_map),
.data = mqtt_ok_map,
};

View File

@ -1,49 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#elif defined(LV_BUILD_TEST)
#include "../lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_WIFI_KO
#define LV_ATTRIBUTE_WIFI_KO
#endif
static const
LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_WIFI_KO
uint8_t wifi_ko_map[] = {
0xfe,0xfe,0xfe,0xff,0xfc,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xf5,0xf5,0xf5,0xff,0xa5,0xa5,0xa5,0xff,0x4d,0x4d,0x4d,0xff,0x1a,0x1a,0x1a,0xff,0x00,0x00,0x00,0xff,0x79,0x79,0x79,0xff,0xff,0xff,0xff,0xff,0x5a,0x5a,0x5a,0xff,0x30,0x30,0x30,0xff,0xff,0xff,0xff,0xff,0x78,0x78,0x78,0xff,0x10,0x10,0x10,0xff,
0xfd,0xfd,0xfd,0xff,0xff,0xff,0xff,0xff,0xa0,0xa0,0xa0,0xff,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0xff,0x06,0x06,0x06,0xff,0x2e,0x2e,0x2e,0xff,0x3d,0x3d,0x3d,0xff,0xa5,0xa5,0xa5,0xff,0xff,0xff,0xff,0xff,0x89,0x89,0x89,0xff,0x00,0x00,0x00,0xff,0x2b,0x2b,0x2b,0xff,0x03,0x03,0x03,0xff,0x3c,0x3c,0x3c,0xff,
0xf6,0xf6,0xf6,0xff,0x57,0x57,0x57,0xff,0x00,0x00,0x00,0xff,0x23,0x23,0x23,0xff,0xa5,0xa5,0xa5,0xff,0xfa,0xfa,0xfa,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0x4b,0x4b,0x4b,0xff,0x00,0x00,0x00,0xff,0x1a,0x1a,0x1a,0xff,0xe0,0xe0,0xe0,0xff,
0x3a,0x3a,0x3a,0xff,0x00,0x00,0x00,0xff,0x77,0x77,0x77,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xbb,0xbb,0xbb,0xff,0x68,0x68,0x68,0xff,0x36,0x36,0x36,0xff,0x9e,0x9e,0x9e,0xff,0xff,0xff,0xff,0xff,0x80,0x80,0x80,0xff,0x00,0x00,0x00,0xff,0x2d,0x2d,0x2d,0xff,0x03,0x03,0x03,0xff,0x32,0x32,0x32,0xff,
0x60,0x60,0x60,0xff,0x8f,0x8f,0x8f,0xff,0xff,0xff,0xff,0xff,0xc4,0xc4,0xc4,0xff,0x23,0x23,0x23,0xff,0x00,0x00,0x00,0xff,0x05,0x05,0x05,0xff,0x00,0x00,0x00,0xff,0x84,0x84,0x84,0xff,0xff,0xff,0xff,0xff,0x6a,0x6a,0x6a,0xff,0x46,0x46,0x46,0xff,0xff,0xff,0xff,0xff,0x88,0x88,0x88,0xff,0x27,0x27,0x27,0xff,
0xfc,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xab,0xab,0xab,0xff,0x00,0x00,0x00,0xff,0x10,0x10,0x10,0xff,0x96,0x96,0x96,0xff,0xf7,0xf7,0xf7,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xff,0xfe,0xfe,0xfe,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff,0xff,0x8d,0x8d,0x8d,0xff,0x29,0x29,0x29,0xff,0xe6,0xe6,0xe6,0xff,0xff,0xff,0xff,0xff,0xba,0xba,0xba,0xff,0x7d,0x7d,0x7d,0xff,0x83,0x83,0x83,0xff,0xc7,0xc7,0xc7,0xff,0xff,0xff,0xff,0xff,0xfd,0xfd,0xfd,0xff,0xfd,0xfd,0xfd,0xff,0xfd,0xfd,0xfd,0xff,0xfe,0xfe,0xfe,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xfd,0xfd,0xff,0xff,0xff,0xff,0xff,0xd4,0xd4,0xd4,0xff,0x24,0x24,0x24,0xff,0x00,0x00,0x00,0xff,0x02,0x02,0x02,0xff,0x01,0x01,0x01,0xff,0x00,0x00,0x00,0xff,0x4d,0x4d,0x4d,0xff,0xef,0xef,0xef,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0x3c,0x3c,0x3c,0xff,0x01,0x01,0x01,0xff,0x9a,0x9a,0x9a,0xff,0xf0,0xf0,0xf0,0xff,0xe5,0xe5,0xe5,0xff,0x74,0x74,0x74,0xff,0x00,0x00,0x00,0xff,0x83,0x83,0x83,0xff,0xff,0xff,0xff,0xff,0xfb,0xfb,0xfb,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xca,0xca,0xca,0xff,0xd2,0xd2,0xd2,0xff,0xff,0xff,0xff,0xff,0xc2,0xc2,0xc2,0xff,0xd4,0xd4,0xd4,0xff,0xff,0xff,0xff,0xff,0xc3,0xc3,0xc3,0xff,0xe3,0xe3,0xe3,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0x83,0x83,0x83,0xff,0x00,0x00,0x00,0xff,0x02,0x02,0x02,0xff,0xbc,0xbc,0xbc,0xff,0xff,0xff,0xff,0xff,0xfc,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0xf9,0xf9,0xff,0xff,0xff,0xff,0xff,0x54,0x54,0x54,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x94,0x94,0x94,0xff,0xff,0xff,0xff,0xff,0xfa,0xfa,0xfa,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfd,0xfd,0xfd,0xff,0xff,0xff,0xff,0xff,0xca,0xca,0xca,0xff,0x1e,0x1e,0x1e,0xff,0x40,0x40,0x40,0xff,0xee,0xee,0xee,0xff,0xff,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};
const lv_image_dsc_t wifi_ko = {
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.cf = LV_COLOR_FORMAT_ARGB8888,
.header.flags = 0,
.header.w = 15,
.header.h = 13,
.header.stride = 60,
.data_size = sizeof(wifi_ko_map),
.data = wifi_ko_map,
};

View File

@ -1,4 +0,0 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://www.flaticon.com/free-icon/wifi_10179082?term=wifi&page=1&position=72&origin=tag&related_id=10179082
HostUrl=https://www.flaticon.com/download/icon/10179082?icon_id=10179082&author=4014&team=4014&keyword=Wifi&pack=10178962&style=black+outline&style_id=1369&format=png&color=%23000000&colored=1&size=512&selection=1&type=standard&token=03AFcWeA4RyxIf4QsrIC4tHTqrKilxyFhDaeCELUJ5y2sh5Z335A3k8sZtFRKbUkQjtMRnLVYnKYcv-jzbF73QhCKZMOKukL3s8JLvWQvNyitg0AK2yFN9cm6zn8bhADDZASUE7dAtq2wzDW9Q4xndpF9QSqs7esAvmn7a7sFjD5RF2nbQLj8tSNkchXBvh9Tqfr_3-4FOMk7yNRwUNWUGRHYa_7HL8k24iA_UjL7hDHY21uNBBwEbwmsOtQSMiFog7JBJ7c6QimbJuJFvUq2OaDOvp3XRh0QwfgMzIZR-0eSwHUTNZK0ZvfR-78QJFjvMEOjIZWwvLabNeJk1twjloLXxYWT-VKxk1jRjHxAGVUGH3wm7YSMlgMScDjLDH0ysTezlCo3YIyuFdPSNadc5Y8bLmhc84f0f0YnKzjVLS4YwUO5rLMrG5jx7hvUEuWzny7mWE9N2QstAIC7OTEWRUU9tA2TS_NPlg8yl5YU5KTcgUIojGXyOe4grWD-4TYgKW_Uzu6sQ2iHZWPYWQf3rNjX4GWTHcpDgD3ccNgzb8HeXhQdYE1Rf9W9WAA_amhHnPYZmatQSy9mHCnb80FjnYcbKUwcRMD2hQbPGzF78YqKH5smnThi8V_gsXZvfG8pb6RKfSzf-CK05fKRcvCgr6D-P7dN67GtxrvCt_If3c_X329lw8FYZuGJFHBb5aDgpcVieIOECR6afx2JMb-aesRBEZDNSXuQ7haFyHe_XcD4jqksyCslN3akqmyAx72i3Lg1t7tqEQCFGY_4WsWjHYB2LgwZIss2anRN7Gddg7p4G4fC1sKfSGRCZMIHfutZv0phQNI6OoYGnC8I3dxkW__w1trG7NCWw04Zb4sUpHnqEFpO2ujdoApltxHdcaCPkjT_ojghjjwws_MZZBbBaetGp7B3mYNYiTX0MDtNaYfU6GnP4v3t9mnEKZxfkhMadPW2lcdSc5wDLSXjftxrPOwUUSpS39QHQ7Y-o4L3X0-cedUnrAdjEPH-3i6UfAuDtinqKomkoxlUnGjHvwyDQn-27tWB_EM7X8qdkMu2B3iYpUGTSI6Fr62m2CQjwEI5TPs_556kkMgqKttVmt4pPiI_Imt8w9uPINaqUdR-0AunFKB87KeRLvJK1i6JIPzEAc-SnABc8ohW4m6ngwC3I3dr80nLIwsZo8x9v_p3y2A8DkQPlXPHsUEpBqbM6ZM-Mq1ZK_E0IB-cdbwGTy6zV8JSSOANd6aj3pi7Lmt_sF1VhGPTivI7LJBT5nVW5ypnyz157iL5xbIOa9M6MbB1KtqNPRBcg1W3blhQ3DrczffVuZSoJlcPWXD6lZRAsgPkUR3PHzR2O7QdT4HM8XShoPoIswr6p74yWrO9nTasKVVCu_zL_ea1lR4NwYX10-5hB_hLewEI-Dg03R__kIeU0MNkyWkjajD7Vzn1EBWAJvbeNW73TapaiFWepy7874EQpwZw7_bNK6Qb4L7niaYyG8aGahsgtWl4CuxCJWVqo31MnAUM-j2lXSDk6zZRhZL9N7zGW_vVD7nGOVWFGIh40s-2KytHFI7WImqmiCmTEZZ9wXeRf_6qb_7OcJ8UOePwcaqL6XaNDpCeIzkF5ImSyuLbWLM9GWQGP97kpUXgO_q3FMvYaVJcOcGpZpRU3VFFbvqFVC2LEWcUqaD7SuEZvZS-VGjfVh8cNWocZ3IC_QqNu6-zGjDgpuIIuJBOh_tKy-iERl11U_GOl4ThytbKk4jOJtYFNDkNuN9TIJZqlVCYoNd6VPrnS46GrvrM7wj-LZffmuR9rVQpuxt_zrNyavPzuHbPCEkXDbhZL9ecqJkWy3b5E5V-dQoDSvDbHVxsbMZHwWflmbffCH6uf7fJvlGUNnu3LmOVUq-WuDK5invepzjtGDqOjxTeXmcGqnzvPDuoeQ8SkM04-zzk8HALtK0dRU1_Yk8gFOJOYz2ZPqWoDWoDYZml4QOo&search=wifi

View File

@ -1,48 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#elif defined(LV_BUILD_TEST)
#include "../lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_WIFI_OK
#define LV_ATTRIBUTE_WIFI_OK
#endif
static const
LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_WIFI_OK
uint8_t wifi_ok_map[] = {
0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0xb9,0x00,0x00,0x00,0xe5,0x00,0x00,0x00,0xf2,0x00,0x00,0x00,0xe6,0x00,0x00,0x00,0xbb,0x00,0x00,0x00,0x6f,0x00,0x00,0x00,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x86,0x00,0x00,0x00,0xf9,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xe6,0x00,0x00,0x00,0xba,0x00,0x00,0x00,0xa9,0x00,0x00,0x00,0xb9,0x00,0x00,0x00,0xe4,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x8c,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x29,0x00,0x00,0x00,0xd5,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xa2,0x00,0x00,0x00,0x25,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x00,0x00,0x00,0x9d,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xda,0x00,0x00,0x00,0x2f,
0x00,0x00,0x00,0xf9,0x00,0x00,0x00,0xf3,0x00,0x00,0x00,0x3d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2f,0x00,0x00,0x00,0x9b,0x00,0x00,0x00,0xdb,0x00,0x00,0x00,0xed,0x00,0x00,0x00,0xdc,0x00,0x00,0x00,0x9e,0x00,0x00,0x00,0x33,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x00,0x00,0x00,0xee,0x00,0x00,0x00,0xfb,
0x00,0x00,0x00,0x62,0x00,0x00,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa1,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0xbc,0x00,0x00,0x00,0xa1,0x00,0x00,0x00,0xba,0x00,0x00,0x00,0xf9,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xa7,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x23,0x00,0x00,0x00,0x57,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xab,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x7b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x74,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xaf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x4a,0x00,0x00,0x00,0x4a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x00,0x00,0x00,0xd9,0x00,0x00,0x00,0xf4,0x00,0x00,0x00,0xdb,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43,0x00,0x00,0x00,0x45,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x05,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd3,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xc5,0x00,0x00,0x00,0x96,0x00,0x00,0x00,0xc2,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xda,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0xa8,0x00,0x00,0x00,0x53,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4d,0x00,0x00,0x00,0xa4,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83,0x00,0x00,0x00,0xe6,0x00,0x00,0x00,0x8b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0xfb,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x8e,0x00,0x00,0x00,0xf5,0x00,0x00,0x00,0x96,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
const lv_image_dsc_t wifi_ok = {
.header.magic = LV_IMAGE_HEADER_MAGIC,
.header.cf = LV_COLOR_FORMAT_ARGB8888,
.header.flags = 0,
.header.w = 15,
.header.h = 12,
.header.stride = 60,
.data_size = sizeof(wifi_ok_map),
.data = wifi_ok_map,
};

View File

@ -1,10 +0,0 @@
void mqtt_app_start(void);
typedef enum wifi_evt{
CONNECTED,
CONNECT_FAIL,
DISCONNECTED,
GOT_IP
} wifi_evt;
typedef void (*wifi_callback)(wifi_evt evt);
void wifi_init_sta(wifi_callback cb);

View File

@ -23,7 +23,6 @@
#include "esp_http_client.h"
#include "esp_tls.h"
#include "stateManagement.h"
static const char *TAG = "MeteoFrance";
/* Constants that aren't configurable in menuconfig
@ -172,7 +171,7 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
break;
case HTTP_EVENT_DISCONNECTED:
ESP_LOGI(TAG, "HTTP_EVENT_DISCONNECTED");
int mbedtls_err = 0;
/*int mbedtls_err = 0;
esp_err_t err = esp_tls_get_and_clear_last_error((esp_tls_error_handle_t)evt->data, &mbedtls_err, NULL);
if (err != 0)
{
@ -184,7 +183,7 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
free(output_buffer);
output_buffer = NULL;
}
output_len = 0;
output_len = 0;*/
break;
case HTTP_EVENT_REDIRECT:
ESP_LOGD(TAG, "HTTP_EVENT_REDIRECT");

View File

@ -1,6 +1,6 @@
set(EXTRA_COMPONENT_DIRS ../components)
set(comps heap nvs_flash meteofrance communication esp_netif image_downloader fatfs sdmmc vfs littlefs wifi_logger protocol_examples_common app_update esp_https_ota )
set(comps heap nvs_flash meteofrance esp_netif image_downloader fatfs sdmmc vfs littlefs wifi_logger protocol_examples_common app_update esp_https_ota mqtt)
if(${IDF_TARGET} STREQUAL "esp32p4")
list(APPEND comps bsp_extra esp32_p4_function_ev_board)
@ -17,6 +17,12 @@ set_source_files_properties(
"-DLV_LVGL_H_INCLUDE_SIMPLE;-Wno-format;-DLV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(montserrat_medium_12) LV_FONT_DECLARE(montserrat_medium_18) LV_FONT_DECLARE(montserrat_medium_24)"
)
lvgl_port_create_c_image("images/wifi_ok.png" "images/" "ARGB8888" "NONE")
lvgl_port_create_c_image("images/wifi_ko.png" "images/" "ARGB8888" "NONE")
lvgl_port_create_c_image("images/mqtt_ok.png" "images/" "AUTO" "NONE")
lvgl_port_create_c_image("images/mqtt_ko.png" "images/" "ARGB8888" "NONE")
lvgl_port_add_images(${COMPONENT_LIB} "images/")
littlefs_create_partition_image(littlefs images_meteo FLASH_IN_PROJECT)

View File

@ -1,71 +1,15 @@
#include "communication.h"
#include "include/communication.h"
#include "esp_log.h"
#include "mqtt_client.h"
#include "bsp/esp-bsp.h"
#include "stateManagement.h"
#include "esp_wifi.h"
#include "esp_log.h"
esp_mqtt_client_handle_t client;
lv_subject_t mqttStatus;
extern lv_subject_t tempIntSubj;
extern lv_subject_t tempExtSubj;
extern lv_subject_t hauteurCuveSubj;
extern lv_subject_t hauteurCuveEvolSubj;
static const char *TAG = "domo_mqtt";
char *upEvent = "monter";
char *downEvent = "descendre";
char *topicTempExt = "house/temp/282A802600008059";
char *topicHauteurCuve = "house/cuve/hauteur";
char *topicTempInt = "house/temp/287DCF1E00008020";
char *topicHauteurCuveEvol = "house/cuve/hauteurEvol";
char *topicdomoticCommand = "domotic/cmd";
char *topicTest = "test";
LV_IMAGE_DECLARE(mqtt_ok);
LV_IMAGE_DECLARE(mqtt_ko);
static void mqttStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject);
static void mqttStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject)
{
ESP_LOGV(TAG, "On passe dans le callback de chgt de statut; %li", lv_subject_get_int(subject));
if(lvgl_port_lock(0)){
lv_obj_t * wifiSt = lv_obj_get_child(lv_obj_get_child(lv_layer_top(), 0),3);
if(lv_obj_check_type(wifiSt, &lv_image_class)){
switch (lv_subject_get_int(subject))
{
case 0:
lv_image_set_src(wifiSt,&mqtt_ko);
break;
case 1:
lv_image_set_src(wifiSt,&mqtt_ok);
break;
case 2:
lv_color_t color = lv_color_make(255, 0, 0);
lv_obj_set_style_image_recolor_opa(wifiSt, 125, 0);
lv_obj_set_style_image_recolor(wifiSt, color, 0);
vTaskDelay(2000 / portTICK_PERIOD_MS);
break;
case 3:
lv_obj_set_style_image_recolor_opa(wifiSt, 0, 0);
break;
default:
break;
}
}else{
ESP_LOGE(TAG, "L'objet recuip en semble pas etre du bon type");
}
lvgl_port_unlock();
}
//int32_t prev_v = lv_subject_get_previous_int(subject);
//int32_t cur_v = lv_subject_get_int(subject);
//lv_obj_t * btn = lv_observer_get_target(observer);
}
static void log_error_if_nonzero(const char *message, int error_code)
{
@ -98,6 +42,8 @@ void splitIt(char *payload, unsigned int length, float *datas)
ESP_LOGE(TAG,"%f",datas[3]);
}
mqtt_callback mqttcb;
/*
* @brief Event handler registered to receive MQTT events
*
@ -117,11 +63,7 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
switch ((esp_mqtt_event_id_t)event_id)
{
case MQTT_EVENT_CONNECTED:
if(lvgl_port_lock(50)){
ESP_LOGV(TAG,"Statut mqttStatus 1");
lv_subject_set_int(&mqttStatus,1);
lvgl_port_unlock();
}
mqttcb(MQTT_CONNECTED,NULL);
ESP_LOGI(TAG, "MQTT_EVENT_CONNECTED");
//msg_id = esp_mqtt_client_publish(client, "/topic/qos1", "data_3", 0, 1, 0);
//ESP_LOGI(TAG, "sent publish successful, msg_id=%d", msg_id);
@ -151,11 +93,7 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
//ESP_LOGI(TAG, "sent unsubscribe successful, msg_id=%d", msg_id);
break;
case MQTT_EVENT_DISCONNECTED:
if(lvgl_port_lock(50)){
ESP_LOGE(TAG,"Statut mqttStatus 0");
lv_subject_set_int(&mqttStatus,0);
lvgl_port_unlock();
}
mqttcb(MQTT_DISCONNECTED,NULL);
ESP_LOGI(TAG, "MQTT_EVENT_DISCONNECTED");
break;
@ -171,72 +109,7 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
ESP_LOGI(TAG, "MQTT_EVENT_PUBLISHED, msg_id=%d", event->msg_id);
break;
case MQTT_EVENT_DATA:
lv_subject_set_int(&mqttStatus,2);
ESP_LOGD(TAG, "\nMQTT_EVENT_DATA");
ESP_LOGD(TAG, "TOPIC=%.*s\n", event->topic_len, event->topic);
ESP_LOGD(TAG, "DATA=%.*s\n", event->data_len, event->data);
if (strncmp(event->topic, topicTempExt, 27) == 0)
{
if(lvgl_port_lock(50)){
// on retransforme en float pour ne garder que la partie entiere de la température
float temp = strtof(event->data, NULL);
char buff[5];
sprintf(buff,"%.1f",temp);
lv_subject_copy_string(&tempExtSubj, buff);
lvgl_port_unlock();
}
}
else if (strncmp(event->topic, topicTempInt, 27) == 0)
{
if(lvgl_port_lock(0)){
// on retransforme en float pour ne garder que la partie entiere de la température
float temp = strtof(event->data, NULL);
char buff[5];
sprintf(buff,"%.1f",temp);
lv_subject_copy_string(&tempIntSubj, buff);
lvgl_port_unlock();
}
}
else if (strncmp(event->topic, topicHauteurCuveEvol, 22) == 0)
{
/* float datas[4] = {};
splitIt(event->data, event->data_len, datas);
ser1->y_points[0] = 130 - (int)datas[0];
ser1->y_points[1] = 130 - (int)datas[1];
ser1->y_points[2] = 130 - (int)datas[2];
ser1->y_points[3] = 130 - (int)datas[3];
lvgl_port_lock(0);
lv_chart_refresh(chart);
lvgl_port_unlock();
*/
// lv_subject_copy_string(&hauteurCuveEvolSubj, event->data);
}
else if (strncmp(event->topic, topicHauteurCuve, 18) == 0)
{
if (lvgl_port_lock(50)){
float temp = strtof(event->data, NULL);
char buff[5];
sprintf(buff,"%.0f",temp);
lv_subject_copy_string(&hauteurCuveSubj, buff);
lvgl_port_unlock();
}
}else if (strncmp(event->topic, topicTest, 4) == 0){
ESP_LOGD(TAG,"Msg reecu sur test");
}else if (strncmp(event->topic, topicdomoticCommand, 11) == 0){
if(strncmp(event->data,"restart",7)==0){
ESP_LOGI(TAG," Commande 'restart' recue");
esp_restart();
}
}
else
{
ESP_LOGE(TAG, "None match :-( %s", event->topic);
}
if (lvgl_port_lock(50)){
lv_subject_set_int(&mqttStatus,3);
lvgl_port_unlock();
}
mqttcb(MQTT_DATA_RECEIVED, event);
break;
case MQTT_EVENT_ERROR:
ESP_LOGI(TAG, "MQTT_EVENT_ERROR");
@ -253,13 +126,11 @@ static void mqtt_event_handler(void *handler_args, esp_event_base_t base, int32_
break;
}
}
void mqtt_app_start(void)
void mqtt_app_start(mqtt_callback callback)
{
lv_subject_init_int(&mqttStatus,-1);
lv_subject_add_observer_obj(&mqttStatus, mqttStatus_obs_cb, NULL, NULL);
mqttcb=callback;
esp_mqtt_client_config_t mqtt_cfg = {
.broker.address.uri = "mqtt://192.168.0.10",
.network.timeout_ms = 1000};
@ -301,9 +172,6 @@ void mqtt_app_start(void)
esp_mqtt_client_start(client);
}
#include "esp_wifi.h"
#include "esp_log.h"
#include "esp_lvgl_port.h"
/* FreeRTOS event group to signal when we are connected*/
static EventGroupHandle_t s_wifi_event_group;
@ -342,9 +210,9 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base, int32_t e
}
else
{
xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
//xEventGroupSetBits(s_wifi_event_group, WIFI_FAIL_BIT);
}
cb(DISCONNECTED);
cb(WIFI_DISCONNECTED);
ESP_LOGI(TAG, "connect to the AP fail");
}
else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP)
@ -352,7 +220,8 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base, int32_t e
ip_event_got_ip_t *event = (ip_event_got_ip_t *)event_data;
ESP_LOGI(TAG, "got ip:" IPSTR, IP2STR(&event->ip_info.ip));
s_retry_num = 0;
xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
cb(WIFI_CONNECTED);
//xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
}
}
void wifi_init_sta(wifi_callback callback)

View File

@ -8,11 +8,10 @@
#include "string.h"
#include "meteofrance.h"
#include "main.h"
#include "bsp/esp-bsp.h"
extern char *upEvent;
extern char *downEvent;
extern esp_mqtt_client_handle_t client;
#define upEvent "monter"
#define downEvent "descendre"
lv_subject_t dateHeureSubj;
lv_obj_t *lblTempInt2;
@ -39,6 +38,8 @@ char dateHeureStr[30];
static lv_style_t no_padding;
static const char *TAG = "IHM";
void draw_time(char* dateHeure){
if(display_lock("updateTime")){
lv_subject_copy_string(&dateHeureSubj, dateHeure);
@ -53,6 +54,7 @@ void draw_temp(char * tempHumid){
}
}
static void event_handler(lv_event_t *e)
{
lv_event_code_t code = lv_event_get_code(e);
@ -66,7 +68,7 @@ static void event_handler(lv_event_t *e)
break;
case LV_EVENT_CLICKED:
ESP_LOGI(TAG, "%s was clicked\n", evtData);
esp_mqtt_client_publish(client, "volets", evtData, 0, 0, 0);
//esp_mqtt_client_publish(client, "volets", evtData, 0, 0, 0);
break;
case LV_EVENT_LONG_PRESSED:
LV_LOG_USER("%s was long pressed\n", evtData);
@ -110,6 +112,7 @@ void app_main_display()
struct dailyforecast_prev p;
lv_strcpy(p.desc, "");
d.previsions = p;
d.isValid=false;
lv_subject_init_pointer(&forecastD1Subj, &d);
lv_subject_init_pointer(&forecastD2Subj, &d);
lv_subject_init_pointer(&forecastD3Subj, &d);
@ -119,6 +122,7 @@ void app_main_display()
lv_strcpy(p1.desc, "");
d1.previsions = p1;
d1.isValid=false;
lv_subject_init_pointer(&forecastH1Subj, &d1);
lv_subject_init_pointer(&forecastH2Subj, &d1);
lv_subject_init_pointer(&forecastH3Subj, &d1);
@ -247,13 +251,13 @@ static lv_style_t style_container;
static void weatherdata_obs_cb(lv_observer_t *observer, lv_subject_t *subject)
{
ESP_LOGE(TAG, "CB meteo jour declenché");
// Retrieve weatherdata
const struct meteodailyforecast_data *data = subject->value.pointer;
ESP_LOGE(TAG, "CB meteo jour declenché. Meteo valide : %i", data->isValid);
// printffd(data);
// char buff[40] = {};
// sprintf(buff,"%s %.1f %.1f", data->previsions.desc, data->previsions.min, data->previsions.max);
if(data->isValid){
lv_obj_t *parent = (lv_obj_t *)(observer->target);
lv_obj_t *datefld = lv_obj_get_child(parent, 0);
lv_obj_t *desc_icon = lv_obj_get_child(parent, 1);
@ -266,6 +270,7 @@ static void weatherdata_obs_cb(lv_observer_t *observer, lv_subject_t *subject)
lv_label_set_text(lv_obj_get_child(desc_icon, 1), data->previsions.desc);
lv_label_set_text_fmt(lv_obj_get_child(temps, 0), "%.1f°C", data->previsions.max);
lv_label_set_text_fmt(lv_obj_get_child(temps, 1), "%.1f°C", data->previsions.min);
}
}
// Callback pour mettre à jour une météo horaire

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 483 B

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 372 B

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1,27 @@
#pragma once
#include "mqtt_client.h"
typedef enum wifi_evt{
WIFI_CONNECTED,
WIFI_CONNECT_FAIL,
WIFI_DISCONNECTED,
WIFI_GOT_IP
} wifi_evt;
typedef enum mqtt_evt{
MQTT_CONNECTED,
MQTT_CONNECT_FAIL,
MQTT_DISCONNECTED,
MQTT_DATA_RECEIVED
} mqtt_evt;
typedef void (*wifi_callback)(wifi_evt evt);
typedef void (*mqtt_callback)(mqtt_evt evt, esp_mqtt_event_handle_t evt_data);
void wifi_init_sta(wifi_callback cb);
void mqtt_app_start(mqtt_callback cb);
#define topicTempExt "house/temp/282A802600008059"
#define topicHauteurCuve "house/cuve/hauteur"
#define topicTempInt "house/temp/287DCF1E00008020"
#define topicHauteurCuveEvol "house/cuve/hauteurEvol"
#define topicdomoticCommand "domotic/cmd"
#define topicTest "test"

View File

@ -27,7 +27,7 @@
#include "wifi_logger.h"
#include "obtain_time.h"
#include "image_downloader.h"
#include "communication.h"
#include "include/communication.h"
#include "stateManagement.h"
#include "am2302_rmt.h"
@ -52,8 +52,8 @@ static const char *TAG = "domoTic";
extern esp_mqtt_client_handle_t client;
typedef enum domo_events{
WIFI_CONNECTED,
TIME_SETTED
EVT_WIFI_CONNECTED,
EVT_TIME_SETTED
} domo_events;
static EventGroupHandle_t hevt;
@ -92,21 +92,121 @@ static void wifiStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject)
//lv_obj_t * btn = lv_observer_get_target(observer);
}
lv_subject_t mqttStatus;
extern lv_subject_t tempIntSubj;
extern lv_subject_t tempExtSubj;
extern lv_subject_t hauteurCuveSubj;
extern lv_subject_t hauteurCuveEvolSubj;
void mqtt_cb(mqtt_evt evt, esp_mqtt_event_handle_t event){
switch (evt)
{
case MQTT_CONNECTED:
if(lvgl_port_lock(50)){
ESP_LOGV(TAG,"Statut mqttStatus 1");
lv_subject_set_int(&mqttStatus,1);
lvgl_port_unlock();
}
break;
case MQTT_DISCONNECTED:
if(lvgl_port_lock(50)){
ESP_LOGE(TAG,"Statut mqttStatus 0");
lv_subject_set_int(&mqttStatus,0);
lvgl_port_unlock();
}
break;
case MQTT_DATA_RECEIVED:
lv_subject_set_int(&mqttStatus,2);
ESP_LOGD(TAG, "\nMQTT_EVENT_DATA");
ESP_LOGD(TAG, "TOPIC=%.*s\n", event->topic_len, event->topic);
ESP_LOGD(TAG, "DATA=%.*s\n", event->data_len, event->data);
if (strncmp(event->topic, topicTempExt, 27) == 0)
{
if(lvgl_port_lock(50)){
// on retransforme en float pour ne garder que la partie entiere de la température
float temp = strtof(event->data, NULL);
char buff[5];
sprintf(buff,"%.1f",temp);
lv_subject_copy_string(&tempExtSubj, buff);
lvgl_port_unlock();
}
}
else if (strncmp(event->topic, topicTempInt, 27) == 0)
{
if(lvgl_port_lock(0)){
// on retransforme en float pour ne garder que la partie entiere de la température
float temp = strtof(event->data, NULL);
char buff[5];
sprintf(buff,"%.1f",temp);
lv_subject_copy_string(&tempIntSubj, buff);
lvgl_port_unlock();
}
}
else if (strncmp(event->topic, topicHauteurCuveEvol, 22) == 0)
{
/* float datas[4] = {};
splitIt(event->data, event->data_len, datas);
ser1->y_points[0] = 130 - (int)datas[0];
ser1->y_points[1] = 130 - (int)datas[1];
ser1->y_points[2] = 130 - (int)datas[2];
ser1->y_points[3] = 130 - (int)datas[3];
lvgl_port_lock(0);
lv_chart_refresh(chart);
lvgl_port_unlock();
*/
// lv_subject_copy_string(&hauteurCuveEvolSubj, event->data);
}
else if (strncmp(event->topic, topicHauteurCuve, 18) == 0)
{
if (lvgl_port_lock(50)){
float temp = strtof(event->data, NULL);
char buff[5];
sprintf(buff,"%.0f",temp);
lv_subject_copy_string(&hauteurCuveSubj, buff);
lvgl_port_unlock();
}
}else if (strncmp(event->topic, topicTest, 4) == 0){
ESP_LOGD(TAG,"Msg reecu sur test");
}else if (strncmp(event->topic, topicdomoticCommand, 11) == 0){
if(strncmp(event->data,"restart",7)==0){
ESP_LOGI(TAG," Commande 'restart' recue");
esp_restart();
}
}
else
{
ESP_LOGE(TAG, "None match :-( %s", event->topic);
}
if (lvgl_port_lock(50)){
lv_subject_set_int(&mqttStatus,3);
lvgl_port_unlock();
}
break;
default:
break;
}
}
extern EventGroupHandle_t domotic_event_group;
void send_event(domo_events evt){
ESP_LOGE(TAG,"On est dans l'event handler %i", evt);
switch(evt){
case WIFI_CONNECTED:
xEventGroupSetBits(hevt,WIFI_RDY);
start_wifi_logger();
wifi_log_e("test", "%s %d %f", "hello world wifi logger", 43, 45.341223242); // write log over wifi with log level -> ERROR }
case EVT_WIFI_CONNECTED:
xEventGroupSetBits(domotic_event_group, WIFI_CONNECTED_BIT);
ESP_LOGI(TAG, "connected to ap SSID");
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 1");
lv_subject_set_int(&wifiStatus,1);
lvgl_port_unlock();
}
break;
case TIME_SETTED:
case EVT_TIME_SETTED:
break;
}
}
@ -297,25 +397,29 @@ void alloc_fail(size_t size, uint32_t caps, const char * function_name){
}
void wifi_cb(wifi_evt evt){
ESP_LOGE(TAG,"On est dans wifi_cb %i", evt);
switch(evt){
case CONNECTED:
case WIFI_CONNECTED:
mainState.wifi_init=true;
send_event(WIFI_CONNECTED);
case DISCONNECTED:
break;
case WIFI_DISCONNECTED:
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 0");
lv_subject_set_int(&wifiStatus,0);
lvgl_port_unlock();
}
break;
case GOT_IP:
case WIFI_GOT_IP:
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 1");
lv_subject_set_int(&wifiStatus,1);
lvgl_port_unlock();
}
break;
case CONNECT_FAIL:
case WIFI_CONNECT_FAIL:
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 0");
lv_subject_set_int(&wifiStatus,0);
@ -392,10 +496,52 @@ void weather_data_retreived_start()
//}
}
LV_IMAGE_DECLARE(mqtt_ok);
LV_IMAGE_DECLARE(mqtt_ko);
static void mqttStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject)
{
ESP_LOGV(TAG, "On passe dans le callback de chgt de statut; %li", lv_subject_get_int(subject));
if(lvgl_port_lock(0)){
lv_obj_t * wifiSt = lv_obj_get_child(lv_obj_get_child(lv_layer_top(), 0),3);
if(lv_obj_check_type(wifiSt, &lv_image_class)){
switch (lv_subject_get_int(subject))
{
case 0:
lv_image_set_src(wifiSt,&mqtt_ko);
break;
case 1:
lv_image_set_src(wifiSt,&mqtt_ok);
break;
case 2:
lv_color_t color = lv_color_make(255, 0, 0);
lv_obj_set_style_image_recolor_opa(wifiSt, 125, 0);
lv_obj_set_style_image_recolor(wifiSt, color, 0);
vTaskDelay(2000 / portTICK_PERIOD_MS);
break;
case 3:
lv_obj_set_style_image_recolor_opa(wifiSt, 0, 0);
break;
default:
break;
}
}else{
ESP_LOGE(TAG, "L'objet recuip en semble pas etre du bon type");
}
lvgl_port_unlock();
}
//int32_t prev_v = lv_subject_get_previous_int(subject);
//int32_t cur_v = lv_subject_get_int(subject);
//lv_obj_t * btn = lv_observer_get_target(observer);
}
void app_main(void)
{
domotic_event_group = xEventGroupCreate();
printf("Minimum free heap size: %" PRIu32 " bytes\n", esp_get_minimum_free_heap_size());
printf("Free heap size: %" PRIu32 " bytes\n", esp_get_free_heap_size());
heap_caps_print_heap_info(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
@ -484,16 +630,34 @@ void app_main(void)
lv_subject_init_int(&wifiStatus,0);
lv_subject_add_observer_obj(&wifiStatus, wifiStatus_obs_cb, NULL, NULL);
wifi_init_sta(wifi_cb);
//
esp_log_level_set("tcp_handler", ESP_LOG_NONE);
on_weather_data_retrieval(weather_data_retreived);
on_weather_data_retrieval_start(weather_data_retreived_start);
ESP_LOGW(TAG, "Weather data retrieval initialized");
initialise_weather_data_retrieval(600000);
TaskHandle_t xHandle = NULL;
BaseType_t ret1;
ret1 = xTaskCreate(&imgdwn, "imageDownload_task", 3 * 1024, NULL, 5, &xHandle);
if (ret1 != pdPASS)
{
ESP_LOGE(TAG, "Impossiblke de creer la tache imageDownload_task %i", ret1);
}
BaseType_t ret2 = xTaskCreate(&updateTime, "updateTimeTask", 3 * 1024, NULL, 5, NULL);
if (ret2 != pdPASS)
{
ESP_LOGE(TAG, "Impossiblke de creer la tache updateTimeTask %i", ret2);
}
mqtt_app_start(mqtt_cb);
start_wifi_logger();
wifi_log_e("test", "%s %d %f", "hello world wifi logger", 43, 45.341223242); // write log over wifi with log level -> ERROR }
//esp_log_level_set("tcp_handler", ESP_LOG_NONE);
printf("8b - Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
printf("9 - Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
on_weather_data_retrieval(weather_data_retreived);
on_weather_data_retrieval_start(weather_data_retreived_start);
initialise_weather_data_retrieval(600000);
ESP_LOGW(TAG, "Weather data retrieval initialized");
time_t now;
struct tm timeinfo;
@ -514,21 +678,6 @@ void app_main(void)
printf("11. Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
ESP_LOGW(TAG, "On telecharge l'image cuve");
TaskHandle_t xHandle = NULL;
BaseType_t ret1;
ret1 = xTaskCreate(&imgdwn, "imageDownload_task", 3 * 1024, NULL, 5, &xHandle);
if (ret1 != pdPASS)
{
ESP_LOGE(TAG, "Impossiblke de creer la tache imageDownload_task %i", ret1);
}
BaseType_t ret2 = xTaskCreate(&updateTime, "updateTimeTask", 3 * 1024, NULL, 5, NULL);
if (ret2 != pdPASS)
{
ESP_LOGE(TAG, "Impossiblke de creer la tache updateTimeTask %i", ret2);
}
printf("12. Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
// Show LVGL objects
@ -539,7 +688,8 @@ void app_main(void)
ESP_LOGE(TAG,"Impossible d'obtenir le mutex pour draw_ihm");
}
mqtt_app_start();
lv_subject_init_int(&mqttStatus,-1);
lv_subject_add_observer_obj(&mqttStatus, mqttStatus_obs_cb, NULL, NULL);

View File

@ -1,2 +1,2 @@
#pragma once
#include "mqtt_client.h"
#define WIFI_CONNECTED_BIT BIT0

View File

@ -4,6 +4,7 @@
#include "obtain_time.h"
#include "esp_lvgl_port.h"
#include "ihm.h"
#include "main.h"
static const char *TAG = "sntp";
extern lv_subject_t dateHeureSubj;
@ -19,23 +20,40 @@ void time_sync_notification_cb(struct timeval *tv)
// Set timezone to Eastern Standard Time and print local time
time_t now;
struct tm timeinfo;
localtime_r(&now, &timeinfo);
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
time(&now);
localtime_r(&now, &timeinfo);
//strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
sprintf(strftime_buf, "%s %d %s %02d:%02d", days[timeinfo.tm_wday], timeinfo.tm_mday, months[timeinfo.tm_mon], timeinfo.tm_hour, timeinfo.tm_min);
localtime_r(&now, &timeinfo);
draw_time(strftime_buf);
}
void obtain_time()
{
}
/* FreeRTOS event group to signal when we are connected*/
EventGroupHandle_t domotic_event_group;
void updateTime(void *pvParameter)
{
// Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum
// number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above)
EventBits_t bits = xEventGroupWaitBits(domotic_event_group,
WIFI_CONNECTED_BIT,
pdFALSE,
pdFALSE,
portMAX_DELAY);
if (bits & WIFI_CONNECTED_BIT)
{
ESP_LOGI(TAG, "Initializing and starting SNTP");
esp_sntp_config_t config = ESP_NETIF_SNTP_DEFAULT_CONFIG("pool.ntp.org");
config.sync_cb = time_sync_notification_cb; // Note: This is only needed if we want
esp_netif_sntp_init(&config);
}
}
void updateTime(void *pvParameter)
{
char strftime_buf[64];
time_t now = 0;

View File

@ -1240,7 +1240,7 @@ CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_USE_MALLOC=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set
CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set
@ -1371,7 +1371,6 @@ CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=16
CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=32
CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0
CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5
CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y
@ -1683,7 +1682,6 @@ CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4
CONFIG_LWIP_TCP_OVERSIZE_MSS=y
# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set
# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set
# CONFIG_LWIP_WND_SCALE is not set
CONFIG_LWIP_TCP_RTO_TIME=1500
# end of TCP
@ -2398,9 +2396,9 @@ CONFIG_ESP_WIFI_REMOTE_LIBRARY_HOSTED=y
CONFIG_WIFI_RMT_STATIC_RX_BUFFER_NUM=10
CONFIG_WIFI_RMT_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_WIFI_RMT_STATIC_TX_BUFFER=y
# CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER is not set
CONFIG_WIFI_RMT_TX_BUFFER_TYPE=0
CONFIG_WIFI_RMT_STATIC_TX_BUFFER_NUM=16
CONFIG_WIFI_RMT_CACHE_TX_BUFFER_NUM=32
CONFIG_WIFI_RMT_STATIC_RX_MGMT_BUFFER=y
# CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUFFER is not set
CONFIG_WIFI_RMT_DYNAMIC_RX_MGMT_BUF=0
@ -2410,7 +2408,6 @@ CONFIG_WIFI_RMT_AMPDU_TX_ENABLED=y
CONFIG_WIFI_RMT_TX_BA_WIN=6
CONFIG_WIFI_RMT_AMPDU_RX_ENABLED=y
CONFIG_WIFI_RMT_RX_BA_WIN=6
# CONFIG_WIFI_RMT_AMSDU_TX_ENABLED is not set
CONFIG_WIFI_RMT_NVS_ENABLED=y
CONFIG_WIFI_RMT_SOFTAP_BEACON_MAX_LEN=752
CONFIG_WIFI_RMT_MGMT_SBUF_NUM=32
@ -2634,7 +2631,7 @@ CONFIG_LV_ASSERT_HANDLER_INCLUDE="assert.h"
# CONFIG_LV_ENABLE_GLOBAL_CUSTOM is not set
CONFIG_LV_CACHE_DEF_SIZE=0
CONFIG_LV_IMAGE_HEADER_CACHE_DEF_CNT=0
CONFIG_LV_GRADIENT_MAX_STOPS=50
CONFIG_LV_GRADIENT_MAX_STOPS=2
CONFIG_LV_COLOR_MIX_ROUND_OFS=128
# CONFIG_LV_OBJ_STYLE_CACHE is not set
# CONFIG_LV_USE_OBJ_ID is not set
@ -2832,7 +2829,7 @@ CONFIG_LV_USE_LODEPNG=y
# CONFIG_LV_USE_PROFILER is not set
CONFIG_LV_USE_MONKEY=y
# CONFIG_LV_USE_GRIDNAV is not set
CONFIG_LV_USE_FRAGMENT=y
# CONFIG_LV_USE_FRAGMENT is not set
# CONFIG_LV_USE_IMGFONT is not set
CONFIG_LV_USE_OBSERVER=y
# CONFIG_LV_USE_IME_PINYIN is not set
@ -2953,7 +2950,6 @@ CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16
CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
@ -3056,7 +3052,6 @@ CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16
CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y

View File

@ -76,3 +76,11 @@ CONFIG_LV_FS_STDIO_CACHE_SIZE=0
# Necessaire pour lire le png
CONFIG_LV_USE_LODEPNG=y
#Dégradés
CONFIG_LV_USE_DRAW_SW_COMPLEX_GRADIENTS=y
#Necessaire pour compiler avec les struct internes
CONFIG_LV_USE_PRIVATE_API=y
CONFIG_SPIRAM_USE_MALLOC=y

File diff suppressed because it is too large Load Diff