diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index 092371a..2b0be10 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -26,7 +26,7 @@ jobs: - name: Build uses: espressif/esp-idf-ci-action@v1 with: - esp_idf_version: v5.2 + esp_idf_version: v5.2.1 target: ${{ matrix.platform }} - name: Upload artifact diff --git a/components/config/src/board_config.c b/components/config/src/board_config.c index 2ec6718..2606ae5 100644 --- a/components/config/src/board_config.c +++ b/components/config/src/board_config.c @@ -150,28 +150,28 @@ void board_config_load() SET_CONFIG_VALUE("AUX_AIN_2", aux_ain_2, atob); SET_CONFIG_VALUE_STR("AUX_AIN_2_NAME", aux_ain_2_name); SET_CONFIG_VALUE("AUX_AIN_2_ADC_CHANNEL", aux_ain_2_adc_channel, atoi); -#if CONFIG_ESP_CONSOLE_UART_NUM != 0 +#if CONFIG_ESP_CONSOLE_NONE || CONFIG_ESP_CONSOLE_UART_NUM != 0 SET_CONFIG_VALUE("SERIAL_1", serial_1, atoser); SET_CONFIG_VALUE_STR("SERIAL_1_NAME", serial_1_name); SET_CONFIG_VALUE("SERIAL_1_RXD_GPIO", serial_1_rxd_gpio, atoi); SET_CONFIG_VALUE("SERIAL_1_TXD_GPIO", serial_1_txd_gpio, atoi); SET_CONFIG_VALUE("SERIAL_1_RTS_GPIO", serial_1_rts_gpio, atoi); -#endif /* CONFIG_ESP_CONSOLE_UART_NUM != 0 */ -#if CONFIG_ESP_CONSOLE_UART_NUM != 1 +#endif /* CONFIG_ESP_CONSOLE_NONE || CONFIG_ESP_CONSOLE_UART_NUM != 0 */ +#if CONFIG_ESP_CONSOLE_NONE || CONFIG_ESP_CONSOLE_UART_NUM != 1 SET_CONFIG_VALUE("SERIAL_2", serial_2, atoser); SET_CONFIG_VALUE_STR("SERIAL_2_NAME", serial_2_name); SET_CONFIG_VALUE("SERIAL_2_RXD_GPIO", serial_2_rxd_gpio, atoi); SET_CONFIG_VALUE("SERIAL_2_TXD_GPIO", serial_2_txd_gpio, atoi); SET_CONFIG_VALUE("SERIAL_2_RTS_GPIO", serial_2_rts_gpio, atoi); -#endif /* CONFIG_ESP_CONSOLE_UART_NUM != 1 */ +#endif /* CONFIG_ESP_CONSOLE_NONE || CONFIG_ESP_CONSOLE_UART_NUM != 1 */ #if SOC_UART_NUM > 2 -#if CONFIG_ESP_CONSOLE_UART_NUM != 2 +#if CONFIG_ESP_CONSOLE_NONE || CONFIG_ESP_CONSOLE_UART_NUM != 2 SET_CONFIG_VALUE("SERIAL_3", serial_3, atoser); SET_CONFIG_VALUE_STR("SERIAL_3_NAME", serial_3_name); SET_CONFIG_VALUE("SERIAL_3_RXD_GPIO", serial_3_rxd_gpio, atoi); SET_CONFIG_VALUE("SERIAL_3_TXD_GPIO", serial_3_txd_gpio, atoi); SET_CONFIG_VALUE("SERIAL_3_RTS_GPIO", serial_3_rts_gpio, atoi); -#endif /* CONFIG_ESP_CONSOLE_UART_NUM != 2 */ +#endif /* CONFIG_ESP_CONSOLE_NONE || CONFIG_ESP_CONSOLE_UART_NUM != 2 */ #endif /* SOC_UART_NUM > 2 */ SET_CONFIG_VALUE("ONEWIRE", onewire, atob); SET_CONFIG_VALUE("ONEWIRE_GPIO", onewire_gpio, atoi); diff --git a/components/peripherals/src/adc.c b/components/peripherals/src/adc.c index 7130e56..8378f7d 100644 --- a/components/peripherals/src/adc.c +++ b/components/peripherals/src/adc.c @@ -21,7 +21,7 @@ void adc_init(void) ESP_LOGI(TAG, "Calibration scheme version is %s", "Curve Fitting"); adc_cali_curve_fitting_config_t cali_config = { .unit_id = ADC_UNIT_1, - .atten = ADC_ATTEN_DB_11, + .atten = ADC_ATTEN_DB_12, .bitwidth = ADC_BITWIDTH_DEFAULT, }; if (adc_cali_create_scheme_curve_fitting(&cali_config, &adc_cali_handle) == ESP_OK) { @@ -35,7 +35,7 @@ void adc_init(void) ESP_LOGI(TAG, "Calibration scheme version is %s", "Line Fitting"); adc_cali_line_fitting_config_t cali_config = { .unit_id = ADC_UNIT_1, - .atten = ADC_ATTEN_DB_11, + .atten = ADC_ATTEN_DB_12, .bitwidth = ADC_BITWIDTH_DEFAULT, #if CONFIG_IDF_TARGET_ESP32 .default_vref = 1100 diff --git a/components/peripherals/src/aux_io.c b/components/peripherals/src/aux_io.c index 1433184..ebf0580 100644 --- a/components/peripherals/src/aux_io.c +++ b/components/peripherals/src/aux_io.c @@ -118,7 +118,7 @@ void aux_init(void) adc_oneshot_chan_cfg_t config = { .bitwidth = ADC_BITWIDTH_DEFAULT, - .atten = ADC_ATTEN_DB_11 + .atten = ADC_ATTEN_DB_12 }; if (board_config.aux_ain_1) { diff --git a/components/peripherals/src/energy_meter.c b/components/peripherals/src/energy_meter.c index d111f2b..8dd7226 100644 --- a/components/peripherals/src/energy_meter.c +++ b/components/peripherals/src/energy_meter.c @@ -276,7 +276,7 @@ void energy_meter_init(void) nvs_get_u16(nvs, NVS_AC_VOLTAGE, &ac_voltage); adc_oneshot_chan_cfg_t config = { .bitwidth = ADC_BITWIDTH_DEFAULT, - .atten = ADC_ATTEN_DB_11 + .atten = ADC_ATTEN_DB_12 }; if (board_config.energy_meter == BOARD_CONFIG_ENERGY_METER_CUR) { diff --git a/components/peripherals/src/pilot.c b/components/peripherals/src/pilot.c index 6c90329..7898bec 100644 --- a/components/peripherals/src/pilot.c +++ b/components/peripherals/src/pilot.c @@ -43,7 +43,7 @@ void pilot_init(void) adc_oneshot_chan_cfg_t config = { .bitwidth = ADC_BITWIDTH_DEFAULT, - .atten = ADC_ATTEN_DB_11 + .atten = ADC_ATTEN_DB_12 }; ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_handle, board_config.pilot_adc_channel, &config)); } diff --git a/components/peripherals/src/proximity.c b/components/peripherals/src/proximity.c index 56266da..98cf837 100644 --- a/components/peripherals/src/proximity.c +++ b/components/peripherals/src/proximity.c @@ -11,7 +11,7 @@ void proximity_init(void) if (board_config.proximity) { adc_oneshot_chan_cfg_t config = { .bitwidth = ADC_BITWIDTH_DEFAULT, - .atten = ADC_ATTEN_DB_11 + .atten = ADC_ATTEN_DB_12 }; ESP_ERROR_CHECK(adc_oneshot_config_channel(adc_handle, board_config.proximity_adc_channel, &config)); } diff --git a/components/protocols/CMakeLists.txt b/components/protocols/CMakeLists.txt index 747d5fd..93ca4f4 100644 --- a/components/protocols/CMakeLists.txt +++ b/components/protocols/CMakeLists.txt @@ -9,8 +9,7 @@ set(srcs "src/scheduler.c") set(embed_files - "web.cpio" - "server_certs/ca_cert.pem") + "web.cpio") idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" diff --git a/components/protocols/server_certs/ca_cert.pem b/components/protocols/server_certs/ca_cert.pem deleted file mode 100644 index 57ba02c..0000000 --- a/components/protocols/server_certs/ca_cert.pem +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD -QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT -MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j -b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB -CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 -nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt -43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P -T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 -gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO -BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR -TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw -DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr -hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg -06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF -PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls -YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- \ No newline at end of file diff --git a/components/protocols/src/http_rest.c b/components/protocols/src/http_rest.c index 569a5a5..5103cfc 100644 --- a/components/protocols/src/http_rest.c +++ b/components/protocols/src/http_rest.c @@ -9,6 +9,7 @@ #include "esp_ota_ops.h" #include "esp_https_ota.h" #include "esp_vfs.h" +#include "esp_crt_bundle.h" #include "cJSON.h" #include "http_rest.h" @@ -29,9 +30,6 @@ static const char* TAG = "http_rest"; -extern const char server_cert_pem_start[] asm("_binary_ca_cert_pem_start"); -extern const char server_cert_pem_end[] asm("_binary_ca_cert_pem_end"); - static void restart_func(void* arg) { vTaskDelay(pdMS_TO_TICKS(5000)); @@ -104,7 +102,7 @@ static esp_err_t ota_get_available_version(char* version) { esp_http_client_config_t config = { .url = OTA_VERSION_URL, - .cert_pem = server_cert_pem_start + .crt_bundle_attach = esp_crt_bundle_attach }; esp_http_client_handle_t client = esp_http_client_init(&config); @@ -377,11 +375,9 @@ esp_err_t firmware_update_post_handler(httpd_req_t* req) const esp_app_desc_t* app_desc = esp_app_get_description(); if (ota_is_newer_version(app_desc->version, avl_version)) { - extern const char server_cert_pem_start[] asm("_binary_ca_cert_pem_start"); - esp_http_client_config_t http_config = { .url = OTA_FIRMWARE_URL CONFIG_IDF_TARGET "-evse.bin", - .cert_pem = server_cert_pem_start + .crt_bundle_attach = esp_crt_bundle_attach }; esp_https_ota_config_t config = {