From a4a4829a0045d811de71dc9e26a5726db26d7f31 Mon Sep 17 00:00:00 2001 From: sle118 Date: Wed, 4 Sep 2019 14:30:03 -0400 Subject: [PATCH 1/4] Update CMakeLists.txt --- main/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index 21a4d43c..aa74328a 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -2,6 +2,6 @@ set(COMPONENT_ADD_INCLUDEDIRS . ) set(COMPONENT_SRCS "esp_app_main.c" "cmd_wifi.c" "console.c" "nvs_utilities.c" "cmd_squeezelite.c" ) set(REQUIRES esp_common ) -set(REQUIRES_COMPONENTS freertos nvs_flash esp32 spi_flash newlib log console wifi-manager ) +set(REQUIRES_COMPONENTS freertos squeezelite nvs_flash esp32 spi_flash newlib log console wifi-manager ) register_component() From 46ee77e723fc43b99d027d77b4936861c9af3d7c Mon Sep 17 00:00:00 2001 From: Christian Herzog Date: Thu, 5 Sep 2019 21:22:39 +0200 Subject: [PATCH 2/4] Wi fi manager (#14) * build command line from website form * fix autoexec1 length problem --- components/wifi-manager/http_server.c | 5 ----- components/wifi-manager/wifi_manager.c | 8 +++++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/components/wifi-manager/http_server.c b/components/wifi-manager/http_server.c index 34152dd9..74cd7cdd 100644 --- a/components/wifi-manager/http_server.c +++ b/components/wifi-manager/http_server.c @@ -35,9 +35,6 @@ function to process requests, decode URLs, serve files, etc. etc. #include "cmd_system.h" -// todo: resolve the restrict error below -#pragma GCC diagnostic warning "-Wrestrict" - /* @brief tag used for ESP serial console messages */ static const char TAG[] = "http_server"; static const char json_start[] = "{ \"autoexec\": %u, \"list\": ["; @@ -309,8 +306,6 @@ void http_server_netconn_serve(struct netconn *conn) { if(autoexec_value ){ - // todo: replace line below, as it causes an error during compile. - snprintf(autoexec_value, lenS+1, autoexec_value); if(lenS < MAX_COMMAND_LINE_SIZE ){ ESP_LOGD(TAG, "http_server_netconn_serve: config.json/ call, with %s: %s, length %i", autoexec_key, autoexec_value, lenS); wifi_manager_save_autoexec_config(autoexec_value,autoexec_key,lenS); diff --git a/components/wifi-manager/wifi_manager.c b/components/wifi-manager/wifi_manager.c index 7d997700..9fde0f95 100644 --- a/components/wifi-manager/wifi_manager.c +++ b/components/wifi-manager/wifi_manager.c @@ -242,7 +242,9 @@ esp_err_t wifi_manager_save_autoexec_flag(uint8_t flag){ } esp_err_t wifi_manager_save_autoexec_config(char * value, char * name, int len){ nvs_handle handle; + char val[len+1]; esp_err_t esp_err; + if (len) { *val = '\0'; strncat(val, value, len); } ESP_LOGI(TAG, "About to save config to flash"); esp_err = nvs_open(wifi_manager_nvs_namespace, NVS_READWRITE, &handle); if (esp_err != ESP_OK) { @@ -250,9 +252,9 @@ esp_err_t wifi_manager_save_autoexec_config(char * value, char * name, int len){ return esp_err; } - esp_err = nvs_set_str(handle, name, value); + esp_err = nvs_set_str(handle, name, val); if (esp_err != ESP_OK){ - ESP_LOGE(TAG,"Unable to save value %s=%s",name,value); + ESP_LOGE(TAG,"Unable to save value %s=%s",name,val); nvs_close(handle); return esp_err; } @@ -265,7 +267,7 @@ esp_err_t wifi_manager_save_autoexec_config(char * value, char * name, int len){ nvs_close(handle); - ESP_LOGD(TAG, "wifi_manager_wrote %s=%s with length %i", name, value, len); + ESP_LOGD(TAG, "wifi_manager_wrote %s=%s with length %i", name, val, len); return ESP_OK; From 7fee96ec63e0abc6c8534a68b64ad935a0e51c39 Mon Sep 17 00:00:00 2001 From: sle118 Date: Thu, 5 Sep 2019 18:00:45 -0400 Subject: [PATCH 3/4] Revert CONFIG_SPIRAM defaults --- sdkconfig.defaults | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 9425b3a4..1c8de298 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -77,9 +77,12 @@ CONFIG_SPIRAM_SIZE=-1 CONFIG_SPIRAM_SPEED_80M=y CONFIG_SPIRAM_MEMTEST=y CONFIG_SPIRAM_CACHE_WORKAROUND=y -CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=512 -CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 + +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=256 +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=65536 CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y +CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y + CONFIG_SPIRAM_OCCUPY_VSPI_HOST=y CONFIG_SPIRAM_BANKSWITCH_ENABLE=n CONFIG_D0WD_PSRAM_CLK_IO=17 From 6cf0acfc4c8ab52372160a9370541150eb1aa792 Mon Sep 17 00:00:00 2001 From: sle118 Date: Sun, 8 Sep 2019 22:24:29 -0400 Subject: [PATCH 4/4] Sync up (#16) * Update CMakeLists.txt * sink name corrections --- components/driver_bt/bt_app_sink.c | 8 ++++---- components/raop/raop_sink.c | 4 ++-- main/CMakeLists.txt | 7 ++++--- main/Kconfig.projbuild | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/driver_bt/bt_app_sink.c b/components/driver_bt/bt_app_sink.c index e9bb86ae..d0088501 100644 --- a/components/driver_bt/bt_app_sink.c +++ b/components/driver_bt/bt_app_sink.c @@ -39,8 +39,8 @@ #define BT_RC_TG_TAG "RCTG" #define BT_RC_CT_TAG "RCCT" -#ifndef CONFIG_BT_SINK_NAME -#define CONFIG_BT_SINK_NAME "default" +#ifndef CONFIG_BT_NAME +#define CONFIG_BT_NAME "ESP32-BT" #endif extern char current_namespace[]; @@ -468,11 +468,11 @@ static void bt_av_hdl_stack_evt(uint16_t event, void *p_param) case BT_APP_EVT_STACK_UP: { /* set up device name */ nvs_handle nvs; - char dev_name[32] = CONFIG_BT_SINK_NAME; + char dev_name[32] = CONFIG_BT_NAME; if (nvs_open(current_namespace, NVS_READONLY, &nvs) == ESP_OK) { size_t len = 31; - nvs_get_str(nvs, "bt_sink_name", dev_name, &len); + nvs_get_str(nvs, "bt_name", dev_name, &len); nvs_close(nvs); } diff --git a/components/raop/raop_sink.c b/components/raop/raop_sink.c index 092f1b57..623c45d1 100644 --- a/components/raop/raop_sink.c +++ b/components/raop/raop_sink.c @@ -19,7 +19,7 @@ #include "trace.h" #ifndef CONFIG_AIRPLAY_NAME -#define CONFIG_AIRPLAY_NAME "disabled" +#define CONFIG_AIRPLAY_NAME "ESP32-AirPlay" #endif static const char * TAG = "platform"; @@ -60,7 +60,7 @@ void raop_sink_init(raop_cmd_cb_t cmd_cb, raop_data_cb_t data_cb) { if (nvs_open(current_namespace, NVS_READONLY, &nvs) == ESP_OK) { size_t len = sizeof(sink_name) - 1; - nvs_get_str(nvs, "airplay_sink_name", sink_name, &len); + nvs_get_str(nvs, "airplay_name", sink_name, &len); nvs_close(nvs); } diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index aa74328a..d0ba9012 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,7 +1,8 @@ set(COMPONENT_ADD_INCLUDEDIRS . ) -set(COMPONENT_SRCS "esp_app_main.c" "cmd_wifi.c" "console.c" "nvs_utilities.c" "cmd_squeezelite.c" ) -set(REQUIRES esp_common ) -set(REQUIRES_COMPONENTS freertos squeezelite nvs_flash esp32 spi_flash newlib log console wifi-manager ) +set(COMPONENT_SRCS "esp_app_main.c" "platform_esp32.c" "cmd_wifi.c" "console.c" "nvs_utilities.c" "cmd_squeezelite.c") +set(REQUIRES esp_common) +set(REQUIRES_COMPONENTS freertos squeezelite nvs_flash esp32 spi_flash newlib log console ) + register_component() diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index 4e6eebfe..0051d785 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -160,7 +160,7 @@ menu "Squeezelite-ESP32" default y help Enable bluetooth sink (Note that you obviously can't at the same time be a Bluetooth receiver and transmitter) - config BT_SINK_NAME + config BT_NAME depends on BT_SINK string "Name of Bluetooth A2DP device" default "ESP32-BT"