From 5e7e4cfdf47ac3a32ea6d243a0f76b07f00c2f52 Mon Sep 17 00:00:00 2001 From: Sebastien Leclerc Date: Tue, 24 Sep 2019 00:11:24 -0400 Subject: [PATCH] more ota progress --- .cproject | 463 ++++++------------ .settings/language.settings.xml | 73 +-- .../squeezelite-esp32-16M-sdkconfig.defaults | 2 + ...lite-esp32-I2S-16MFlash-sdkconfig.defaults | 1 + ...2-I2S-4MFlash-NOAirplay-sdkconfig.defaults | 1 + ...elite-esp32-I2S-4MFlash-sdkconfig.defaults | 1 + ...zelite-esp32-SqueezeAmp-sdkconfig.defaults | 1 + components/squeezelite-ota/cmd_ota.c | 2 +- components/squeezelite-ota/squeezelite-ota.c | 7 +- 9 files changed, 190 insertions(+), 361 deletions(-) diff --git a/.cproject b/.cproject index 5520d25d..2e3becc6 100644 --- a/.cproject +++ b/.cproject @@ -1,312 +1,157 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - make - - - - app - - true - - true - - true - - - - - - make - - - - all - - true - - true - - true - - - - - - make - - -j8 - - clean - - true - - true - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + make + + app + true + true + true + + + make + + all + true + true + true + + + make + -j8 + clean + true + true + true + + + + + + + + + + + + + + + + + + diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index b73d4653..08c414ab 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -1,52 +1,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build-scripts/squeezelite-esp32-16M-sdkconfig.defaults b/build-scripts/squeezelite-esp32-16M-sdkconfig.defaults index 464af6b4..a56fc455 100644 --- a/build-scripts/squeezelite-esp32-16M-sdkconfig.defaults +++ b/build-scripts/squeezelite-esp32-16M-sdkconfig.defaults @@ -15,6 +15,8 @@ CONFIG_INCLUDE_FAAD=y CONFIG_INCLUDE_MAD=y CONFIG_INCLUDE_VORBIS=y CONFIG_INCLUDE_ALAC=y +CONFIG_OTA_ALLOW_HTTP=y + CONFIG_BTAUDIO=y CONFIG_OUTPUT_NAME="" CONFIG_OUTPUT_RATES="44100" diff --git a/build-scripts/squeezelite-esp32-I2S-16MFlash-sdkconfig.defaults b/build-scripts/squeezelite-esp32-I2S-16MFlash-sdkconfig.defaults index 0722f815..3c99a4fa 100644 --- a/build-scripts/squeezelite-esp32-I2S-16MFlash-sdkconfig.defaults +++ b/build-scripts/squeezelite-esp32-I2S-16MFlash-sdkconfig.defaults @@ -13,6 +13,7 @@ CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES=y CONFIG_APP_COMPILE_TIME_DATE=y +CONFIG_OTA_ALLOW_HTTP=y diff --git a/build-scripts/squeezelite-esp32-I2S-4MFlash-NOAirplay-sdkconfig.defaults b/build-scripts/squeezelite-esp32-I2S-4MFlash-NOAirplay-sdkconfig.defaults index 097c6bec..a87bc3cb 100644 --- a/build-scripts/squeezelite-esp32-I2S-4MFlash-NOAirplay-sdkconfig.defaults +++ b/build-scripts/squeezelite-esp32-I2S-4MFlash-NOAirplay-sdkconfig.defaults @@ -13,6 +13,7 @@ CONFIG_SDK_MAKE_WARN_UNDEFINED_VARIABLES=y CONFIG_APP_COMPILE_TIME_DATE=y +CONFIG_OTA_ALLOW_HTTP=y diff --git a/build-scripts/squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults b/build-scripts/squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults index 86e97eb5..9d4e8cf2 100644 --- a/build-scripts/squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults +++ b/build-scripts/squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults @@ -14,6 +14,7 @@ CONFIG_APP_COMPILE_TIME_DATE=y +CONFIG_OTA_ALLOW_HTTP=y CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y diff --git a/build-scripts/squeezelite-esp32-SqueezeAmp-sdkconfig.defaults b/build-scripts/squeezelite-esp32-SqueezeAmp-sdkconfig.defaults index f8bddf8f..ece9302b 100644 --- a/build-scripts/squeezelite-esp32-SqueezeAmp-sdkconfig.defaults +++ b/build-scripts/squeezelite-esp32-SqueezeAmp-sdkconfig.defaults @@ -14,6 +14,7 @@ CONFIG_APP_COMPILE_TIME_DATE=y +CONFIG_OTA_ALLOW_HTTP=y CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y diff --git a/components/squeezelite-ota/cmd_ota.c b/components/squeezelite-ota/cmd_ota.c index 23ef94ce..7220afa7 100644 --- a/components/squeezelite-ota/cmd_ota.c +++ b/components/squeezelite-ota/cmd_ota.c @@ -59,7 +59,7 @@ static int perform_ota_update(int argc, char **argv) void register_ota_cmd() { ota_args.url= arg_str1(NULL, NULL, "", "url of the binary app file"); - ota_args.end = arg_end(2); + ota_args.end = arg_end(1); const esp_console_cmd_t cmd = { .command = "ota_update", diff --git a/components/squeezelite-ota/squeezelite-ota.c b/components/squeezelite-ota/squeezelite-ota.c index 4b326019..2be9d82a 100644 --- a/components/squeezelite-ota/squeezelite-ota.c +++ b/components/squeezelite-ota/squeezelite-ota.c @@ -68,8 +68,9 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt) return ESP_OK; } -void ota_task(void *pvParameter, const char * bin_url) +void ota_task(void *pvParameter) { + char * bin_url=(char *)pvParameter; ESP_LOGI(TAG, "Starting OTA example"); esp_http_client_config_t config = { @@ -106,6 +107,8 @@ void start_ota(const char * bin_url) err = nvs_flash_init(); } ESP_ERROR_CHECK(err); + char * urlPtr=malloc((strlen(bin_url)+1)*sizeof(char)); + strcpy(urlPtr,bin_url); - xTaskCreate(&ota_task, "ota_task", 8192, NULL, 5, NULL); + xTaskCreate(&ota_task, "ota_task", 8192, NULL, 5, urlPtr); }