Merge branch 'to_queue_and_notifications'

This commit is contained in:
marc 2025-05-08 19:57:39 +02:00
commit 348a1ea972
33 changed files with 1199 additions and 1043 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,16 @@ set(COMPONENTS main)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS
if(${IDF_TARGET} STREQUAL "esp32p4")
set(EXTRA_COMPONENT_DIRS
/home/marc/esp-dev-kits/examples/esp32-p4-function-ev-board/examples/common_components
$ENV{IDF_PATH}/examples/protocols/linux_stubs/esp_stubs
)
else()
set(EXTRA_COMPONENT_DIRS
$ENV{IDF_PATH}/examples/protocols/linux_stubs/esp_stubs
)
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,2 +0,0 @@
void mqtt_app_start(void);
void wifi_init_sta(void);

View File

@ -14,11 +14,8 @@
#include "esp_event.h"
#include "esp_log.h"
#include "esp_timer.h"
#include "lwip/err.h"
#include "lwip/sys.h"
// HTTP Client + time
// HTTP Client
#include "esp_http_client.h"
#include "esp_sntp.h"
#include <string.h>
#include <sys/unistd.h>
@ -127,15 +124,15 @@ esp_err_t _http_event_handler_id(esp_http_client_event_t *evt)
case HTTP_EVENT_ON_FINISH:
// Do not draw if it's a redirect (302)
if (esp_http_client_get_status_code(evt->client) == 200) {
printf("%li bytes read from %s\nIMG_BUF size: %li\n", img_buf_pos, IMGDWN_URL, img_buf_pos);
printf("%"PRIu32" bytes read from %s\nIMG_BUF size: %"PRIu32"\n", img_buf_pos, IMGDWN_URL, img_buf_pos);
//drawBufJpeg(source_buf, 0, 0);
create_file_app(source_buf,img_buf_pos); //function which opens and records data to spiffs file
time_download = (esp_timer_get_time()-startTime)/1000;
ESP_LOGI("www-dw", "%li ms - download", time_download);
ESP_LOGI("www-dw", "%"PRIu32" ms - download", time_download);
// Refresh display
//display.update();
ESP_LOGI("total", "%li ms - total time spent\n", time_download+time_decomp+time_render);
ESP_LOGI("total", "%"PRIu32" ms - total time spent\n", time_download+time_decomp+time_render);
} else {
printf("HTTP on finish got status code: %d\n", esp_http_client_get_status_code(evt->client));
}
@ -168,7 +165,7 @@ static void download(void)
esp_err_t err = esp_http_client_perform(client);
if (err == ESP_OK)
{
ESP_LOGI(TAG, "\nIMAGE URL: %s\n\nHTTP GET Status = %d, content_length = %lli\n",
ESP_LOGI(TAG, "\nIMAGE URL: %s\n\nHTTP GET Status = %d, content_length = %"PRIi64"\n",
IMGDWN_URL,
esp_http_client_get_status_code(client),
esp_http_client_get_content_length(client));
@ -180,12 +177,21 @@ static void download(void)
//printf("Go to sleep %d minutes\n", CONFIG_DEEPSLEEP_MINUTES_AFTER_RENDER);
esp_http_client_cleanup(client);
vTaskDelay(3600000 / portTICK_PERIOD_MS);
//deepsleep();
}
void imgdwn(void *pvParameter) {
void imgdwn(void *domotic_event_group) {
while(1){
// 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,
BIT0,
pdFALSE,
pdFALSE,
portMAX_DELAY);
if (bits & BIT0)
{
ESP_LOGE(TAG, "beginning");
// Should be big enough to allocate the JPEG file size, width * height should suffice
@ -193,12 +199,18 @@ void imgdwn(void *pvParameter) {
if (source_buf == NULL) {
ESP_LOGE(TAG, "Initial alloc source_buf failed!");
}
printf("Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
printf("Free heap after buffers allocation: %"PRIu16"\n", xPortGetFreeHeapSize());
download();
heap_caps_free(source_buf);
printf("Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
printf("Free heap after buffers allocation: %"PRIu16"\n", xPortGetFreeHeapSize());
vTaskDelay(3600000 / portTICK_PERIOD_MS);
}else{
vTaskDelay(5000 / portTICK_PERIOD_MS);
}
}
}

View File

@ -1,2 +1,2 @@
void imgdwn();
void imgdwn(void* evtGroup);
#pragma once

View File

@ -60,5 +60,5 @@ void printff(struct meteoforecast_data *tmp);
void on_weather_data_retrieval(weather_data_callback data_retreived_cb);
void on_weather_data_retrieval_start(weather_data_callback data_retreived_cb);
void initialise_weather_data_retrieval(unsigned long retreival_period);
void initialise_weather_data_retrieval(unsigned long retreival_period, void* evtGroup);

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
@ -129,7 +128,11 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
if (evt->user_data)
{
// The last byte in evt->user_data is kept for the NULL character in case of out-of-bound access.
copy_len = MIN(evt->data_len, (MAX_HTTP_OUTPUT_BUFFER - output_len));
if(evt->data_len<(MAX_HTTP_OUTPUT_BUFFER - output_len)){
copy_len = evt->data_len;
}else{
copy_len=(MAX_HTTP_OUTPUT_BUFFER - output_len);
}
if (copy_len)
{
memcpy(evt->user_data + output_len, evt->data, copy_len);
@ -149,7 +152,11 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
return ESP_FAIL;
}
}
copy_len = MIN(evt->data_len, (content_len - output_len));
if(evt->data_len<(content_len - output_len)){
copy_len = evt->data_len;
}else{
copy_len=(content_len - output_len);
}
if (copy_len)
{
memcpy(output_buffer + output_len, evt->data, copy_len);
@ -172,7 +179,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 +191,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");
@ -315,16 +322,19 @@ static bool process_response_body(const char *body)
return true;
}
static void http_request_task(void *pvParameter)
static void http_request_task(void* domotic_event_group)
{
while (1)
{
if(!mainState.wifi_init){
//On attend le wifi
ESP_LOGI(TAG, "Pas de wifi on attend 5 secondes");
vTaskDelay(10000 / portTICK_PERIOD_MS);
}else{
ESP_LOGE(TAG,"En attente connexion wifi");
// Waiting until either the connection is established (WIFI_CONNECTED_BIT).
EventBits_t bits = xEventGroupWaitBits(domotic_event_group,
BIT0,
pdFALSE,
pdFALSE,
portMAX_DELAY);
if (bits & BIT0){
ESP_LOGE(TAG,"connexion wifi ok");
ESP_LOGV(TAG, "Début recup méteo --------------------------");
weather.data_retreived_cb_start(NULL);
char *local_response_buffer = heap_caps_malloc((MAX_HTTP_OUTPUT_BUFFER + 1) * (sizeof(char)), MALLOC_CAP_SPIRAM);
@ -376,8 +386,10 @@ static void http_request_task(void *pvParameter)
ESP_LOGI(TAG, "Données non valides on attend avant de retenter");
vTaskDelay(30000 / portTICK_PERIOD_MS);
}
}
}else{
ESP_LOGI(TAG, "Wifi non connecté");
}
}
}
@ -391,7 +403,7 @@ void on_weather_data_retrieval_start(weather_data_callback data_retreived_cb_sta
weather.data_retreived_cb_start = data_retreived_cb_start;
}
void initialise_weather_data_retrieval(unsigned long retreival_period)
void initialise_weather_data_retrieval(unsigned long retreival_period, void* domotic_event_group)
{
weather.retreival_period = retreival_period;
@ -399,9 +411,9 @@ void initialise_weather_data_retrieval(unsigned long retreival_period)
// http_client_on_process_chunk(&http_client, process_chunk);
// http_client_on_disconnected(&http_client, disconnected);
TaskHandle_t xHandle = NULL;
BaseType_t ret1 = xTaskCreate(&http_request_task, "http_meteof", 5 * 1024, NULL, 5, &xHandle);
BaseType_t ret1 = xTaskCreatePinnedToCore(&http_request_task, "http_meteof", 5 * 1024, domotic_event_group, 5, &xHandle, 1);
if(ret1!=pdPASS ){
ESP_LOGE(TAG, "Impossible de creer la tache %i", ret1);
ESP_LOGE(TAG, "Impossible de creer la tache %"PRIi16, ret1);
}
ESP_LOGI(TAG, "HTTP request task started");
}

View File

@ -1,8 +1,14 @@
set(EXTRA_COMPONENT_DIRS ../components)
set(comps heap nvs_flash meteofrance esp_netif image_downloader fatfs protocol_examples_common mqtt esp_wifi)
if(${IDF_TARGET} STREQUAL "esp32p4")
list(APPEND comps bsp_extra esp32_p4_function_ev_board sdmmc vfs littlefs wifi_logger app_update esp_https_ota)
endif()
idf_component_register(SRC_DIRS . fonts
INCLUDE_DIRS "."
REQUIRES heap nvs_flash meteofrance communication esp_netif image_downloader fatfs sdmmc vfs littlefs wifi_logger protocol_examples_common app_update esp_https_ota bsp_extra esp32_p4_function_ev_board
REQUIRES ${comps}
EMBED_TXTFILES ${project_dir}/main/ca_cert.pem)
@ -11,6 +17,14 @@ 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_add_images(${COMPONENT_LIB} "images/")
if(${IDF_TARGET} STREQUAL "esp32p4")
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)
endif()
littlefs_create_partition_image(littlefs images_meteo FLASH_IN_PROJECT)

View File

@ -1,72 +1,15 @@
#include "communication.h"
#include "include/communication.h"
#include "esp_log.h"
#include "esp_lvgl_port.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)
{
@ -99,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
*
@ -118,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);
@ -152,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;
@ -172,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");
@ -254,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, EventGroupHandle_t domotic_event_group)
{
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};
@ -299,12 +169,19 @@ void mqtt_app_start(void)
client = esp_mqtt_client_init(&mqtt_cfg);
/* The last argument may be used to pass data to the event handler, in this example mqtt_event_handler */
esp_mqtt_client_register_event(client, ESP_EVENT_ANY_ID, mqtt_event_handler, NULL);
// 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,
BIT0,
pdFALSE,
pdFALSE,
portMAX_DELAY);
if (bits & BIT0)
{
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;
@ -324,40 +201,8 @@ static EventGroupHandle_t s_wifi_event_group;
#define ESP_WIFI_SCAN_AUTH_MODE_THRESHOLD WIFI_AUTH_WPA2_PSK
static int s_retry_num = 0;
wifi_callback cb;
static lv_subject_t wifiStatus;
LV_IMAGE_DECLARE(wifi_ok);
LV_IMAGE_DECLARE(wifi_ko);
static void wifiStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject);
static void wifiStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject)
{
ESP_LOGE(TAG, "On passe dans le callback de chgt de statut; %li", lv_subject_get_int(subject));
bsp_display_lock(0);
lv_obj_t * wifiSt = lv_obj_get_child(lv_obj_get_child(lv_layer_top(), 0),2);
if(lv_obj_check_type(wifiSt, &lv_image_class)){
switch (lv_subject_get_int(subject))
{
case 0:
lv_image_set_src(wifiSt,&wifi_ko);
break;
case 1:
lv_image_set_src(wifiSt,&wifi_ok);
break;
default:
break;
}
}else{
ESP_LOGE(TAG, "L'objet recuip en semble pas etre du bon type");
}
bsp_display_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 wifi_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
{
@ -367,11 +212,6 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base, int32_t e
}
else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED)
{
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 0");
lv_subject_set_int(&wifiStatus,0);
lvgl_port_unlock();
}
if (s_retry_num < EXAMPLE_ESP_MAXIMUM_RETRY)
{
esp_wifi_connect();
@ -380,27 +220,24 @@ 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(WIFI_DISCONNECTED);
ESP_LOGI(TAG, "connect to the AP fail");
}
else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP)
{
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 1");
lv_subject_set_int(&wifiStatus,1);
lvgl_port_unlock();
}
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);
mainState.wifi_init=true;
cb(WIFI_CONNECTED);
//xEventGroupSetBits(s_wifi_event_group, WIFI_CONNECTED_BIT);
}
}
void wifi_init_sta(void)
void wifi_init_sta(wifi_callback callback)
{
s_wifi_event_group = xEventGroupCreate();
cb=callback;
//s_wifi_event_group = xEventGroupCreate();
ESP_ERROR_CHECK(esp_netif_init());
@ -442,48 +279,32 @@ void wifi_init_sta(void)
ESP_ERROR_CHECK(esp_wifi_start());
ESP_LOGI(TAG, "wifi_init_sta finished.");
lv_subject_init_int(&wifiStatus,0);
lv_subject_add_observer_obj(&wifiStatus, wifiStatus_obs_cb, NULL, NULL);
/* 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) */
/*
// 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(s_wifi_event_group,
WIFI_CONNECTED_BIT | WIFI_FAIL_BIT,
pdFALSE,
pdFALSE,
portMAX_DELAY);
/* xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually
* happened. */
// xEventGroupWaitBits() returns the bits before the call returned, hence we can test which event actually
// happened.
if (bits & WIFI_CONNECTED_BIT)
{
ESP_LOGI(TAG, "connected to ap SSID:%s", EXAMPLE_ESP_WIFI_SSID);
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 1");
lv_subject_set_int(&wifiStatus,1);
lvgl_port_unlock();
}
cb(CONNECTED);
}
else if (bits & WIFI_FAIL_BIT)
{
cb(CONNECT_FAIL);
ESP_LOGI(TAG, "Failed to connect to SSID:%s, password:%s",
EXAMPLE_ESP_WIFI_SSID, EXAMPLE_ESP_WIFI_PASS);
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 0");
lv_subject_set_int(&wifiStatus,0);
lvgl_port_unlock();
}
}
else
{
ESP_LOGE(TAG, "UNEXPECTED EVENT");
if(lvgl_port_lock(0)){
ESP_LOGE(TAG,"Statut Wifi 0");
lv_subject_set_int(&wifiStatus,0);
lvgl_port_unlock();
}
}
*/
}

View File

@ -1,12 +1,23 @@
dependencies:
espressif/esp_wifi_remote: "0.8.5"
#espressif/esp32_p4_function_ev_board: "^4.1.1"
suda-morris/am2302_rmt: "^1.0.0"
espressif/esp_websocket_client: "^1.3.0"
joltwallet/littlefs: ^1.14.8
espressif/esp_wifi_remote:
rules:
- if: target in ["esp32p4"]
version: "0.8.5"
suda-morris/am2302_rmt:
version: "^1.0.0"
rules:
- if: target in ["esp32p4"]
joltwallet/littlefs:
rules:
- if: target in ["esp32p4"]
version: "^1.14.8"
esp_lcd_touch_gt911:
version: ^1
rules:
- if: target in ["esp32p4"]
esp_lvgl_port:
rules:
- if: target in ["esp32p4"]
version: 2.5.0
idf:
version: '5.4.*'
@ -14,11 +25,3 @@ dependencies:
version: 9.2.0
#espressif/esp32_p4_function_ev_board:
# version: "4.1.*"
chmorgan/esp-audio-player:
version: "1.0.*"
public: true
chmorgan/esp-file-iterator:
version: "1.0.0"
public: true

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;
@ -38,6 +37,86 @@ char dateHeureStr[30];
static lv_style_t no_padding;
static const char *TAG = "IHM";
static lv_subject_t wifiStatus;
LV_IMAGE_DECLARE(wifi_ok);
LV_IMAGE_DECLARE(wifi_ko);
static void wifiStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject)
{
ESP_LOGE(TAG, "On passe dans le callback de chgt de statut; %li", lv_subject_get_int(subject));
bsp_display_lock(0);
if(lv_layer_top()!=NULL && lv_obj_get_child_cnt(lv_layer_top())){
lv_obj_t * wifiSt = lv_obj_get_child(lv_obj_get_child(lv_layer_top(), 0),2);
if(lv_obj_check_type(wifiSt, &lv_image_class)){
switch (lv_subject_get_int(subject))
{
case 0:
lv_image_set_src(wifiSt,&wifi_ko);
break;
case 1:
lv_image_set_src(wifiSt,&wifi_ok);
break;
default:
break;
}
}else{
ESP_LOGE(TAG, "L'objet recuip en semble pas etre du bon type");
}
}else{
ESP_LOGI(TAG,"Pour le moment l'icone de statut n'existe pas");
}
bsp_display_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 drawIhm(void *xIHMEventQueue){
init_display();
lv_subject_init_int(&wifiStatus,0);
lv_subject_add_observer_obj(&wifiStatus, wifiStatus_obs_cb, NULL, NULL);
display_lock("app_main");
app_main_display();
display_unlock("app_main");
// Show LVGL objects
if(display_lock("draw_ihm")){
draw_ihm();
display_unlock("draw_ihm");
}else{
ESP_LOGE(TAG,"Impossible d'obtenir le mutex pour draw_ihm");
}
while (1)
{
xIPStackEvent_t xReceivedEvent;
// On cree une queue qui va permettre de recevoir les informations a afficher
xQueueReceive(xIHMEventQueue,&xReceivedEvent, portMAX_DELAY );
switch (xReceivedEvent.eEventType)
{
case IHM_EVT_WIFI_STATUS:
ESP_LOGE(TAG, "On a recu un evt wifi");
lv_subject_set_int(&wifiStatus, (int)xReceivedEvent.pvData);
break;
case IHM_EVT_TIME_SETTED:
ESP_LOGE(TAG, "On a recu un evt timesetted");
draw_time(xReceivedEvent.pvData);
break;
default:
ESP_LOGE(TAG, "Evt inconnu");
break;
};
vTaskDelay(5/portTICK_PERIOD_MS);
}
}
void draw_time(char* dateHeure){
if(display_lock("updateTime")){
@ -53,6 +132,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 +146,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);
@ -79,9 +159,20 @@ static void event_handler(lv_event_t *e)
}
}
void init_display(){
lvgl_port_cfg_t cfgLVGL = {
.task_priority = 4,
.task_stack = 7168,
.task_affinity = 1, // On se met sur le core 1
.task_max_sleep_ms = 500,
.timer_period_ms = 5,
};
bsp_display_cfg_t cfg = {
.lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
//.lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
.lvgl_port_cfg = cfgLVGL,
.buffer_size = BSP_LCD_DRAW_BUFF_SIZE,
.double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE,
.flags = {
@ -94,8 +185,8 @@ void init_display(){
lv_display_t *dsp = bsp_display_start_with_config(&cfg);
//bsp_display_rotate(dsp,LV_DISP_ROTATION_180);
bsp_display_brightness_set(50);
bsp_display_backlight_on();
bsp_display_brightness_set(30);
mainState.display_init=true;
}
@ -110,6 +201,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,14 +211,11 @@ 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);
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");
lv_theme_t * th = lv_theme_domotic_init(lv_display_get_default());
lv_display_set_theme(lv_disp_get_default(), th); /* Assign theme to display */
@ -251,13 +340,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);
@ -270,6 +359,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
@ -845,56 +935,7 @@ void draw_ihm()
lv_obj_set_flex_flow(tabMeteo, LV_FLEX_FLOW_COLUMN);
}
void weather_data_retreived_start()
{
//if (display_lock("weather_data_retreived_start"))
//{
//ESP_LOGE(TAG,"Mutex obtenu dans weather_data_retreived_start");
lv_subject_set_int(&meteoStatus, 1);
ESP_LOGE(TAG,"Subject setted weather_data_retreived_start");
//display_unlock("weather_data_retreived_start");
//}else{
// ESP_LOGE(TAG,"Impossible d'obtenir le mutex dans weather_data_retreived_start");
//}
}
void weather_data_retreived(struct meteodailyforecast_data dailyDatas[3], struct meteoforecast_data datas[3])
{
/* ESP_LOGE(TAG, "debut debug");
printf("%lld\n", datas[0].datetime);
printf("%s\n", datas[0].previsions.desc);
printf("%f\n", datas[0].previsions.value);
printf("%lld\n", datas[1].datetime);
printf("%s\n", datas[1].previsions.desc);
printf("%f\n", datas[1].previsions.value);
printf("%lld\n", datas[2].datetime);
printf("%s\n", datas[2].previsions.desc);
printf("%f\n", datas[2].previsions.value);
ESP_LOGE(TAG, "fin debug");
*/
if (display_lock("weather_data_retreived"))
{
ESP_LOGV("MeteoFrance", "------------------------------------- Set des subjects J --------------------------------");
// Prévisions des 3 prochains jours
lv_subject_set_pointer(&forecastD1Subj, &dailyDatas[0]);
lv_subject_set_pointer(&forecastD2Subj, &dailyDatas[1]);
lv_subject_set_pointer(&forecastD3Subj, &dailyDatas[2]);
ESP_LOGV("MeteoFrance", "------------------------------------- Set des subjects H--------------------------------");
// Prévisions des 3 prochains jours
ESP_LOGV("MeteoFrance", "Pointeur %lli", datas[0].datetime);
lv_subject_set_pointer(&forecastH1Subj, &datas[0]);
lv_subject_set_pointer(&forecastH2Subj, &datas[1]);
lv_subject_set_pointer(&forecastH3Subj, &datas[2]);
lv_subject_set_int(&meteoStatus, 0);
display_unlock("weather_data_retreived");
ESP_LOGV(TAG, "------------------------------------- Fin Set des subjects --------------------------------");
}else{
ESP_LOGE(TAG, "Impossible d'obtenir le mutex dans weather_data_retreived");
}
}
void log_cb(lv_log_level_t level, const char * buf){
ESP_LOGE(TAG, "%s",buf);
}

View File

@ -30,3 +30,17 @@ void tabChgEvt(lv_event_t *event);
void draw_tabCuve(lv_obj_t * parent);
void draw_tabHome(lv_obj_t * parent);
void draw_tabSettings(lv_obj_t * parent);
typedef enum eIHMEvent_t{
IHM_EVT_WIFI_STATUS,
IHM_EVT_TIME_SETTED
} eIHMEvent_t;
typedef struct IP_TASK_COMMANDS
{
eIHMEvent_t eEventType; /* Tells the receiving task what the event is. */
void *pvData; /* Holds or points to any data associated with the event. */
} xIPStackEvent_t;
void drawIhm(void *pvParameter);

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, EventGroupHandle_t evtGroup);
#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

@ -18,16 +18,11 @@
#include "main.h"
#include "ihm.h"
// OTA
#include "esp_ota_ops.h"
#include "esp_http_client.h"
#include "esp_https_ota.h"
// Includes personnels
#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,6 +47,141 @@ static const char *TAG = "domoTic";
extern esp_mqtt_client_handle_t client;
#define WIFI_RDY 0b0001
EventGroupHandle_t domotic_event_group;
QueueHandle_t ihm_queue;
static void wifiStatus_obs_cb(lv_observer_t * observer, lv_subject_t * subject);
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;
}
}
void send_event(domo_events evt, void* pDatas){
ESP_LOGE(TAG,"On est dans l'event handler %i", evt);
switch(evt){
case EVT_WIFI_CONNECTED:
xEventGroupSetBits(domotic_event_group, WIFI_CONNECTED_BIT);
ESP_LOGI(TAG, "connected to ap SSID");
xIPStackEvent_t evt = {
.eEventType = IHM_EVT_WIFI_STATUS,
.pvData = (void *)true
};
if(xQueueSendToFront( ihm_queue, ( void * ) &evt, ( TickType_t ) 10 ) != pdPASS){
ESP_LOGE(TAG, "La queue est pleine");
};
break;
case EVT_TIME_SETTED:
xIPStackEvent_t m = {
.eEventType = IHM_EVT_TIME_SETTED,
.pvData = pDatas
};
xQueueSendToFront(ihm_queue,&m,5);
break;
}
}
struct state mainState={
.wifi_init=false,
.display_init=false
@ -120,6 +250,7 @@ void mount_sd_card()
extern char *days[7];
extern char *months[12];
/*
esp_err_t _ota_http_event_handler(esp_http_client_event_t *evt)
{
switch (evt->event_id) {
@ -150,10 +281,12 @@ esp_err_t _ota_http_event_handler(esp_http_client_event_t *evt)
}
return ESP_OK;
}
*/
extern const uint8_t server_cert_pem_start[] asm("_binary_ca_cert_pem_start");
extern const uint8_t server_cert_pem_end[] asm("_binary_ca_cert_pem_end");
/*
void simple_ota_example_task(void *pvParameter)
{
ESP_LOGI(TAG, "Starting OTA example task");
@ -197,7 +330,6 @@ void simple_ota_example_task(void *pvParameter)
#ifdef CONFIG_EXAMPLE_SKIP_COMMON_NAME_CHECK
config.skip_cert_common_name_check = true;
#endif
esp_https_ota_config_t ota_config = {
.http_config = &config,
};
@ -212,10 +344,12 @@ void simple_ota_example_task(void *pvParameter)
while (1) {
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
}
*/
am2302_handle_t sensor = NULL;
am2302_handle_t sensor = NULL;
void readTempHumid(void *pvParameter)
{
@ -238,39 +372,143 @@ 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 WIFI_CONNECTED:
mainState.wifi_init=true;
send_event(WIFI_CONNECTED,NULL);
break;
case WIFI_DISCONNECTED:
mainState.wifi_init=true;
send_event(WIFI_DISCONNECTED,NULL);
break;
case WIFI_GOT_IP:
mainState.wifi_init=true;
send_event(WIFI_CONNECTED,NULL);
break;
case WIFI_CONNECT_FAIL:
break;
default:
break;
}
}
extern lv_subject_t forecastD1Subj;
extern lv_subject_t forecastD2Subj;
extern lv_subject_t forecastD3Subj;
extern lv_subject_t forecastH1Subj;
extern lv_subject_t forecastH2Subj;
extern lv_subject_t forecastH3Subj;
extern lv_subject_t meteoStatus;
void weather_data_retreived(struct meteodailyforecast_data dailyDatas[3], struct meteoforecast_data datas[3])
{
/* ESP_LOGE(TAG, "debut debug");
printf("%lld\n", datas[0].datetime);
printf("%s\n", datas[0].previsions.desc);
printf("%f\n", datas[0].previsions.value);
printf("%lld\n", datas[1].datetime);
printf("%s\n", datas[1].previsions.desc);
printf("%f\n", datas[1].previsions.value);
printf("%lld\n", datas[2].datetime);
printf("%s\n", datas[2].previsions.desc);
printf("%f\n", datas[2].previsions.value);
ESP_LOGE(TAG, "fin debug");
*/
if (display_lock("weather_data_retreived"))
{
ESP_LOGV("MeteoFrance", "------------------------------------- Set des subjects J --------------------------------");
// Prévisions des 3 prochains jours
lv_subject_set_pointer(&forecastD1Subj, &dailyDatas[0]);
lv_subject_set_pointer(&forecastD2Subj, &dailyDatas[1]);
lv_subject_set_pointer(&forecastD3Subj, &dailyDatas[2]);
ESP_LOGV("MeteoFrance", "------------------------------------- Set des subjects H--------------------------------");
// Prévisions des 3 prochains jours
ESP_LOGV("MeteoFrance", "Pointeur %lli", datas[0].datetime);
lv_subject_set_pointer(&forecastH1Subj, &datas[0]);
lv_subject_set_pointer(&forecastH2Subj, &datas[1]);
lv_subject_set_pointer(&forecastH3Subj, &datas[2]);
lv_subject_set_int(&meteoStatus, 0);
display_unlock("weather_data_retreived");
ESP_LOGV(TAG, "------------------------------------- Fin Set des subjects --------------------------------");
}else{
ESP_LOGE(TAG, "Impossible d'obtenir le mutex dans weather_data_retreived");
}
}
void weather_data_retreived_start()
{
//if (display_lock("weather_data_retreived_start"))
//{
//ESP_LOGE(TAG,"Mutex obtenu dans weather_data_retreived_start");
lv_subject_set_int(&meteoStatus, 1);
ESP_LOGE(TAG,"Subject setted weather_data_retreived_start");
//display_unlock("weather_data_retreived_start");
//}else{
// ESP_LOGE(TAG,"Impossible d'obtenir le mutex dans 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)
{
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);
heap_caps_register_failed_alloc_callback(alloc_fail);
printf("1- Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
domotic_event_group = xEventGroupCreate();
ihm_queue = xQueueCreate(10,sizeof(xIPStackEvent_t));
esp_log_level_set("wifi", ESP_LOG_ERROR);
esp_log_level_set(TAG, ESP_LOG_VERBOSE);
printf("2- Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
//mount_sd_card();
bsp_sdcard_mount();
//lv_log_register_print_cb(log_cb);
// LCD HW initialization
//ESP_ERROR_CHECK(app_lcd_init());
printf("4 - Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
// Touch initialization
//ESP_ERROR_CHECK(app_touch_init());
printf("5 - Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
// LVGL initialization
//ESP_ERROR_CHECK(app_lvgl_init());
printf("6 - Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
ESP_LOGI(TAG, "Initializing LittleFS");
esp_vfs_littlefs_conf_t conflfs = {
@ -307,12 +545,8 @@ void app_main(void)
// On affiche au plus tot l'ecran de démarrage
// ESP_ERROR_CHECK(esp_lcd_panel_mirror(lcd_panel,true,true));
init_display();
display_lock("app_main");
app_main_display();
display_unlock("app_main");
xTaskCreatePinnedToCore(&drawIhm,"ihm_task",10000,ihm_queue,10,NULL,0);
printf("7 - Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
// Initialize NVS
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
@ -322,63 +556,37 @@ void app_main(void)
}
ESP_ERROR_CHECK(ret);
printf("8 - Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
ESP_LOGI(TAG, "ESP_WIFI_MODE_STA");
wifi_init_sta();
//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());
wifi_init_sta(wifi_cb);
time_t now;
struct tm timeinfo;
time(&now);
localtime_r(&now, &timeinfo);
// Is time set? If not, tm_year will be (1970 - 1900).
if (timeinfo.tm_year < (2016 - 1900))
{
ESP_LOGI(TAG, "Time is not set yet. Connecting to WiFi and getting time over NTP.");
obtain_time();
// update 'now' variable with current time
time(&now);
}
printf("10. Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
heap_caps_print_heap_info(MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
printf("11. Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
ESP_LOGW(TAG, "On telecharge l'image cuve");
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, domotic_event_group);
TaskHandle_t xHandle = NULL;
BaseType_t ret1;
ret1 = xTaskCreate(&imgdwn, "imageDownload_task", 3 * 1024, NULL, 5, &xHandle);
ret1 = xTaskCreate(&imgdwn, "imageDownload_task", 3 * 1024, domotic_event_group, 5, &xHandle);
if (ret1 != pdPASS)
{
ESP_LOGE(TAG, "Impossiblke de creer la tache imageDownload_task %i", ret1);
}
/* Tache updateTime */
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);
}
/* Tache updateTime - FIN*/
printf("12. Free heap after buffers allocation: %d\n", xPortGetFreeHeapSize());
// Show LVGL objects
if(display_lock("draw_ihm")){
draw_ihm();
display_unlock("draw_ihm");
}else{
ESP_LOGE(TAG,"Impossible d'obtenir le mutex pour draw_ihm");
}
mqtt_app_start();
mqtt_app_start(mqtt_cb, domotic_event_group);
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 }
lv_subject_init_int(&mqttStatus,-1);
lv_subject_add_observer_obj(&mqttStatus, mqttStatus_obs_cb, NULL, NULL);
// Configuration de la sonde Temp/Humid.
am2302_config_t am2302_config = {
@ -388,8 +596,6 @@ void app_main(void)
.clk_src = RMT_CLK_SRC_DEFAULT,
};
ESP_ERROR_CHECK(am2302_new_sensor_rmt(&am2302_config, &rmt_config, &sensor));
xTaskCreate(&readTempHumid, "read_temp_task", 8192, NULL, 5, NULL);
//xTaskCreate(&simple_ota_example_task, "ota_example_task", 8192, NULL, 5, NULL);

View File

@ -1,2 +1,7 @@
#pragma once
#include "mqtt_client.h"
#define WIFI_CONNECTED_BIT BIT0
typedef enum domo_events{
EVT_WIFI_CONNECTED,
EVT_TIME_SETTED
} domo_events;
void send_event(domo_events evt, void* pDatas);

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;
@ -17,42 +18,52 @@ void time_sync_notification_cb(struct timeval *tv)
char strftime_buf[64];
// Set timezone to Eastern Standard Time and print local time
setenv("TZ", "CET-1CEST,M3.5.0,M10.5.0/3", 1);
tzset();
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);
send_event(EVT_TIME_SETTED,&strftime_buf);
}
void obtain_time()
{
}
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;
while (1)
{
time(&now);
setenv("TZ", "CET-1CEST,M3.5.0,M10.5.0/3", 1);
tzset();
struct tm timeinfo = {0};
localtime_r(&now, &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);
draw_time(strftime_buf);
/*
lv_obj_refr_size(lv_obj_get_child(lv_obj_get_child(lv_layer_top(),0),0));
lv_obj_refr_size(lv_obj_get_child(lv_layer_top(),0));
lvgl_port_unlock();
}*/
send_event(EVT_TIME_SETTED,&strftime_buf);
vTaskDelay(60000 / portTICK_PERIOD_MS);
}
}

View File

@ -1,3 +1,5 @@
#pragma once
void obtain_time();
void updateTime(void *pvParameter);
#pragma once
extern EventGroupHandle_t domotic_event_group;

142
sdkconfig
View File

@ -1041,7 +1041,7 @@ CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000
# ESP HTTPS OTA
#
# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set
CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP=y
# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set
CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000
# end of ESP HTTPS OTA
@ -1213,6 +1213,7 @@ CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y
#
# CONFIG_PM_ENABLE is not set
# CONFIG_PM_SLP_IRAM_OPT is not set
CONFIG_PM_SLP_DEFAULT_PARAMS_OPT=y
# CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP is not set
# end of Power Management
@ -1240,7 +1241,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
@ -1369,9 +1370,8 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y
# CONFIG_ESP_HOST_WIFI_ENABLED is not set
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_TX_BUFFER_TYPE=1
CONFIG_ESP_WIFI_DYNAMIC_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
@ -1382,11 +1382,13 @@ CONFIG_ESP_WIFI_NVS_ENABLED=y
CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752
CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32
CONFIG_ESP_WIFI_IRAM_OPT=y
CONFIG_ESP_WIFI_EXTRA_IRAM_OPT=y
CONFIG_ESP_WIFI_RX_IRAM_OPT=y
CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y
CONFIG_ESP_WIFI_ENABLE_SAE_PK=y
CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y
CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y
CONFIG_ESP_WIFI_SLP_IRAM_OPT=y
CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50
CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10
CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15
@ -1683,7 +1685,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
@ -2359,12 +2360,6 @@ CONFIG_ESP_LCD_TOUCH_MAX_POINTS=5
CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS=1
# end of ESP LCD TOUCH
#
# ESP WebSocket client
#
# CONFIG_ESP_WS_CLIENT_ENABLE_DYNAMIC_BUFFER is not set
# end of ESP WebSocket client
#
# Wi-Fi Remote
#
@ -2397,10 +2392,10 @@ 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_TX_BUFFER_TYPE=0
CONFIG_WIFI_RMT_STATIC_TX_BUFFER_NUM=16
CONFIG_WIFI_RMT_CACHE_TX_BUFFER_NUM=32
# CONFIG_WIFI_RMT_STATIC_TX_BUFFER is not set
CONFIG_WIFI_RMT_DYNAMIC_TX_BUFFER=y
CONFIG_WIFI_RMT_TX_BUFFER_TYPE=1
CONFIG_WIFI_RMT_DYNAMIC_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,18 +2405,17 @@ 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
CONFIG_WIFI_RMT_IRAM_OPT=y
# CONFIG_WIFI_RMT_EXTRA_IRAM_OPT is not set
CONFIG_WIFI_RMT_EXTRA_IRAM_OPT=y
CONFIG_WIFI_RMT_RX_IRAM_OPT=y
CONFIG_WIFI_RMT_ENABLE_WPA3_SAE=y
CONFIG_WIFI_RMT_ENABLE_SAE_PK=y
CONFIG_WIFI_RMT_SOFTAP_SAE_SUPPORT=y
CONFIG_WIFI_RMT_ENABLE_WPA3_OWE_STA=y
# CONFIG_WIFI_RMT_SLP_IRAM_OPT is not set
CONFIG_WIFI_RMT_SLP_IRAM_OPT=y
CONFIG_WIFI_RMT_SLP_DEFAULT_MIN_ACTIVE_TIME=50
CONFIG_WIFI_RMT_SLP_DEFAULT_MAX_ACTIVE_TIME=10
CONFIG_WIFI_RMT_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15
@ -2515,8 +2509,8 @@ CONFIG_LV_USE_CLIB_MALLOC=y
# CONFIG_LV_USE_MICROPYTHON_MALLOC is not set
# CONFIG_LV_USE_RTTHREAD_MALLOC is not set
# CONFIG_LV_USE_CUSTOM_MALLOC is not set
CONFIG_LV_USE_BUILTIN_STRING=y
# CONFIG_LV_USE_CLIB_STRING is not set
# CONFIG_LV_USE_BUILTIN_STRING is not set
CONFIG_LV_USE_CLIB_STRING=y
# CONFIG_LV_USE_CUSTOM_STRING is not set
# CONFIG_LV_USE_BUILTIN_SPRINTF is not set
CONFIG_LV_USE_CLIB_SPRINTF=y
@ -2526,7 +2520,7 @@ CONFIG_LV_USE_CLIB_SPRINTF=y
#
# HAL Settings
#
CONFIG_LV_DEF_REFR_PERIOD=33
CONFIG_LV_DEF_REFR_PERIOD=10
CONFIG_LV_DPI_DEF=130
# end of HAL Settings
@ -2587,26 +2581,7 @@ CONFIG_LV_USE_DRAW_SW_ASM=0
#
# Logging
#
CONFIG_LV_USE_LOG=y
# CONFIG_LV_LOG_LEVEL_TRACE is not set
# CONFIG_LV_LOG_LEVEL_INFO is not set
# CONFIG_LV_LOG_LEVEL_WARN is not set
CONFIG_LV_LOG_LEVEL_ERROR=y
# CONFIG_LV_LOG_LEVEL_USER is not set
# CONFIG_LV_LOG_LEVEL_NONE is not set
CONFIG_LV_LOG_LEVEL=3
CONFIG_LV_LOG_PRINTF=y
# CONFIG_LV_LOG_USE_TIMESTAMP is not set
# CONFIG_LV_LOG_USE_FILE_LINE is not set
# CONFIG_LV_LOG_TRACE_MEM is not set
# CONFIG_LV_LOG_TRACE_TIMER is not set
# CONFIG_LV_LOG_TRACE_INDEV is not set
# CONFIG_LV_LOG_TRACE_DISP_REFR is not set
# CONFIG_LV_LOG_TRACE_EVENT is not set
# CONFIG_LV_LOG_TRACE_OBJ_CREATE is not set
# CONFIG_LV_LOG_TRACE_LAYOUT is not set
# CONFIG_LV_LOG_TRACE_ANIM is not set
# CONFIG_LV_LOG_TRACE_CACHE is not set
# CONFIG_LV_USE_LOG is not set
# end of Logging
#
@ -2614,7 +2589,7 @@ CONFIG_LV_LOG_PRINTF=y
#
CONFIG_LV_USE_ASSERT_NULL=y
CONFIG_LV_USE_ASSERT_MALLOC=y
CONFIG_LV_USE_ASSERT_STYLE=y
# CONFIG_LV_USE_ASSERT_STYLE is not set
# CONFIG_LV_USE_ASSERT_MEM_INTEGRITY is not set
# CONFIG_LV_USE_ASSERT_OBJ is not set
CONFIG_LV_ASSERT_HANDLER_INCLUDE="assert.h"
@ -2634,7 +2609,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
@ -2662,12 +2637,12 @@ CONFIG_LV_USE_PRIVATE_API=y
#
# CONFIG_LV_FONT_MONTSERRAT_8 is not set
# CONFIG_LV_FONT_MONTSERRAT_10 is not set
CONFIG_LV_FONT_MONTSERRAT_12=y
# CONFIG_LV_FONT_MONTSERRAT_12 is not set
CONFIG_LV_FONT_MONTSERRAT_14=y
CONFIG_LV_FONT_MONTSERRAT_16=y
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_FONT_MONTSERRAT_20=y
CONFIG_LV_FONT_MONTSERRAT_22=y
# CONFIG_LV_FONT_MONTSERRAT_16 is not set
# CONFIG_LV_FONT_MONTSERRAT_18 is not set
# CONFIG_LV_FONT_MONTSERRAT_20 is not set
# CONFIG_LV_FONT_MONTSERRAT_22 is not set
# CONFIG_LV_FONT_MONTSERRAT_24 is not set
# CONFIG_LV_FONT_MONTSERRAT_26 is not set
# CONFIG_LV_FONT_MONTSERRAT_28 is not set
@ -2736,41 +2711,46 @@ CONFIG_LV_TXT_LINE_BREAK_LONG_LEN=0
# Widget Usage
#
CONFIG_LV_WIDGETS_HAS_DEFAULT_VALUE=y
# CONFIG_LV_USE_ANIMIMG is not set
# CONFIG_LV_USE_ARC is not set
CONFIG_LV_USE_ANIMIMG=y
CONFIG_LV_USE_ARC=y
CONFIG_LV_USE_BAR=y
CONFIG_LV_USE_BUTTON=y
CONFIG_LV_USE_BUTTONMATRIX=y
# CONFIG_LV_USE_CALENDAR is not set
CONFIG_LV_USE_CALENDAR=y
# CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY is not set
CONFIG_LV_USE_CALENDAR_HEADER_ARROW=y
CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN=y
# CONFIG_LV_USE_CALENDAR_CHINESE is not set
CONFIG_LV_USE_CANVAS=y
CONFIG_LV_USE_CHART=y
CONFIG_LV_USE_CHECKBOX=y
# CONFIG_LV_USE_DROPDOWN is not set
CONFIG_LV_USE_DROPDOWN=y
CONFIG_LV_USE_IMAGE=y
CONFIG_LV_USE_IMAGEBUTTON=y
# CONFIG_LV_USE_KEYBOARD is not set
CONFIG_LV_USE_KEYBOARD=y
CONFIG_LV_USE_LABEL=y
CONFIG_LV_LABEL_TEXT_SELECTION=y
CONFIG_LV_LABEL_LONG_TXT_HINT=y
CONFIG_LV_LABEL_WAIT_CHAR_COUNT=3
# CONFIG_LV_USE_LED is not set
# CONFIG_LV_USE_LINE is not set
# CONFIG_LV_USE_LIST is not set
# CONFIG_LV_USE_MENU is not set
# CONFIG_LV_USE_MSGBOX is not set
CONFIG_LV_USE_LED=y
CONFIG_LV_USE_LINE=y
CONFIG_LV_USE_LIST=y
CONFIG_LV_USE_MENU=y
CONFIG_LV_USE_MSGBOX=y
CONFIG_LV_USE_ROLLER=y
# CONFIG_LV_USE_SCALE is not set
CONFIG_LV_USE_SCALE=y
CONFIG_LV_USE_SLIDER=y
# CONFIG_LV_USE_SPAN is not set
# CONFIG_LV_USE_SPINBOX is not set
# CONFIG_LV_USE_SPINNER is not set
CONFIG_LV_USE_SPAN=y
CONFIG_LV_SPAN_SNIPPET_STACK_SIZE=64
CONFIG_LV_USE_SPINBOX=y
CONFIG_LV_USE_SPINNER=y
CONFIG_LV_USE_SWITCH=y
CONFIG_LV_USE_TEXTAREA=y
CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME=1500
# CONFIG_LV_USE_TABLE is not set
CONFIG_LV_USE_TABLE=y
CONFIG_LV_USE_TABVIEW=y
# CONFIG_LV_USE_TILEVIEW is not set
# CONFIG_LV_USE_WIN is not set
CONFIG_LV_USE_TILEVIEW=y
CONFIG_LV_USE_WIN=y
# end of Widget Usage
#
@ -2828,11 +2808,22 @@ CONFIG_LV_USE_LODEPNG=y
# Others
#
# CONFIG_LV_USE_SNAPSHOT is not set
# CONFIG_LV_USE_SYSMON is not set
CONFIG_LV_USE_SYSMON=y
CONFIG_LV_USE_PERF_MONITOR=y
# CONFIG_LV_PERF_MONITOR_ALIGN_TOP_LEFT is not set
# CONFIG_LV_PERF_MONITOR_ALIGN_TOP_MID is not set
# CONFIG_LV_PERF_MONITOR_ALIGN_TOP_RIGHT is not set
# CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_LEFT is not set
# CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_MID is not set
CONFIG_LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT=y
# CONFIG_LV_PERF_MONITOR_ALIGN_LEFT_MID is not set
# CONFIG_LV_PERF_MONITOR_ALIGN_RIGHT_MID is not set
# CONFIG_LV_PERF_MONITOR_ALIGN_CENTER is not set
# CONFIG_LV_USE_PERF_MONITOR_LOG_MODE is not set
# CONFIG_LV_USE_PROFILER is not set
CONFIG_LV_USE_MONKEY=y
# CONFIG_LV_USE_MONKEY is not set
# 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
@ -2875,7 +2866,6 @@ CONFIG_LV_USE_OBSERVER=y
# CONFIG_LV_USE_DEMO_RENDER is not set
# CONFIG_LV_USE_DEMO_SCROLL is not set
# CONFIG_LV_USE_DEMO_STRESS is not set
# CONFIG_LV_USE_DEMO_TRANSFORM is not set
# CONFIG_LV_USE_DEMO_MUSIC is not set
# CONFIG_LV_USE_DEMO_FLEX_LAYOUT is not set
# CONFIG_LV_USE_DEMO_MULTILANG is not set
@ -2921,7 +2911,7 @@ CONFIG_STACK_CHECK_NONE=y
# CONFIG_EVENT_LOOP_PROFILING is not set
CONFIG_POST_EVENTS_FROM_ISR=y
CONFIG_POST_EVENTS_FROM_IRAM_ISR=y
CONFIG_OTA_ALLOW_HTTP=y
# CONFIG_OTA_ALLOW_HTTP is not set
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
CONFIG_MAIN_TASK_STACK_SIZE=3584
@ -2951,9 +2941,8 @@ CONFIG_IPC_TASK_STACK_SIZE=1024
CONFIG_TIMER_TASK_STACK_SIZE=3584
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_TX_BUFFER_TYPE=1
CONFIG_ESP32_WIFI_DYNAMIC_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
@ -3054,9 +3043,8 @@ CONFIG_TO_WIFI_DATA_THROTTLE_HIGH_THRESHOLD=80
CONFIG_TO_WIFI_DATA_THROTTLE_LOW_THRESHOLD=60
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_TX_BUFFER_TYPE=1
CONFIG_ESP32_WIFI_DYNAMIC_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

@ -42,31 +42,14 @@ CONFIG_LV_LAYER_SIMPLE_BUF_SIZE=102400
CONFIG_LV_IMG_CACHE_DEF_SIZE=20
CONFIG_LV_GRAD_CACHE_DEF_SIZE=10240
CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM=y
CONFIG_LV_FONT_MONTSERRAT_8=y
CONFIG_LV_FONT_MONTSERRAT_10=y
CONFIG_LV_FONT_MONTSERRAT_12=y
CONFIG_LV_FONT_MONTSERRAT_16=y
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_FONT_MONTSERRAT_20=y
CONFIG_LV_FONT_MONTSERRAT_22=y
CONFIG_LV_FONT_MONTSERRAT_24=y
CONFIG_LV_FONT_MONTSERRAT_26=y
CONFIG_LV_FONT_MONTSERRAT_28=y
CONFIG_LV_FONT_MONTSERRAT_30=y
CONFIG_LV_FONT_MONTSERRAT_32=y
CONFIG_LV_FONT_MONTSERRAT_34=y
CONFIG_LV_FONT_MONTSERRAT_36=y
CONFIG_LV_FONT_MONTSERRAT_38=y
CONFIG_LV_FONT_MONTSERRAT_40=y
CONFIG_LV_FONT_MONTSERRAT_42=y
CONFIG_LV_FONT_MONTSERRAT_44=y
CONFIG_LV_FONT_MONTSERRAT_46=y
CONFIG_LV_FONT_MONTSERRAT_48=y
CONFIG_LV_USE_MONKEY=y
CONFIG_LV_USE_DEMO_WIDGETS=y
CONFIG_LV_USE_DEMO_BENCHMARK=y
CONFIG_LV_USE_DEMO_STRESS=y
CONFIG_LV_USE_MONKEY=n
CONFIG_LV_USE_DEMO_WIDGETS=n
CONFIG_LV_USE_DEMO_BENCHMARK=n
CONFIG_LV_USE_DEMO_STRESS=n
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
CONFIG_LV_USE_CLIB_MALLOC=y
CONFIG_LV_USE_CLIB_SPRINTF=y
CONFIG_LV_BUILD_EXAMPLES=n
#Necessaire pour lire les fichiers depuis littlefs
CONFIG_LV_USE_FS_STDIO=y
@ -76,3 +59,21 @@ CONFIG_LV_FS_STDIO_CACHE_SIZE=0
# Necessaire pour lire le png
CONFIG_LV_USE_LODEPNG=y
CONFIG_LV_FONT_MONTSERRAT_40=y
# Important pour la fluidité des animations
CONFIG_LV_DEF_REFR_PERIOD=10
#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
#Specifique P4
CONFIG_SLAVE_IDF_TARGET_ESP32C6=y

View File

@ -0,0 +1,31 @@
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) Project Minimal Configuration
#
CONFIG_IDF_TARGET="esp32p4"
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM=y
CONFIG_FREERTOS_HZ=1000
CONFIG_SPIRAM=y
CONFIG_SPIRAM_MODE_HEX=y
CONFIG_SPIRAM_SPEED_200M=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
## LVGL9 ##
CONFIG_LV_CONF_SKIP=y
CONFIG_LV_DEF_REFR_PERIOD=10
#CLIB default
CONFIG_LV_USE_CLIB_MALLOC=y
CONFIG_LV_USE_CLIB_SPRINTF=y
CONFIG_LV_USE_CLIB_STRING=y
# Performance monitor
CONFIG_LV_USE_OBSERVER=y
CONFIG_LV_USE_SYSMON=y
CONFIG_LV_USE_PERF_MONITOR=y
# CONFIG_LV_BUILD_EXAMPLES is not set

File diff suppressed because it is too large Load Diff