Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 Build errors with ESP-IDF v5.1.1 #156

Open
myreauks opened this issue Sep 15, 2023 · 35 comments
Open

ESP32 Build errors with ESP-IDF v5.1.1 #156

myreauks opened this issue Sep 15, 2023 · 35 comments

Comments

@myreauks
Copy link

myreauks commented Sep 15, 2023

Hi!
I've been trying to build the master branch with IDF 4.4 and 5.0 but both fail with varying error messages. Before starting a more in-depth research on the error messages, is there a recommendation on which version of the IDF to use?

Furthermore, has anyone succesfully compiled the master branch on ESP32?

@myreauks
Copy link
Author

A little update on the situation.
I have gotten pretty far now by installing the v5.1.1 version of ESP-IDF and manually installing the led_strip and mdns components.
I have so far managed to succesfully set the target to ESP32 and setup it with the menuconfig.
With the build I am getting to step 1222/1500 so almost getting there now.

However, at that point, I am starting to get these errors. Getting a bit overwhelmed at this point. Any pointers?

[1222/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BinaryStream.cpp.obj
FAILED: esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BinaryStream.cpp.obj 
/Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM -DFMT_HEADER_ONLY -DIDF_VER=\"v5.1.1\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPB_ENABLE_MALLOC -DPB_FIELD_32BIT -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUSE_DEFAULT_STDLIB="1 -DTARGET_OS_IPHONE=0" -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/Users/user/esp/cspot/targets/esp32/build/config -I/Users/user/esp/cspot/cspot/bell/main/audio-codec/include -I/Users/user/esp/cspot/cspot/bell/main/audio-dsp/include -I/Users/user/esp/cspot/cspot/bell/main/audio-sinks/include -I/Users/user/esp/cspot/cspot/bell/main/io/include -I/Users/user/esp/cspot/cspot/bell/main/utilities/include -I/Users/user/esp/cspot/cspot/bell/main/platform -I/Users/user/esp/cspot/cspot/bell/external/mqtt/include -I/Users/user/esp/cspot/cspot/bell/main/audio-containers/include -I/Users/user/esp/cspot/cspot/bell/main/audio-sinks/include/esp -I/Users/user/esp/cspot/cspot/bell/external/civetweb/include -I/Users/user/esp/cspot/targets/esp32/build/esp-idf/main/cspot/bell -I/Users/user/esp/esp-idf/components/newlib/platform_include -I/Users/user/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/Users/user/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/Users/user/esp/esp-idf/components/freertos/esp_additions/include/freertos -I/Users/user/esp/esp-idf/components/freertos/esp_additions/include -I/Users/user/esp/esp-idf/components/freertos/esp_additions/arch/xtensa/include -I/Users/user/esp/esp-idf/components/esp_hw_support/include -I/Users/user/esp/esp-idf/components/esp_hw_support/include/soc -I/Users/user/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -I/Users/user/esp/esp-idf/components/esp_hw_support/port/esp32/. -I/Users/user/esp/esp-idf/components/esp_hw_support/port/esp32/private_include -I/Users/user/esp/esp-idf/components/heap/include -I/Users/user/esp/esp-idf/components/log/include -I/Users/user/esp/esp-idf/components/soc/include -I/Users/user/esp/esp-idf/components/soc/esp32 -I/Users/user/esp/esp-idf/components/soc/esp32/include -I/Users/user/esp/esp-idf/components/hal/esp32/include -I/Users/user/esp/esp-idf/components/hal/include -I/Users/user/esp/esp-idf/components/hal/platform_port/include -I/Users/user/esp/esp-idf/components/esp_rom/include -I/Users/user/esp/esp-idf/components/esp_rom/include/esp32 -I/Users/user/esp/esp-idf/components/esp_rom/esp32 -I/Users/user/esp/esp-idf/components/esp_common/include -I/Users/user/esp/esp-idf/components/esp_system/include -I/Users/user/esp/esp-idf/components/esp_system/port/soc -I/Users/user/esp/esp-idf/components/esp_system/port/include/private -I/Users/user/esp/esp-idf/components/xtensa/include -I/Users/user/esp/esp-idf/components/xtensa/esp32/include -I/Users/user/esp/esp-idf/components/esp_timer/include -I/Users/user/esp/esp-idf/components/lwip/include -I/Users/user/esp/esp-idf/components/lwip/include/apps -I/Users/user/esp/esp-idf/components/lwip/include/apps/sntp -I/Users/user/esp/esp-idf/components/lwip/lwip/src/include -I/Users/user/esp/esp-idf/components/lwip/port/include -I/Users/user/esp/esp-idf/components/lwip/port/freertos/include -I/Users/user/esp/esp-idf/components/lwip/port/esp32xx/include -I/Users/user/esp/esp-idf/components/lwip/port/esp32xx/include/arch -I/Users/user/esp/esp-idf/components/mdns/include -I/Users/user/esp/esp-idf/components/console -I/Users/user/esp/esp-idf/components/vfs/include -I/Users/user/esp/esp-idf/components/esp_netif/include -I/Users/user/esp/esp-idf/components/esp_event/include -I/Users/user/esp/esp-idf/components/mbedtls/port/include -I/Users/user/esp/esp-idf/components/mbedtls/mbedtls/include -I/Users/user/esp/esp-idf/components/mbedtls/mbedtls/library -I/Users/user/esp/esp-idf/components/mbedtls/esp_crt_bundle/include -I/Users/user/esp/esp-idf/components/pthread/include -I/Users/user/esp/esp-idf/components/driver/include -I/Users/user/esp/esp-idf/components/driver/deprecated -I/Users/user/esp/esp-idf/components/driver/analog_comparator/include -I/Users/user/esp/esp-idf/components/driver/dac/include -I/Users/user/esp/esp-idf/components/driver/gpio/include -I/Users/user/esp/esp-idf/components/driver/gptimer/include -I/Users/user/esp/esp-idf/components/driver/i2c/include -I/Users/user/esp/esp-idf/components/driver/i2s/include -I/Users/user/esp/esp-idf/components/driver/ledc/include -I/Users/user/esp/esp-idf/components/driver/mcpwm/include -I/Users/user/esp/esp-idf/components/driver/parlio/include -I/Users/user/esp/esp-idf/components/driver/pcnt/include -I/Users/user/esp/esp-idf/components/driver/rmt/include -I/Users/user/esp/esp-idf/components/driver/sdio_slave/include -I/Users/user/esp/esp-idf/components/driver/sdmmc/include -I/Users/user/esp/esp-idf/components/driver/sigma_delta/include -I/Users/user/esp/esp-idf/components/driver/spi/include -I/Users/user/esp/esp-idf/components/driver/temperature_sensor/include -I/Users/user/esp/esp-idf/components/driver/touch_sensor/include -I/Users/user/esp/esp-idf/components/driver/twai/include -I/Users/user/esp/esp-idf/components/driver/uart/include -I/Users/user/esp/esp-idf/components/driver/usb_serial_jtag/include -I/Users/user/esp/esp-idf/components/driver/touch_sensor/esp32/include -I/Users/user/esp/esp-idf/components/esp_pm/include -I/Users/user/esp/esp-idf/components/esp_ringbuf/include -I/Users/user/esp/cspot/cspot/bell/external/opus/include -isystem /Users/user/esp/cspot/cspot/bell/external/nanopb -isystem /Users/user/esp/cspot/cspot/bell/external/libhelix-aac -isystem /Users/user/esp/cspot/cspot/bell/external/libhelix-mp3 -isystem /Users/user/esp/cspot/cspot/bell/external/tremor -isystem /Users/user/esp/cspot/cspot/bell/external/cJSON -isystem /Users/user/esp/cspot/cspot/bell/external/fmt/include -isystem /Users/user/esp/cspot/cspot/bell/external/nlohmann_json/include -mlongcalls -Wno-frame-address  -std=gnu++20 -fdiagnostics-color=always   -Wunused-const-variable -Wchar-subscripts -Wunused-label -Wmaybe-uninitialized -Wmisleading-indentation -Wno-stringop-overflow -Wno-error=format -Wno-format -Wno-stringop-overread -Wno-stringop-overflow -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -Og -fmacro-prefix-map=/Users/user/esp/cspot/targets/esp32=. -fmacro-prefix-map=/Users/user/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -fdiagnostics-color=always -std=gnu++2b -fexceptions -fno-rtti -MD -MT esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BinaryStream.cpp.obj -MF esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BinaryStream.cpp.obj.d -o esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BinaryStream.cpp.obj -c /Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp
In file included from /Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp:1:
/Users/user/esp/cspot/cspot/bell/main/io/include/BinaryStream.h:13:8: error: 'endian' in namespace 'std' does not name a type
   13 |   std::endian byteOrder;
      |        ^~~~~~
/Users/user/esp/cspot/cspot/bell/main/io/include/BinaryStream.h:56:21: error: 'std::endian' has not been declared
   56 |   void setByteOrder(std::endian byteOrder);
      |                     ^~~
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp: In constructor 'bell::BinaryStream::BinaryStream(std::ostream*)':
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp:8:3: error: 'byteOrder' was not declared in this scope; did you mean 'setByteOrder'?
    8 |   byteOrder = std::endian::native;
      |   ^~~~~~~~~
      |   setByteOrder
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp:8:20: error: 'std::endian' has not been declared
    8 |   byteOrder = std::endian::native;
      |                    ^~~~~~
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp: In constructor 'bell::BinaryStream::BinaryStream(std::istream*)':
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp:13:3: error: 'byteOrder' was not declared in this scope; did you mean 'setByteOrder'?
   13 |   byteOrder = std::endian::native;
      |   ^~~~~~~~~
      |   setByteOrder
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp:13:20: error: 'std::endian' has not been declared
   13 |   byteOrder = std::endian::native;
      |                    ^~~~~~
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp: At global scope:
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp:16:6: error: variable or field 'setByteOrder' declared void
   16 | void BinaryStream::setByteOrder(std::endian byteOrder) {
      |      ^~~~~~~~~~~~
/Users/user/esp/cspot/cspot/bell/main/io/BinaryStream.cpp:16:38: error: 'endian' is not a member of 'std'
   16 | void BinaryStream::setByteOrder(std::endian byteOrder) {
      |                                      ^~~~~~
[1223/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BinaryReader.cpp.obj
[1224/1500] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj 
/Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM -DFMT_HEADER_ONLY -DIDF_VER=\"v5.1.1\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPB_ENABLE_MALLOC -DPB_FIELD_32BIT -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUNITY_INCLUDE_CONFIG_H -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/Users/user/esp/cspot/targets/esp32/build/config -I/Users/user/esp/cspot/targets/esp32/main -I/Users/user/esp/esp-idf/components/newlib/platform_include -I/Users/user/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/Users/user/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/Users/user/esp/esp-idf/components/freertos/esp_additions/include/freertos -I/Users/user/esp/esp-idf/components/freertos/esp_additions/include -I/Users/user/esp/esp-idf/components/freertos/esp_additions/arch/xtensa/include -I/Users/user/esp/esp-idf/components/esp_hw_support/include -I/Users/user/esp/esp-idf/components/esp_hw_support/include/soc -I/Users/user/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -I/Users/user/esp/esp-idf/components/esp_hw_support/port/esp32/. -I/Users/user/esp/esp-idf/components/esp_hw_support/port/esp32/private_include -I/Users/user/esp/esp-idf/components/heap/include -I/Users/user/esp/esp-idf/components/log/include -I/Users/user/esp/esp-idf/components/soc/include -I/Users/user/esp/esp-idf/components/soc/esp32 -I/Users/user/esp/esp-idf/components/soc/esp32/include -I/Users/user/esp/esp-idf/components/hal/esp32/include -I/Users/user/esp/esp-idf/components/hal/include -I/Users/user/esp/esp-idf/components/hal/platform_port/include -I/Users/user/esp/esp-idf/components/esp_rom/include -I/Users/user/esp/esp-idf/components/esp_rom/include/esp32 -I/Users/user/esp/esp-idf/components/esp_rom/esp32 -I/Users/user/esp/esp-idf/components/esp_common/include -I/Users/user/esp/esp-idf/components/esp_system/include -I/Users/user/esp/esp-idf/components/esp_system/port/soc -I/Users/user/esp/esp-idf/components/esp_system/port/include/private -I/Users/user/esp/esp-idf/components/xtensa/include -I/Users/user/esp/esp-idf/components/xtensa/esp32/include -I/Users/user/esp/esp-idf/components/esp_timer/include -I/Users/user/esp/esp-idf/components/lwip/include -I/Users/user/esp/esp-idf/components/lwip/include/apps -I/Users/user/esp/esp-idf/components/lwip/include/apps/sntp -I/Users/user/esp/esp-idf/components/lwip/lwip/src/include -I/Users/user/esp/esp-idf/components/lwip/port/include -I/Users/user/esp/esp-idf/components/lwip/port/freertos/include -I/Users/user/esp/esp-idf/components/lwip/port/esp32xx/include -I/Users/user/esp/esp-idf/components/lwip/port/esp32xx/include/arch -I/Users/user/esp/esp-idf/components/mdns/include -I/Users/user/esp/esp-idf/components/console -I/Users/user/esp/esp-idf/components/vfs/include -I/Users/user/esp/esp-idf/components/esp_netif/include -I/Users/user/esp/esp-idf/components/esp_event/include -I/Users/user/esp/cspot/cspot/include -I/Users/user/esp/cspot/targets/esp32/build/esp-idf/main/cspot -I/Users/user/esp/cspot/cspot/bell/main/audio-codec/include -I/Users/user/esp/cspot/cspot/bell/main/audio-dsp/include -I/Users/user/esp/cspot/cspot/bell/main/audio-sinks/include -I/Users/user/esp/cspot/cspot/bell/main/io/include -I/Users/user/esp/cspot/cspot/bell/main/utilities/include -I/Users/user/esp/cspot/cspot/bell/main/platform -I/Users/user/esp/cspot/cspot/bell/external/mqtt/include -I/Users/user/esp/cspot/cspot/bell/main/audio-containers/include -I/Users/user/esp/cspot/cspot/bell/main/audio-sinks/include/esp -I/Users/user/esp/cspot/cspot/bell/external/civetweb/include -I/Users/user/esp/cspot/targets/esp32/build/esp-idf/main/cspot/bell -I/Users/user/esp/esp-idf/components/mbedtls/port/include -I/Users/user/esp/esp-idf/components/mbedtls/mbedtls/include -I/Users/user/esp/esp-idf/components/mbedtls/mbedtls/library -I/Users/user/esp/esp-idf/components/mbedtls/esp_crt_bundle/include -I/Users/user/esp/esp-idf/components/pthread/include -I/Users/user/esp/esp-idf/components/driver/include -I/Users/user/esp/esp-idf/components/driver/deprecated -I/Users/user/esp/esp-idf/components/driver/analog_comparator/include -I/Users/user/esp/esp-idf/components/driver/dac/include -I/Users/user/esp/esp-idf/components/driver/gpio/include -I/Users/user/esp/esp-idf/components/driver/gptimer/include -I/Users/user/esp/esp-idf/components/driver/i2c/include -I/Users/user/esp/esp-idf/components/driver/i2s/include -I/Users/user/esp/esp-idf/components/driver/ledc/include -I/Users/user/esp/esp-idf/components/driver/mcpwm/include -I/Users/user/esp/esp-idf/components/driver/parlio/include -I/Users/user/esp/esp-idf/components/driver/pcnt/include -I/Users/user/esp/esp-idf/components/driver/rmt/include -I/Users/user/esp/esp-idf/components/driver/sdio_slave/include -I/Users/user/esp/esp-idf/components/driver/sdmmc/include -I/Users/user/esp/esp-idf/components/driver/sigma_delta/include -I/Users/user/esp/esp-idf/components/driver/spi/include -I/Users/user/esp/esp-idf/components/driver/temperature_sensor/include -I/Users/user/esp/esp-idf/components/driver/touch_sensor/include -I/Users/user/esp/esp-idf/components/driver/twai/include -I/Users/user/esp/esp-idf/components/driver/uart/include -I/Users/user/esp/esp-idf/components/driver/usb_serial_jtag/include -I/Users/user/esp/esp-idf/components/driver/touch_sensor/esp32/include -I/Users/user/esp/esp-idf/components/esp_pm/include -I/Users/user/esp/esp-idf/components/esp_ringbuf/include -I/Users/user/esp/cspot/cspot/bell/external/opus/include -I/Users/user/esp/esp-idf/components/efuse/include -I/Users/user/esp/esp-idf/components/efuse/esp32/include -I/Users/user/esp/esp-idf/components/esp_app_format/include -I/Users/user/esp/esp-idf/components/bootloader_support/include -I/Users/user/esp/esp-idf/components/bootloader_support/bootloader_flash/include -I/Users/user/esp/esp-idf/components/esp_partition/include -I/Users/user/esp/esp-idf/components/app_update/include -I/Users/user/esp/esp-idf/components/esp_mm/include -I/Users/user/esp/esp-idf/components/spi_flash/include -I/Users/user/esp/esp-idf/components/app_trace/include -I/Users/user/esp/esp-idf/components/nvs_flash/include -I/Users/user/esp/esp-idf/components/esp_phy/include -I/Users/user/esp/esp-idf/components/esp_phy/esp32/include -I/Users/user/esp/esp-idf/components/wpa_supplicant/include -I/Users/user/esp/esp-idf/components/wpa_supplicant/port/include -I/Users/user/esp/esp-idf/components/wpa_supplicant/esp_supplicant/include -I/Users/user/esp/esp-idf/components/esp_coex/include -I/Users/user/esp/esp-idf/components/esp_wifi/include -I/Users/user/esp/esp-idf/components/esp_wifi/wifi_apps/include -I/Users/user/esp/esp-idf/components/bt/include/esp32/include -I/Users/user/esp/esp-idf/components/bt/common/osi/include -I/Users/user/esp/esp-idf/components/bt/common/api/include/api -I/Users/user/esp/esp-idf/components/bt/common/btc/profile/esp/blufi/include -I/Users/user/esp/esp-idf/components/bt/common/btc/profile/esp/include -I/Users/user/esp/esp-idf/components/bt/host/bluedroid/api/include/api -I/Users/user/esp/esp-idf/components/bt/porting/ext/tinycrypt/include -I/Users/user/esp/esp-idf/components/unity/include -I/Users/user/esp/esp-idf/components/unity/unity/src -I/Users/user/esp/esp-idf/components/cmock/CMock/src -I/Users/user/esp/esp-idf/components/http_parser -I/Users/user/esp/esp-idf/components/esp-tls -I/Users/user/esp/esp-idf/components/esp-tls/esp-tls-crypto -I/Users/user/esp/esp-idf/components/esp_adc/include -I/Users/user/esp/esp-idf/components/esp_adc/interface -I/Users/user/esp/esp-idf/components/esp_adc/esp32/include -I/Users/user/esp/esp-idf/components/esp_adc/deprecated/include -I/Users/user/esp/esp-idf/components/esp_eth/include -I/Users/user/esp/esp-idf/components/esp_gdbstub/include -I/Users/user/esp/esp-idf/components/esp_hid/include -I/Users/user/esp/esp-idf/components/tcp_transport/include -I/Users/user/esp/esp-idf/components/esp_http_client/include -I/Users/user/esp/esp-idf/components/esp_http_server/include -I/Users/user/esp/esp-idf/components/esp_https_ota/include -I/Users/user/esp/esp-idf/components/esp_psram/include -I/Users/user/esp/esp-idf/components/esp_lcd/include -I/Users/user/esp/esp-idf/components/esp_lcd/interface -I/Users/user/esp/esp-idf/components/protobuf-c/protobuf-c -I/Users/user/esp/esp-idf/components/protocomm/include/common -I/Users/user/esp/esp-idf/components/protocomm/include/security -I/Users/user/esp/esp-idf/components/protocomm/include/transports -I/Users/user/esp/esp-idf/components/esp_local_ctrl/include -I/Users/user/esp/esp-idf/components/espcoredump/include -I/Users/user/esp/esp-idf/components/espcoredump/include/port/xtensa -I/Users/user/esp/esp-idf/components/wear_levelling/include -I/Users/user/esp/esp-idf/components/sdmmc/include -I/Users/user/esp/esp-idf/components/fatfs/diskio -I/Users/user/esp/esp-idf/components/fatfs/vfs -I/Users/user/esp/esp-idf/components/fatfs/src -I/Users/user/esp/esp-idf/components/idf_test/include -I/Users/user/esp/esp-idf/components/idf_test/include/esp32 -I/Users/user/esp/esp-idf/components/ieee802154/include -I/Users/user/esp/esp-idf/components/json/cJSON -I/Users/user/esp/esp-idf/components/mqtt/esp-mqtt/include -I/Users/user/esp/esp-idf/components/perfmon/include -I/Users/user/esp/esp-idf/components/spiffs/include -I/Users/user/esp/esp-idf/components/wifi_provisioning/include -I/Users/user/esp/esp-idf/examples/common_components/protocol_examples_common/include -I/Users/user/esp/esp-idf/examples/common_components/led_strip/include -I/Users/user/esp/esp-idf/examples/common_components/led_strip/interface -isystem /Users/user/esp/cspot/cspot/bell/external/nanopb -isystem /Users/user/esp/cspot/cspot/bell/external/libhelix-aac -isystem /Users/user/esp/cspot/cspot/bell/external/libhelix-mp3 -isystem /Users/user/esp/cspot/cspot/bell/external/tremor -isystem /Users/user/esp/cspot/cspot/bell/external/cJSON -isystem /Users/user/esp/cspot/cspot/bell/external/fmt/include -isystem /Users/user/esp/cspot/cspot/bell/external/nlohmann_json/include -mlongcalls -Wno-frame-address  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -Og -fmacro-prefix-map=/Users/user/esp/cspot/targets/esp32=. -fmacro-prefix-map=/Users/user/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -fdiagnostics-color=always -std=gnu++2b -fexceptions -fno-rtti -std=gnu++17 -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj -MF esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj -c /Users/user/esp/cspot/targets/esp32/main/main.cpp
In file included from /Users/user/esp/esp-idf/components/driver/deprecated/driver/i2s.h:23,
                 from /Users/user/esp/cspot/cspot/bell/main/audio-sinks/include/esp/ES8311AudioSink.h:13,
                 from /Users/user/esp/cspot/targets/esp32/main/main.cpp:33:
/Users/user/esp/esp-idf/components/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~
/Users/user/esp/esp-idf/components/driver/deprecated/driver/i2s.h:27:2: warning: #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-Wcpp]
   27 | #warning "This set of I2S APIs has been deprecated, \
      |  ^~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In constructor 'CSpotPlayer::CSpotPlayer(std::shared_ptr<cspot::SpircHandler>)':
/Users/user/esp/cspot/targets/esp32/main/main.cpp:88:36: error: invalid use of incomplete type 'using element_type = class cspot::TrackPlayer' {aka 'class cspot::TrackPlayer'}
   88 |     this->handler->getTrackPlayer()->setDataCallback(
      |                                    ^~
In file included from /Users/user/esp/cspot/targets/esp32/main/main.cpp:26:
/Users/user/esp/cspot/cspot/include/SpircHandler.h:15:7: note: forward declaration of 'using element_type = class cspot::TrackPlayer' {aka 'class cspot::TrackPlayer'}
   15 | class TrackPlayer;
      |       ^~~~~~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In member function 'virtual void CSpotTask::runTask()':
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:34: error: 'LoginBlob' was not declared in this scope; did you mean 'cspot::LoginBlob'?
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |                                  ^~~~~~~~~
      |                                  cspot::LoginBlob
In file included from /Users/user/esp/cspot/cspot/include/CSpotContext.h:6,
                 from /Users/user/esp/cspot/targets/esp32/main/main.cpp:24:
/Users/user/esp/cspot/cspot/include/LoginBlob.h:12:7: note: 'cspot::LoginBlob' declared here
   12 | class LoginBlob {
      |       ^~~~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:44: error: no matching function for call to 'make_shared<<expression error> >(const char [11])'
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/memory:77,
                 from /Users/user/esp/cspot/cspot/bell/main/platform/MDNSService.h:4,
                 from /Users/user/esp/cspot/targets/esp32/main/main.cpp:1:
/Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/shared_ptr.h:1005:5: note: candidate: 'template<class _Tp, class ... _Args> std::shared_ptr<typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), _Tp>::type> std::make_shared(_Args&& ...)'
 1005 |     make_shared(_Args&&... __args)
      |     ^~~~~~~~~~~
/Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/shared_ptr.h:1005:5: note:   template argument deduction/substitution failed:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:44: error: template argument 1 is invalid
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In lambda function:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:159:43: error: 'blob' is not captured
  159 |           return server->makeJsonResponse(blob->buildZeroconfInfo());
      |                                           ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:158:40: note: the lambda has no capture-default
  158 |         "/spotify_info", [&server, blob](struct mg_connection* conn) {
      |                                        ^
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:10: note: '<typeprefixerror>blob' declared here
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |          ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In member function 'virtual void CSpotTask::runTask()':
/Users/user/esp/cspot/targets/esp32/main/main.cpp:158:26: error: cannot convert 'CSpotTask::runTask()::<lambda(mg_connection*)>' to 'bell::BellHTTPServer::HTTPHandler' {aka 'std::function<std::unique_ptr<bell::BellHTTPServer::HTTPResponse>(mg_connection*)>'}
  158 |         "/spotify_info", [&server, blob](struct mg_connection* conn) {
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          CSpotTask::runTask()::<lambda(mg_connection*)>
  159 |           return server->makeJsonResponse(blob->buildZeroconfInfo());
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160 |         });
      |         ~                 
In file included from /Users/user/esp/cspot/targets/esp32/main/main.cpp:9:
/Users/user/esp/cspot/cspot/bell/main/io/include/BellHTTPServer.h:85:52: note:   initializing argument 2 of 'void bell::BellHTTPServer::registerGet(const std::string&, HTTPHandler)'
   85 |   void registerGet(const std::string&, HTTPHandler handler);
      |                                        ~~~~~~~~~~~~^~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In lambda function:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:163:11: error: 'nlohmann' has not been declared
  163 |           nlohmann::json obj;
      |           ^~~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:164:11: error: 'obj' was not declared in this scope
  164 |           obj["status"] = 101;
      |           ^~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:182:13: error: 'blob' is not captured
  182 |             blob->loadZeroconfQuery(queryMap);
      |             ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:162:50: note: the lambda has no capture-default
  162 |         "/spotify_info", [&server, blob, &gotBlob](struct mg_connection* conn) {
      |                                                  ^
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:10: note: '<typeprefixerror>blob' declared here
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |          ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In member function 'virtual void CSpotTask::runTask()':
/Users/user/esp/cspot/targets/esp32/main/main.cpp:162:26: error: cannot convert 'CSpotTask::runTask()::<lambda(mg_connection*)>' to 'bell::BellHTTPServer::HTTPHandler' {aka 'std::function<std::unique_ptr<bell::BellHTTPServer::HTTPResponse>(mg_connection*)>'}
  162 |         "/spotify_info", [&server, blob, &gotBlob](struct mg_connection* conn) {
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          CSpotTask::runTask()::<lambda(mg_connection*)>
  163 |           nlohmann::json obj;
      |           ~~~~~~~~~~~~~~~~~~~
  164 |           obj["status"] = 101;
      |           ~~~~~~~~~~~~~~~~~~~~
  165 |           obj["spotifyError"] = 0;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~
  166 |           obj["statusString"] = "ERROR-OK";
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  167 | 
      |                           
  168 |           std::string body = "";
      |           ~~~~~~~~~~~~~~~~~~~~~~
  169 |           auto requestInfo = mg_get_request_info(conn);
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  170 |           if (requestInfo->content_length > 0) {
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  171 |             body.resize(requestInfo->content_length);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  172 |             mg_read(conn, body.data(), requestInfo->content_length);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  173 | 
      |                           
  174 |             mg_header hd[10];
      |             ~~~~~~~~~~~~~~~~~
  175 |             int num = mg_split_form_urlencoded(body.data(), hd, 10);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  176 |             std::map<std::string, std::string> queryMap;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177 | 
      |                           
  178 |             for (int i = 0; i < num; i++) {
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  179 |               queryMap[hd[i].name] = hd[i].value;
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  180 |             }
      |             ~             
  181 | 
      |                           
  182 |             blob->loadZeroconfQuery(queryMap);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  183 |             gotBlob = true;
      |             ~~~~~~~~~~~~~~~
  184 |           }
      |           ~               
  185 | 
      |                           
  186 |           return server->makeJsonResponse(obj.dump());
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  187 |         });
      |         ~                 
/Users/user/esp/cspot/cspot/bell/main/io/include/BellHTTPServer.h:86:53: note:   initializing argument 2 of 'void bell::BellHTTPServer::registerPost(const std::string&, HTTPHandler)'
   86 |   void registerPost(const std::string&, HTTPHandler handler);
      |                                         ~~~~~~~~~~~~^~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: At global scope:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:223:13: warning: 'void cspotTask(void*)' defined but not used [-Wunused-function]
  223 | static void cspotTask(void* pvParameters) {
      |             ^~~~~~~~~
[1225/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellTar.cpp.obj
[1226/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/CircularBuffer.cpp.obj
[1227/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellMQTTClient.cpp.obj
/Users/user/esp/cspot/cspot/bell/main/io/BellMQTTClient.cpp: In member function 'void bell::MQTTClient::connect(const std::string&, uint16_t, const std::string&, const std::string&)':
/Users/user/esp/cspot/cspot/bell/main/io/BellMQTTClient.cpp:30:7: warning: unused variable 'status' [-Wunused-variable]
   30 |   int status = fcntl(socket.getFd(), F_SETFL,
      |       ^~~~~~
[1228/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/FileStream.cpp.obj
[1229/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/TrackPlayer.cpp.obj
/Users/user/esp/cspot/cspot/src/TrackPlayer.cpp: In member function 'virtual void cspot::TrackPlayer::runTask()':
/Users/user/esp/cspot/cspot/src/TrackPlayer.cpp:187:15: warning: unused variable 'r' [-Wunused-variable]
  187 |       int32_t r =
      |               ^
[1230/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BufferedStream.cpp.obj
[1231/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/EncodedAudioStream.cpp.obj
[1232/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/MercurySession.cpp.obj
/Users/user/esp/cspot/cspot/src/MercurySession.cpp: In member function 'cspot::MercurySession::Response cspot::MercurySession::decodeResponse(const std::vector<unsigned char>&)':
/Users/user/esp/cspot/cspot/src/MercurySession.cpp:222:8: warning: unused variable 'sequenceLength' [-Wunused-variable]
  222 |   auto sequenceLength = ntohs(extract<uint16_t>(data, 0));
      |        ^~~~~~~~~~~~~~
/Users/user/esp/cspot/cspot/src/MercurySession.cpp:225:8: warning: unused variable 'partsNumber' [-Wunused-variable]
  225 |   auto partsNumber = ntohs(extract<uint16_t>(data, 11));
      |        ^~~~~~~~~~~
[1233/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/SpircHandler.cpp.obj
[1234/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/AccessKeyFetcher.cpp.obj
/Users/user/esp/cspot/cspot/src/AccessKeyFetcher.cpp: In member function 'void cspot::AccessKeyFetcher::updateAccessKey()':
/Users/user/esp/cspot/cspot/src/AccessKeyFetcher.cpp:123:13: warning: unused variable 'expiresIn' [-Wunused-variable]
  123 |         int expiresIn = loginResponse.response.ok.access_token_expires_in / 2;
      |             ^~~~~~~~~
[1235/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/ApResolve.cpp.obj
[1236/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/CDNAudioFile.cpp.obj
[1237/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/LoginBlob.cpp.obj
[1238/1500] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj
[1239/1500] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/TrackQueue.cpp.obj
/Users/user/esp/cspot/cspot/src/TrackQueue.cpp: In member function 'void cspot::QueuedTrack::stepParseMetadata(Track*, Episode*)':
/Users/user/esp/cspot/cspot/src/TrackQueue.cpp:151:7: warning: unused variable 'alternativeCount' [-Wunused-variable]
  151 |   int alternativeCount, filesCount = 0;
      |       ^~~~~~~~~~~~~~~~
/Users/user/esp/cspot/cspot/src/TrackQueue.cpp:152:8: warning: unused variable 'canPlay' [-Wunused-variable]
  152 |   bool canPlay = false;
      |        ^~~~~~~
ninja: build stopped: subcommand failed.

@myreauks myreauks changed the title ESP-IDF version for ESP32 target ESP32 Build errors with ESP-IDF v5.1.1 Sep 15, 2023
@LaurentMe
Copy link

I'm having the exact same issue, if I make any progress I'll let you know!

@myreauks
Copy link
Author

myreauks commented Sep 18, 2023

I managed to fix the error with 'endian' not being recognised by removing the #ifndef from the following lines in BinaryStream.h:

3 #ifndef ESP_PLATFORM
4 #include <bit>  // for endian
5 #endif

This makes me think that somehow the ESP_PLATFORM definition is not being passed here.
The rest of the errors are still there, but those might have to do with the same issue.

@myreauks
Copy link
Author

myreauks commented Oct 13, 2023

I have tried this again with the newest commits and the build starts to fail in step 1234 with the main.cpp with the following error message:

[1225/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellMQTTClient.cpp.obj
/Users/user/esp/cspot/cspot/bell/main/io/BellMQTTClient.cpp: In member function 'void bell::MQTTClient::connect(const std::string&, uint16_t, const std::string&, const std::string&)':
/Users/user/esp/cspot/cspot/bell/main/io/BellMQTTClient.cpp:36:7: warning: unused variable 'status' [-Wunused-variable]
   36 |   int status = fcntl(socket.getFd(), F_SETFL,
      |       ^~~~~~
[1226/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/TrackPlayer.cpp.obj
/Users/user/esp/cspot/cspot/src/TrackPlayer.cpp: In member function 'virtual void cspot::TrackPlayer::runTask()':
/Users/user/esp/cspot/cspot/src/TrackPlayer.cpp:192:15: warning: unused variable 'r' [-Wunused-variable]
  192 |       int32_t r =
      |               ^
[1227/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BufferedStream.cpp.obj
[1228/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/FileStream.cpp.obj
[1229/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/MGStreamAdapter.cpp.obj
[1230/1616] Building C object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/picohttpparser.c.obj
[1231/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/MercurySession.cpp.obj
/Users/user/esp/cspot/cspot/src/MercurySession.cpp: In member function 'cspot::MercurySession::Response cspot::MercurySession::decodeResponse(const std::vector<unsigned char>&)':
/Users/user/esp/cspot/cspot/src/MercurySession.cpp:222:8: warning: unused variable 'sequenceLength' [-Wunused-variable]
  222 |   auto sequenceLength = ntohs(extract<uint16_t>(data, 0));
      |        ^~~~~~~~~~~~~~
/Users/user/esp/cspot/cspot/src/MercurySession.cpp:225:8: warning: unused variable 'partsNumber' [-Wunused-variable]
  225 |   auto partsNumber = ntohs(extract<uint16_t>(data, 11));
      |        ^~~~~~~~~~~
[1232/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/EncodedAudioStream.cpp.obj
[1233/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/PlaybackState.cpp.obj
[1234/1616] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj 
/Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM -DFMT_HEADER_ONLY -DIDF_VER=\"v5.1.1\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPB_ENABLE_MALLOC -DPB_FIELD_32BIT -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DUNITY_INCLUDE_CONFIG_H -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/Users/user/esp/cspot/targets/esp32/build/config -I/Users/user/esp/cspot/targets/esp32/main -I/Users/user/esp/esp-idf/components/newlib/platform_include -I/Users/user/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/Users/user/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/Users/user/esp/esp-idf/components/freertos/esp_additions/include/freertos -I/Users/user/esp/esp-idf/components/freertos/esp_additions/include -I/Users/user/esp/esp-idf/components/freertos/esp_additions/arch/xtensa/include -I/Users/user/esp/esp-idf/components/esp_hw_support/include -I/Users/user/esp/esp-idf/components/esp_hw_support/include/soc -I/Users/user/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -I/Users/user/esp/esp-idf/components/esp_hw_support/port/esp32/. -I/Users/user/esp/esp-idf/components/esp_hw_support/port/esp32/private_include -I/Users/user/esp/esp-idf/components/heap/include -I/Users/user/esp/esp-idf/components/log/include -I/Users/user/esp/esp-idf/components/soc/include -I/Users/user/esp/esp-idf/components/soc/esp32 -I/Users/user/esp/esp-idf/components/soc/esp32/include -I/Users/user/esp/esp-idf/components/hal/esp32/include -I/Users/user/esp/esp-idf/components/hal/include -I/Users/user/esp/esp-idf/components/hal/platform_port/include -I/Users/user/esp/esp-idf/components/esp_rom/include -I/Users/user/esp/esp-idf/components/esp_rom/include/esp32 -I/Users/user/esp/esp-idf/components/esp_rom/esp32 -I/Users/user/esp/esp-idf/components/esp_common/include -I/Users/user/esp/esp-idf/components/esp_system/include -I/Users/user/esp/esp-idf/components/esp_system/port/soc -I/Users/user/esp/esp-idf/components/esp_system/port/include/private -I/Users/user/esp/esp-idf/components/xtensa/include -I/Users/user/esp/esp-idf/components/xtensa/esp32/include -I/Users/user/esp/esp-idf/components/esp_timer/include -I/Users/user/esp/esp-idf/components/lwip/include -I/Users/user/esp/esp-idf/components/lwip/include/apps -I/Users/user/esp/esp-idf/components/lwip/include/apps/sntp -I/Users/user/esp/esp-idf/components/lwip/lwip/src/include -I/Users/user/esp/esp-idf/components/lwip/port/include -I/Users/user/esp/esp-idf/components/lwip/port/freertos/include -I/Users/user/esp/esp-idf/components/lwip/port/esp32xx/include -I/Users/user/esp/esp-idf/components/lwip/port/esp32xx/include/arch -I/Users/user/esp/esp-idf/components/mdns/include -I/Users/user/esp/esp-idf/components/console -I/Users/user/esp/esp-idf/components/vfs/include -I/Users/user/esp/esp-idf/components/esp_netif/include -I/Users/user/esp/esp-idf/components/esp_event/include -I/Users/user/esp/cspot/cspot/include -I/Users/user/esp/cspot/targets/esp32/build/esp-idf/main/cspot -I/Users/user/esp/cspot/cspot/bell/main/audio-codec/include -I/Users/user/esp/cspot/cspot/bell/main/audio-dsp/include -I/Users/user/esp/cspot/cspot/bell/main/audio-sinks/include -I/Users/user/esp/cspot/cspot/bell/main/io/include -I/Users/user/esp/cspot/cspot/bell/main/utilities/include -I/Users/user/esp/cspot/cspot/bell/main/platform -I/Users/user/esp/cspot/cspot/bell/external/mqtt/include -I/Users/user/esp/cspot/cspot/bell/main/audio-containers/include -I/Users/user/esp/cspot/cspot/bell/main/audio-sinks/include/esp -I/Users/user/esp/cspot/cspot/bell/external/civetweb/include -I/Users/user/esp/cspot/targets/esp32/build/esp-idf/main/cspot/bell -I/Users/user/esp/esp-idf/components/mbedtls/port/include -I/Users/user/esp/esp-idf/components/mbedtls/mbedtls/include -I/Users/user/esp/esp-idf/components/mbedtls/mbedtls/library -I/Users/user/esp/esp-idf/components/mbedtls/esp_crt_bundle/include -I/Users/user/esp/esp-idf/components/pthread/include -I/Users/user/esp/esp-idf/components/driver/include -I/Users/user/esp/esp-idf/components/driver/deprecated -I/Users/user/esp/esp-idf/components/driver/analog_comparator/include -I/Users/user/esp/esp-idf/components/driver/dac/include -I/Users/user/esp/esp-idf/components/driver/gpio/include -I/Users/user/esp/esp-idf/components/driver/gptimer/include -I/Users/user/esp/esp-idf/components/driver/i2c/include -I/Users/user/esp/esp-idf/components/driver/i2s/include -I/Users/user/esp/esp-idf/components/driver/ledc/include -I/Users/user/esp/esp-idf/components/driver/mcpwm/include -I/Users/user/esp/esp-idf/components/driver/parlio/include -I/Users/user/esp/esp-idf/components/driver/pcnt/include -I/Users/user/esp/esp-idf/components/driver/rmt/include -I/Users/user/esp/esp-idf/components/driver/sdio_slave/include -I/Users/user/esp/esp-idf/components/driver/sdmmc/include -I/Users/user/esp/esp-idf/components/driver/sigma_delta/include -I/Users/user/esp/esp-idf/components/driver/spi/include -I/Users/user/esp/esp-idf/components/driver/temperature_sensor/include -I/Users/user/esp/esp-idf/components/driver/touch_sensor/include -I/Users/user/esp/esp-idf/components/driver/twai/include -I/Users/user/esp/esp-idf/components/driver/uart/include -I/Users/user/esp/esp-idf/components/driver/usb_serial_jtag/include -I/Users/user/esp/esp-idf/components/driver/touch_sensor/esp32/include -I/Users/user/esp/esp-idf/components/esp_pm/include -I/Users/user/esp/esp-idf/components/esp_ringbuf/include -I/Users/user/esp/cspot/cspot/bell/external/opencore-aacdec/src -I/Users/user/esp/cspot/cspot/bell/external/opencore-aacdec/oscl -I/Users/user/esp/cspot/cspot/bell/external/opencore-aacdec/include -I/Users/user/esp/cspot/cspot/bell/external/opus/include -I/Users/user/esp/esp-idf/components/efuse/include -I/Users/user/esp/esp-idf/components/efuse/esp32/include -I/Users/user/esp/esp-idf/components/esp_app_format/include -I/Users/user/esp/esp-idf/components/bootloader_support/include -I/Users/user/esp/esp-idf/components/bootloader_support/bootloader_flash/include -I/Users/user/esp/esp-idf/components/esp_partition/include -I/Users/user/esp/esp-idf/components/app_update/include -I/Users/user/esp/esp-idf/components/esp_mm/include -I/Users/user/esp/esp-idf/components/spi_flash/include -I/Users/user/esp/esp-idf/components/app_trace/include -I/Users/user/esp/esp-idf/components/nvs_flash/include -I/Users/user/esp/esp-idf/components/esp_phy/include -I/Users/user/esp/esp-idf/components/esp_phy/esp32/include -I/Users/user/esp/esp-idf/components/wpa_supplicant/include -I/Users/user/esp/esp-idf/components/wpa_supplicant/port/include -I/Users/user/esp/esp-idf/components/wpa_supplicant/esp_supplicant/include -I/Users/user/esp/esp-idf/components/esp_coex/include -I/Users/user/esp/esp-idf/components/esp_wifi/include -I/Users/user/esp/esp-idf/components/esp_wifi/wifi_apps/include -I/Users/user/esp/esp-idf/components/bt/include/esp32/include -I/Users/user/esp/esp-idf/components/bt/common/osi/include -I/Users/user/esp/esp-idf/components/bt/common/api/include/api -I/Users/user/esp/esp-idf/components/bt/common/btc/profile/esp/blufi/include -I/Users/user/esp/esp-idf/components/bt/common/btc/profile/esp/include -I/Users/user/esp/esp-idf/components/bt/host/bluedroid/api/include/api -I/Users/user/esp/esp-idf/components/bt/porting/ext/tinycrypt/include -I/Users/user/esp/esp-idf/components/unity/include -I/Users/user/esp/esp-idf/components/unity/unity/src -I/Users/user/esp/esp-idf/components/cmock/CMock/src -I/Users/user/esp/esp-idf/components/http_parser -I/Users/user/esp/esp-idf/components/esp-tls -I/Users/user/esp/esp-idf/components/esp-tls/esp-tls-crypto -I/Users/user/esp/esp-idf/components/esp_adc/include -I/Users/user/esp/esp-idf/components/esp_adc/interface -I/Users/user/esp/esp-idf/components/esp_adc/esp32/include -I/Users/user/esp/esp-idf/components/esp_adc/deprecated/include -I/Users/user/esp/esp-idf/components/esp_eth/include -I/Users/user/esp/esp-idf/components/esp_gdbstub/include -I/Users/user/esp/esp-idf/components/esp_hid/include -I/Users/user/esp/esp-idf/components/tcp_transport/include -I/Users/user/esp/esp-idf/components/esp_http_client/include -I/Users/user/esp/esp-idf/components/esp_http_server/include -I/Users/user/esp/esp-idf/components/esp_https_ota/include -I/Users/user/esp/esp-idf/components/esp_psram/include -I/Users/user/esp/esp-idf/components/esp_lcd/include -I/Users/user/esp/esp-idf/components/esp_lcd/interface -I/Users/user/esp/esp-idf/components/protobuf-c/protobuf-c -I/Users/user/esp/esp-idf/components/protocomm/include/common -I/Users/user/esp/esp-idf/components/protocomm/include/security -I/Users/user/esp/esp-idf/components/protocomm/include/transports -I/Users/user/esp/esp-idf/components/esp_local_ctrl/include -I/Users/user/esp/esp-idf/components/espcoredump/include -I/Users/user/esp/esp-idf/components/espcoredump/include/port/xtensa -I/Users/user/esp/esp-idf/components/wear_levelling/include -I/Users/user/esp/esp-idf/components/sdmmc/include -I/Users/user/esp/esp-idf/components/fatfs/diskio -I/Users/user/esp/esp-idf/components/fatfs/vfs -I/Users/user/esp/esp-idf/components/fatfs/src -I/Users/user/esp/esp-idf/components/idf_test/include -I/Users/user/esp/esp-idf/components/idf_test/include/esp32 -I/Users/user/esp/esp-idf/components/ieee802154/include -I/Users/user/esp/esp-idf/components/json/cJSON -I/Users/user/esp/esp-idf/components/mqtt/esp-mqtt/include -I/Users/user/esp/esp-idf/components/perfmon/include -I/Users/user/esp/esp-idf/components/spiffs/include -I/Users/user/esp/esp-idf/components/wifi_provisioning/include -I/Users/user/esp/esp-idf/examples/common_components/protocol_examples_common/include -I/Users/user/esp/esp-idf/examples/common_components/led_strip/include -I/Users/user/esp/esp-idf/examples/common_components/led_strip/interface -isystem /Users/user/esp/cspot/cspot/bell/external/nanopb -isystem /Users/user/esp/cspot/cspot/bell/external/libhelix-mp3 -isystem /Users/user/esp/cspot/cspot/bell/external/tremor -isystem /Users/user/esp/cspot/cspot/bell/external/cJSON -isystem /Users/user/esp/cspot/cspot/bell/external/fmt/include -isystem /Users/user/esp/cspot/cspot/bell/external/nlohmann_json/include -mlongcalls -Wno-frame-address  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -Og -fmacro-prefix-map=/Users/user/esp/cspot/targets/esp32=. -fmacro-prefix-map=/Users/user/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -fdiagnostics-color=always -std=gnu++2b -fexceptions -fno-rtti -std=gnu++17 -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj -MF esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj -c /Users/user/esp/cspot/targets/esp32/main/main.cpp
In file included from /Users/user/esp/esp-idf/components/driver/deprecated/driver/i2s.h:23,
                 from /Users/user/esp/cspot/cspot/bell/main/audio-sinks/include/esp/ES8311AudioSink.h:13,
                 from /Users/user/esp/cspot/targets/esp32/main/main.cpp:33:
/Users/user/esp/esp-idf/components/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~
/Users/user/esp/esp-idf/components/driver/deprecated/driver/i2s.h:27:2: warning: #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-Wcpp]
   27 | #warning "This set of I2S APIs has been deprecated, \
      |  ^~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In constructor 'CSpotPlayer::CSpotPlayer(std::shared_ptr<cspot::SpircHandler>)':
/Users/user/esp/cspot/targets/esp32/main/main.cpp:88:36: error: invalid use of incomplete type 'using element_type = class cspot::TrackPlayer' {aka 'class cspot::TrackPlayer'}
   88 |     this->handler->getTrackPlayer()->setDataCallback(
      |                                    ^~
In file included from /Users/user/esp/cspot/targets/esp32/main/main.cpp:26:
/Users/user/esp/cspot/cspot/include/SpircHandler.h:15:7: note: forward declaration of 'using element_type = class cspot::TrackPlayer' {aka 'class cspot::TrackPlayer'}
   15 | class TrackPlayer;
      |       ^~~~~~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In member function 'virtual void CSpotTask::runTask()':
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:34: error: 'LoginBlob' was not declared in this scope; did you mean 'cspot::LoginBlob'?
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |                                  ^~~~~~~~~
      |                                  cspot::LoginBlob
In file included from /Users/user/esp/cspot/cspot/include/CSpotContext.h:7,
                 from /Users/user/esp/cspot/targets/esp32/main/main.cpp:24:
/Users/user/esp/cspot/cspot/include/LoginBlob.h:12:7: note: 'cspot::LoginBlob' declared here
   12 | class LoginBlob {
      |       ^~~~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:44: error: no matching function for call to 'make_shared<<expression error> >(const char [12])'
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/memory:77,
                 from /Users/user/esp/cspot/cspot/bell/main/platform/MDNSService.h:4,
                 from /Users/user/esp/cspot/targets/esp32/main/main.cpp:1:
/Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/shared_ptr.h:1005:5: note: candidate: 'template<class _Tp, class ... _Args> std::shared_ptr<typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), _Tp>::type> std::make_shared(_Args&& ...)'
 1005 |     make_shared(_Args&&... __args)
      |     ^~~~~~~~~~~
/Users/user/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/shared_ptr.h:1005:5: note:   template argument deduction/substitution failed:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:44: error: template argument 1 is invalid
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In lambda function:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:159:43: error: 'blob' is not captured
  159 |           return server->makeJsonResponse(blob->buildZeroconfInfo());
      |                                           ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:158:40: note: the lambda has no capture-default
  158 |         "/spotify_info", [&server, blob](struct mg_connection* conn) {
      |                                        ^
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:10: note: '<typeprefixerror>blob' declared here
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |          ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In member function 'virtual void CSpotTask::runTask()':
/Users/user/esp/cspot/targets/esp32/main/main.cpp:158:26: error: cannot convert 'CSpotTask::runTask()::<lambda(mg_connection*)>' to 'bell::BellHTTPServer::HTTPHandler' {aka 'std::function<std::unique_ptr<bell::BellHTTPServer::HTTPResponse>(mg_connection*)>'}
  158 |         "/spotify_info", [&server, blob](struct mg_connection* conn) {
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                          |
      |                          CSpotTask::runTask()::<lambda(mg_connection*)>
  159 |           return server->makeJsonResponse(blob->buildZeroconfInfo());
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160 |         });
      |         ~                 
In file included from /Users/user/esp/cspot/targets/esp32/main/main.cpp:9:
/Users/user/esp/cspot/cspot/bell/main/io/include/BellHTTPServer.h:85:52: note:   initializing argument 2 of 'void bell::BellHTTPServer::registerGet(const std::string&, HTTPHandler)'
   85 |   void registerGet(const std::string&, HTTPHandler handler);
      |                                        ~~~~~~~~~~~~^~~~~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: In lambda function:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:182:13: error: 'blob' is not captured
  182 |             blob->loadZeroconfQuery(queryMap);
      |             ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp:162:50: note: the lambda has no capture-default
  162 |         "/spotify_info", [&server, blob, &gotBlob](struct mg_connection* conn) {
      |                                                  ^
/Users/user/esp/cspot/targets/esp32/main/main.cpp:154:10: note: '<typeprefixerror>blob' declared here
  154 |     auto blob = std::make_shared<LoginBlob>(DEVICE_NAME);
      |          ^~~~
/Users/user/esp/cspot/targets/esp32/main/main.cpp: At global scope:
/Users/user/esp/cspot/targets/esp32/main/main.cpp:223:13: warning: 'void cspotTask(void*)' defined but not used [-Wunused-function]
  223 | static void cspotTask(void* pvParameters) {
      |             ^~~~~~~~~
[1235/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/TLSSocket.cpp.obj
[1236/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/utilities/NanoPBExtensions.cpp.obj
[1237/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/utilities/Crypto.cpp.obj
[1238/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/utilities/BellLogger.cpp.obj
[1239/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/utilities/BellUtils.cpp.obj
[1240/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/X509Bundle.cpp.obj
[1241/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/SocketStream.cpp.obj
[1242/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/AccessKeyFetcher.cpp.obj
/Users/user/esp/cspot/cspot/src/AccessKeyFetcher.cpp: In member function 'void cspot::AccessKeyFetcher::updateAccessKey()':
/Users/user/esp/cspot/cspot/src/AccessKeyFetcher.cpp:123:13: warning: unused variable 'expiresIn' [-Wunused-variable]
  123 |         int expiresIn = loginResponse.response.ok.access_token_expires_in / 2;
      |             ^~~~~~~~~
[1243/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/utilities/NanoPBHelper.cpp.obj
/Users/user/esp/cspot/cspot/bell/main/utilities/NanoPBHelper.cpp: In function 'bool vectorWrite(pb_ostream_t*, const pb_byte_t*, size_t)':
/Users/user/esp/cspot/cspot/bell/main/utilities/NanoPBHelper.cpp:12:10: warning: unused variable 'i' [-Wunused-variable]
   12 |   size_t i;
      |          ^
[1244/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/HTTPClient.cpp.obj
/Users/user/esp/cspot/cspot/bell/main/io/HTTPClient.cpp: In member function 'void bell::HTTPClient::Response::readResponseHeaders()':
/Users/user/esp/cspot/cspot/bell/main/io/HTTPClient.cpp:66:9: warning: unused variable 'method' [-Wunused-variable]
   66 |   char *method, *path;
      |         ^~~~~~
/Users/user/esp/cspot/cspot/bell/main/io/HTTPClient.cpp:66:18: warning: unused variable 'path' [-Wunused-variable]
   66 |   char *method, *path;
      |                  ^~~~
[1245/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/SpircHandler.cpp.obj
[1246/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/ApResolve.cpp.obj
[1247/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/CDNAudioFile.cpp.obj
[1248/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/LoginBlob.cpp.obj
[1249/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/URLParser.cpp.obj
[1250/1616] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj
[1251/1616] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/TrackQueue.cpp.obj
/Users/user/esp/cspot/cspot/src/TrackQueue.cpp: In member function 'void cspot::QueuedTrack::stepParseMetadata(Track*, Episode*)':
/Users/user/esp/cspot/cspot/src/TrackQueue.cpp:151:7: warning: unused variable 'alternativeCount' [-Wunused-variable]
  151 |   int alternativeCount, filesCount = 0;
      |       ^~~~~~~~~~~~~~~~
/Users/user/esp/cspot/cspot/src/TrackQueue.cpp:152:8: warning: unused variable 'canPlay' [-Wunused-variable]
  152 |   bool canPlay = false;
      |        ^~~~~~~
ninja: build stopped: subcommand failed.

@playduck
Copy link

Hi, @myreauks when you mention

manually installing the led_strip and mdns components.
I'm wondering how exactly you are doing this considering the led_strip is an idf example project and afaik not meant to be imported?
I'm running into cmake errors when I try to manually move the led_strip example project within the idf.

@myreauks
Copy link
Author

Hi, @myreauks when you mention

manually installing the led_strip and mdns components.
I'm wondering how exactly you are doing this considering the led_strip is an idf example project and afaik not meant to be imported?
I'm running into cmake errors when I try to manually move the led_strip example project within the idf.

Hi,
I downloaded the library from here:
https://components.espressif.com/components/espressif/led_strip

After that I manually added the library folder to the following path: esp-idf/examples/common-components/
Not sure if this is the correct way to go about it, but at least for me it fixed the compile errors related to led-strip library.

@tobiasguyer
Copy link

tobiasguyer commented Dec 20, 2023

You can use my fork, should work for esp32, if you'll use a esp32 s3, you'll have to edit the sdkconfig file
Should be compilable with idf5, as soon as you've added the mdns.h file.. espressif decided to host the mdns library in a yet for me unknown respository, but you'll find the files in the idf4 repo

@playduck
Copy link

playduck commented Dec 21, 2023

I've gotten this to build using @tobiasguyer's fork (I haven't test it with this official repo yet and I haven't tested it on HW. The build finishes without errors though).

I'm using esp-idf-v5.1.1.
Things I've modified in cspot:

  • targets/esp32/CMakeLists.txt: Commented out line 8 -> # list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/led_strip)
  • targets/esp32/main/CMakeLists.txt: Added after line 11 (inside idf_component_register) -> REQUIRES led_strip mdns spiffs esp_wifi nvs_flash protocol_examples_common

The components spiffs, esp_wifi, nvs_flash are from esp-idf.
You can get the modules led_strip and mdns from https://components.espressif.com by running:

$>  idf.py add-dependency "espressif/mdns^1.2.2"
$>  idf.py add-dependency "espressif/led_strip^2.5.2"

This is a new thing for v5 (also introduces the cmake REQUIRES keyword). You can read more about it here: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#component-requirements

The protocol_examples_common module is also provided by esp-idf, however this is not an intended component to be used (as it's an example. Thus we still need targets/esp32/CMakeLists.txt:7). The reliance on example code should probably be avoided.

@myreauks
Copy link
Author

Hi!
Thanks for the tips!
I got it to build further than before with this, but it fails at 1331/1671 with the following error message:

In file included from /Users/myreauks/git/cspot/cspot/bell/main/io/include/BellHTTPServer.h:15,
                 from /Users/myreauks/git/cspot/cspot/bell/main/io/BellHTTPServer.cpp:1:
/Users/myreauks/git/cspot/cspot/bell/external/civetweb/include/CivetServer.h:291:22: error: 'virtual void CivetWebSocketHandler::handleClose(CivetServer*, const mg_connection*)' was hidden [-Werror=overloaded-virtual=]
  291 |         virtual void handleClose(CivetServer *server,

Are you using a certain commit of Bell or how did you manage to get past this?

@playduck
Copy link

I didn't actually do anything with Bell.
Maybe you're using an old/modified version of the idf?
Here's the list of steps I just used to reproduce a build:

mkdir temp
cd temp
# get idf version 5.1.1 and install it
git clone -b v5.1.1 --recursive https://github.com/espressif/esp-idf.git esp-idf-v5.1.1\n
cd esp-idf-v5.1.1
./install.sh
source ./export.sh
cd ..
# get the forked version of cspot (haven't tested the original version yet)
git clone --recursive https://github.com/tobiasguyer/cspot.git
cd cspot/targets/esp32
code . #make the aforementioned changes to the two cmake files in your favourite editor
# get the two required dependencies
idf.py add-dependency "espressif/led_strip^2.5.2"
idf.py add-dependency "espressif/mdns^1.2.2"
idf.py set-target esp32
idf.py menuconfig # no changes required here
idf.py build
# project build complete

@myreauks
Copy link
Author

myreauks commented Dec 22, 2023

This is great thanks! It seems that I had accidentally installed a newer version of the idf and that was the problem. Changing to 5.1.1 fixed everything! I will still have to verify the functionality on a board, but seems very promising.

@xris99
Copy link

xris99 commented Dec 23, 2023

Thank you. Your patch build well, however on the board (esp32-wrover) I get a core dump directly after wifi connection and cspot starts. No messages between start and crash.
I'm using a PCM5102 interface. Looks like a null-pointer to me.

@tobiasguyer
Copy link

All good.. i'll update a working repo in the next days.. first problem is the defconf.default, wich doesn't include the psram settings, and zeroconf(the cspot task) needs to be called from a specific core.
I'll check my working repo and update it as soon as possible..

@xris99
Copy link

xris99 commented Dec 24, 2023

Cool, thank you so much. Looking forward to it and happy to test.

@tobiasguyer
Copy link

i've fixed it! let me know if it works for you

@xris99
Copy link

xris99 commented Dec 25, 2023

Thank you so much.
Now I get a build error with your new code.
To make sure it's a clean build, I deleted completely and did a fresh checkout (even incl. the idf).

This is the error I get:
/root/temp/cspot/cspot/bell/main/io/BellHTTPServer.cpp: In member function 'virtual bool bell::BellHTTPServer::handleGet(CivetServer*, mg_connection*)':
/root/temp/cspot/cspot/bell/main/io/BellHTTPServer.cpp:151:28: error: exception handling disabled, use '-fexceptions' to enable
151 | } catch (std::exception& e) {
| ^
In file included from /root/temp/cspot/cspot/bell/main/io/include/BellHTTPServer.h:3,
from /root/temp/cspot/cspot/bell/main/io/BellHTTPServer.cpp:1:
/root/temp/cspot/cspot/bell/main/io/BellHTTPServer.cpp:152:71: error: 'e' was not declared in this scope; did you mean 'std::numbers::e'?
152 | BELL_LOG(error, "HttpServer", "Exception occured in handler: %s", e.what());
| ^
/root/temp/cspot/cspot/bell/main/utilities/include/BellLogger.h:145:54: note: in definition of macro 'BELL_LOG'
145 | bell::bellGlobalLogger->type(FILE, LINE, VA_ARGS);
| ^~~~~~~~~~~
In file included from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/max_size_type.h:37,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/ranges_base.h:38,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/string_view:50,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/basic_string.h:47,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/string:53,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/locale_classes.h:40,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/ios_base.h:41,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/ios:42,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/istream:38,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/sstream:38,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/chrono:41,
from /root/temp/cspot/cspot/bell/main/utilities/include/BellLogger.h:6:
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/numbers:122:27: note: 'std::numbers::e' declared here
122 | inline constexpr double e = e_v;
| ^
/root/temp/cspot/cspot/bell/main/io/BellHTTPServer.cpp: In member function 'virtual bool bell::BellHTTPServer::handlePost(CivetServer*, mg_connection*)':
/root/temp/cspot/cspot/bell/main/io/BellHTTPServer.cpp:184:71: error: 'e' was not declared in this scope; did you mean 'std::numbers::e'?
184 | BELL_LOG(error, "HttpServer", "Exception occured in handler: %s", e.what());
| ^
/root/temp/cspot/cspot/bell/main/utilities/include/BellLogger.h:145:54: note: in definition of macro 'BELL_LOG'
145 | bell::bellGlobalLogger->type(FILE, LINE, VA_ARGS);
| ^~~~~~~~~~~
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/numbers:122:27: note: 'std::numbers::e' declared here
122 | inline constexpr double e = e_v;
| ^
[781/1308] Building C object esp-idf/c...f_console.dir/argtable3/arg_file.c.objninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /root/temp/cspot/targets/esp32/build/log/idf_py_stderr_output_13614 and /root/temp/cspot/targets/esp32/build/log/idf_py_stdout_output_13614

@tobiasguyer
Copy link

tobiasguyer commented Dec 25, 2023

I'm totally sorry. Sdkconfig.default got somehow lost in the upload. i've just tested a new clone and it works for me. I apologize for all the work you had and i hope, that everything works now.

@xris99
Copy link

xris99 commented Dec 26, 2023

Thank you so much @tobiasguyer for your help. I had an issue with my build environment, namely the protobuf version installed.

If others run into issues as well, make sure you have the followling:
After

idf.py add-dependency "espressif/mdns^1.2.2" 

in the instructions above, make sure you have protobuf installed in version 3.20.1

apt-get install protobuf-compiler
pip install python3-protobuf
pip install protobuf==3.20.1

then continue with the instructions above starting with

idf.py set-target esp32

Thank you so much for your help. Will try on the device now.

@myreauks
Copy link
Author

myreauks commented Jan 4, 2024

I finally had the chance to flash this on device. I have not yet connected to a DAC, but Spotify connects successfully to the ESP and starts playing so it seems very promising.

@LeoSum8
Copy link

LeoSum8 commented Jan 9, 2024

Thank you @tobiasguyer for the fork and @playduck for the detailed steps.
However I can't complete the build as I am running into errors when following the steps in #156 (comment)

I am not 100% sure what the final CMakeLists.txt should look like as I don't really understand the second change that you make. Currently I have:

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

# Don't override EXTRA_COMPONENT_DIRS as platformio uses it.  Instead we append
# see https://github.com/platformio/platform-espressif32/issues/341
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
# list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/led_strip)

if(NOT IDF_NO_INCLUDE)
    include($ENV{IDF_PATH}/tools/cmake/project.cmake)
#    REQUIRES led_strip mdns spiffs esp_wifi nvs_flash protocol_examples_common
endif()
project(cspot-esp32)

As you can see, I commented out the line REQUIRES led_strip mdns spiffs esp_wifi nvs_flash protocol_examples_common since it leads to an error:

leosum8@macmini:~/cspot/cspot/targets/esp32$ idf.py set-target esp32
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Build directory '/home/leosum8/cspot/cspot/targets/esp32/build' not found. Nothing to clean.
Executing action: set-target
Set Target to: esp32, new sdkconfig will be created.
Running cmake in directory /home/leosum8/cspot/cspot/targets/esp32/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/leosum8/.espressif/python_env/idf5.3_py3.11_env/bin/python -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=0 /home/leosum8/cspot/cspot/targets/esp32"...
-- Found Git: /usr/bin/git (found version "2.43.0") 
CMake Error at /home/leosum8/esp/esp-idf/tools/cmake/project.cmake:465 (message):
  Directory specified in EXTRA_COMPONENT_DIRS doesn't exist:
  /home/leosum8/esp/esp-idf/examples/common_components/led_strip
Call Stack (most recent call first):
  /home/leosum8/esp/esp-idf/tools/cmake/project.cmake:549 (__project_init)
  CMakeLists.txt:13 (project)


-- Configuring incomplete, errors occurred!
HINT: The component with path specified in the EXTRA_COMPONENT_DIRS variable has been moved to IDF component manager (or has been removed).
Please look out for component in 'https://components.espressif.com' and add using 'idf.py add-dependency' command.
Refer to the migration guide for more details.
cmake failed with exit code 1, output of the command is in the /home/leosum8/cspot/cspot/targets/esp32/build/log/idf_py_stderr_output_7503 and /home/leosum8/cspot/cspot/targets/esp32/build/log/idf_py_stdout_output_7503

when commenting out and repeating the set-target, I get:

leo@macmini:~/cspot/cspot/targets/esp32$ idf.py set-target esp32
Adding "set-target"'s dependency "fullclean" to list of commands with default set of options.
Executing action: fullclean
Directory '/home/leo/cspot/cspot/targets/esp32/build' doesn't seem to be a CMake build directory. Refusing to automatically delete files in this directory. Delete the directory manually to 'clean' it.

manually removing the folder doesn't get rid of this error, I reappers every time.

Despite this error I can continue with menuconfig and start building. But building fails with:

...
[1320/1672] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj
FAILED: esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj 
/home/leosum8/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM -DFMT_HEADER_ONLY -DIDF_VER=\"v5.3-dev-1288-g5524b692ee\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPB_ENABLE_MALLOC -DPB_FIELD_32BIT -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -DUSE_DEFAULT_STDLIB="1 -DTARGET_OS_IPHONE=0" -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/home/leosum8/cspot/cspot/targets/esp32/build/config -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-codec/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-dsp/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-sinks/include -I/home/leosum8/cspot/cspot/cspot/bell/main/io/include -I/home/leosum8/cspot/cspot/cspot/bell/main/utilities/include -I/home/leosum8/cspot/cspot/cspot/bell/main/platform -I/home/leosum8/cspot/cspot/cspot/bell/external/mqtt/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-containers/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-sinks/include/esp -I/home/leosum8/cspot/cspot/cspot/bell/external/civetweb/include -I/home/leosum8/cspot/cspot/targets/esp32/build/esp-idf/main/cspot/bell -I/home/leosum8/esp/esp-idf/components/newlib/platform_include -I/home/leosum8/esp/esp-idf/components/freertos/config/include -I/home/leosum8/esp/esp-idf/components/freertos/config/include/freertos -I/home/leosum8/esp/esp-idf/components/freertos/config/xtensa/include -I/home/leosum8/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/leosum8/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/home/leosum8/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -I/home/leosum8/esp/esp-idf/components/freertos/esp_additions/include -I/home/leosum8/esp/esp-idf/components/esp_hw_support/include -I/home/leosum8/esp/esp-idf/components/esp_hw_support/include/soc -I/home/leosum8/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -I/home/leosum8/esp/esp-idf/components/esp_hw_support/port/esp32/. -I/home/leosum8/esp/esp-idf/components/heap/include -I/home/leosum8/esp/esp-idf/components/log/include -I/home/leosum8/esp/esp-idf/components/soc/include -I/home/leosum8/esp/esp-idf/components/soc/esp32 -I/home/leosum8/esp/esp-idf/components/soc/esp32/include -I/home/leosum8/esp/esp-idf/components/hal/platform_port/include -I/home/leosum8/esp/esp-idf/components/hal/esp32/include -I/home/leosum8/esp/esp-idf/components/hal/include -I/home/leosum8/esp/esp-idf/components/esp_rom/include -I/home/leosum8/esp/esp-idf/components/esp_rom/include/esp32 -I/home/leosum8/esp/esp-idf/components/esp_rom/esp32 -I/home/leosum8/esp/esp-idf/components/esp_common/include -I/home/leosum8/esp/esp-idf/components/esp_system/include -I/home/leosum8/esp/esp-idf/components/esp_system/port/soc -I/home/leosum8/esp/esp-idf/components/esp_system/port/include/private -I/home/leosum8/esp/esp-idf/components/xtensa/esp32/include -I/home/leosum8/esp/esp-idf/components/xtensa/include -I/home/leosum8/esp/esp-idf/components/xtensa/deprecated_include -I/home/leosum8/esp/esp-idf/components/esp_timer/include -I/home/leosum8/esp/esp-idf/components/lwip/include -I/home/leosum8/esp/esp-idf/components/lwip/include/apps -I/home/leosum8/esp/esp-idf/components/lwip/include/apps/sntp -I/home/leosum8/esp/esp-idf/components/lwip/lwip/src/include -I/home/leosum8/esp/esp-idf/components/lwip/port/include -I/home/leosum8/esp/esp-idf/components/lwip/port/freertos/include -I/home/leosum8/esp/esp-idf/components/lwip/port/esp32xx/include -I/home/leosum8/esp/esp-idf/components/lwip/port/esp32xx/include/arch -I/home/leosum8/esp/esp-idf/components/lwip/port/esp32xx/include/sys -I/home/leosum8/cspot/cspot/targets/esp32/managed_components/espressif__mdns/include -I/home/leosum8/esp/esp-idf/components/console -I/home/leosum8/esp/esp-idf/components/vfs/include -I/home/leosum8/esp/esp-idf/components/esp_netif/include -I/home/leosum8/esp/esp-idf/components/esp_event/include -I/home/leosum8/esp/esp-idf/components/mbedtls/port/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/library -I/home/leosum8/esp/esp-idf/components/mbedtls/esp_crt_bundle/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/everest/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/p256-m -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/p256-m/p256-m -I/home/leosum8/esp/esp-idf/components/pthread/include -I/home/leosum8/esp/esp-idf/components/driver/deprecated -I/home/leosum8/esp/esp-idf/components/driver/i2c/include -I/home/leosum8/esp/esp-idf/components/driver/touch_sensor/include -I/home/leosum8/esp/esp-idf/components/driver/twai/include -I/home/leosum8/esp/esp-idf/components/driver/usb_serial_jtag/include -I/home/leosum8/esp/esp-idf/components/driver/touch_sensor/esp32/include -I/home/leosum8/esp/esp-idf/components/esp_pm/include -I/home/leosum8/esp/esp-idf/components/esp_ringbuf/include -I/home/leosum8/esp/esp-idf/components/esp_driver_gpio/include -I/home/leosum8/esp/esp-idf/components/esp_driver_pcnt/include -I/home/leosum8/esp/esp-idf/components/esp_driver_gptimer/include -I/home/leosum8/esp/esp-idf/components/esp_driver_spi/include -I/home/leosum8/esp/esp-idf/components/esp_driver_mcpwm/include -I/home/leosum8/esp/esp-idf/components/esp_driver_ana_cmpr/include -I/home/leosum8/esp/esp-idf/components/esp_driver_i2s/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdmmc/include -I/home/leosum8/esp/esp-idf/components/sdmmc/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdspi/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdio/include -I/home/leosum8/esp/esp-idf/components/esp_driver_dac/include -I/home/leosum8/esp/esp-idf/components/esp_driver_rmt/include -I/home/leosum8/esp/esp-idf/components/esp_driver_tsens/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdm/include -I/home/leosum8/esp/esp-idf/components/esp_driver_i2c/include -I/home/leosum8/esp/esp-idf/components/esp_driver_uart/include -I/home/leosum8/esp/esp-idf/components/esp_driver_ledc/include -I/home/leosum8/esp/esp-idf/components/esp_driver_parlio/include -I/home/leosum8/cspot/cspot/cspot/bell/external/opencore-aacdec/src -I/home/leosum8/cspot/cspot/cspot/bell/external/opencore-aacdec/oscl -I/home/leosum8/cspot/cspot/cspot/bell/external/opencore-aacdec/include -I/home/leosum8/cspot/cspot/cspot/bell/external/opus/include -isystem /home/leosum8/cspot/cspot/cspot/bell/external/nanopb -isystem /home/leosum8/cspot/cspot/cspot/bell/external/libhelix-mp3 -isystem /home/leosum8/cspot/cspot/cspot/bell/external/tremor -isystem /home/leosum8/cspot/cspot/cspot/bell/external/cJSON -isystem /home/leosum8/cspot/cspot/cspot/bell/external/fmt/include -isystem /home/leosum8/cspot/cspot/cspot/bell/external/nlohmann_json/include -mlongcalls -Wno-frame-address  -std=gnu++20 -fdiagnostics-color=always   -Wunused-const-variable -Wchar-subscripts -Wunused-label -Wmaybe-uninitialized -Wmisleading-indentation -Wno-stringop-overflow -Wno-error=format -Wno-format -Wno-stringop-overread -Wno-stringop-overflow -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -Og -fno-shrink-wrap -fmacro-prefix-map=/home/leosum8/cspot/cspot/targets/esp32=. -fmacro-prefix-map=/home/leosum8/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -fdiagnostics-color=always -std=gnu++2b -fexceptions -fno-rtti -MD -MT esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj -MF esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj.d -o esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj -c /home/leosum8/cspot/cspot/cspot/bell/main/io/BellHTTPServer.cpp
In file included from /home/leosum8/cspot/cspot/cspot/bell/main/io/include/BellHTTPServer.h:15,
                 from /home/leosum8/cspot/cspot/cspot/bell/main/io/BellHTTPServer.cpp:1:
/home/leosum8/cspot/cspot/cspot/bell/external/civetweb/include/CivetServer.h:291:22: error: 'virtual void CivetWebSocketHandler::handleClose(CivetServer*, const mg_connection*)' was hidden [-Werror=overloaded-virtual=]
  291 |         virtual void handleClose(CivetServer *server,
      |                      ^~~~~~~~~~~
/home/leosum8/cspot/cspot/cspot/bell/main/io/BellHTTPServer.cpp:50:16: note:   by 'virtual void WebSocketHandler::handleClose(CivetServer*, mg_connection*)'
   50 |   virtual void handleClose(CivetServer* server, struct mg_connection* conn) {
      |                ^~~~~~~~~~~
cc1plus: some warnings being treated as errors
[1329/1672] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/TrackQueue.cpp.obj
/home/leosum8/cspot/cspot/cspot/src/TrackQueue.cpp: In member function 'void cspot::QueuedTrack::stepParseMetadata(Track*, Episode*)':
/home/leosum8/cspot/cspot/cspot/src/TrackQueue.cpp:151:7: warning: unused variable 'alternativeCount' [-Wunused-variable]
  151 |   int alternativeCount, filesCount = 0;
      |       ^~~~~~~~~~~~~~~~
/home/leosum8/cspot/cspot/cspot/src/TrackQueue.cpp:152:8: warning: unused variable 'canPlay' [-Wunused-variable]
  152 |   bool canPlay = false;
      |        ^~~~~~~
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /home/leosum8/cspot/cspot/targets/esp32/build/log/idf_py_stderr_output_8386 and /home/leosum8/cspot/cspot/targets/esp32/build/log/idf_py_stdout_output_8386

Any ideas?

@playduck
Copy link

playduck commented Jan 9, 2024

Did you successfully download the dependencies?

idf.py add-dependency "espressif/led_strip^2.5.2"
idf.py add-dependency "espressif/mdns^1.2.2"

My CMake files look like this:

targets/esp32/CMakeLists.txt

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

# Don't override EXTRA_COMPONENT_DIRS as platformio uses it.  Instead we append
# see https://github.com/platformio/platform-espressif32/issues/341
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)
# list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/led_strip)

if(NOT IDF_NO_INCLUDE)
    include($ENV{IDF_PATH}/tools/cmake/project.cmake)
endif()
project(cspot-esp32)

targets/esp32/main/CMakeLists.txt

cmake_minimum_required(VERSION 3.5)

# CMake options
set(CMAKE_CXX_STANDARD 17)
# Main target sources
file(GLOB SOURCES "*.cpp" "*.c")

# Configure the target
idf_component_register(
    SRCS ${SOURCES}
    INCLUDE_DIRS "."
    REQUIRES led_strip mdns spiffs esp_wifi nvs_flash protocol_examples_common
)
idf_build_set_property(COMPILE_OPTIONS "-fdiagnostics-color=always" APPEND)

# Build static library, do not build test executables
option(BUILD_SHARED_LIBS OFF)
option(BUILD_TESTING OFF)

# Import cspot library
add_subdirectory("../../../cspot" ${CMAKE_CURRENT_BINARY_DIR}/cspot)

# Configure the target
target_link_libraries(${COMPONENT_LIB} PUBLIC cspot)
target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++17)

@LeoSum8
Copy link

LeoSum8 commented Jan 9, 2024

Hi, and thanks for answering!
The dependencies are installed.

Thanks to your CMakeLists.txt files which I copied the pre-building errors during set-target command went away.

However building still fails with the same error.

I also tried starting from scratch.
Also following the steps above to install protobuf in the right version (#156 (comment)) doesn't seem to change anything.

...

[libprotobuf WARNING google/protobuf/compiler/parser.cc:646] No syntax specified for the proto file: protobuf/login5.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
/home/leosum8/cspot/cspot/targets/esp32/build/esp-idf/main/cspot/nanopb/generator/nanopb_generator.py:22: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources # pyinstaller / protobuf 2.5 seem to need these
[730/1672] Running C++ protocol buffer compiler using nanopb plugin on /home/leosum8/cspot/cspot/cspot/protobuf/spirc.proto
[libprotobuf WARNING google/protobuf/compiler/parser.cc:646] No syntax specified for the proto file: protobuf/spirc.proto. Please use 'syntax = "proto2";' or 'syntax = "proto3";' to specify a syntax version. (Defaulted to proto2 syntax.)
/home/leosum8/cspot/cspot/targets/esp32/build/esp-idf/main/cspot/nanopb/generator/nanopb_generator.py:22: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources # pyinstaller / protobuf 2.5 seem to need these
[1274/1672] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/EspPlayer.cpp.obj
/home/leosum8/cspot/cspot/targets/esp32/main/EspPlayer.cpp: In lambda function:
/home/leosum8/cspot/cspot/targets/esp32/main/EspPlayer.cpp:71:19: warning: unused variable 'volume' [-Wunused-variable]
   71 |               int volume = std::get<int>(event->data);
      |                   ^~~~~~
[1276/1672] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/MercurySession.cpp.obj
/home/leosum8/cspot/cspot/cspot/src/MercurySession.cpp: In member function 'cspot::MercurySession::Response cspot::MercurySession::decodeResponse(const std::vector<unsigned char>&)':
/home/leosum8/cspot/cspot/cspot/src/MercurySession.cpp:222:8: warning: unused variable 'sequenceLength' [-Wunused-variable]
  222 |   auto sequenceLength = ntohs(extract<uint16_t>(data, 0));
      |        ^~~~~~~~~~~~~~
/home/leosum8/cspot/cspot/cspot/src/MercurySession.cpp:225:8: warning: unused variable 'partsNumber' [-Wunused-variable]
  225 |   auto partsNumber = ntohs(extract<uint16_t>(data, 11));
      |        ^~~~~~~~~~~
[1277/1672] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/AccessKeyFetcher.cpp.obj
/home/leosum8/cspot/cspot/cspot/src/AccessKeyFetcher.cpp: In member function 'void cspot::AccessKeyFetcher::updateAccessKey()':
/home/leosum8/cspot/cspot/cspot/src/AccessKeyFetcher.cpp:123:13: warning: unused variable 'expiresIn' [-Wunused-variable]
  123 |         int expiresIn = loginResponse.response.ok.access_token_expires_in / 2;
      |             ^~~~~~~~~
[1280/1672] Building CXX object esp-idf/main/CMakeFiles/__idf_main.dir/main.cpp.obj
In file included from /home/leosum8/esp/esp-idf/components/driver/deprecated/driver/i2s.h:23,
                 from /home/leosum8/cspot/cspot/cspot/bell/main/audio-sinks/include/esp/adac.h:12,
                 from /home/leosum8/cspot/cspot/cspot/bell/main/audio-sinks/include/esp/AC101AudioSink.h:12,
                 from /home/leosum8/cspot/cspot/targets/esp32/main/main.cpp:44:
/home/leosum8/esp/esp-idf/components/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~
/home/leosum8/esp/esp-idf/components/driver/deprecated/driver/i2s.h:27:2: warning: #warning "This set of I2S APIs has been deprecated, please include 'driver/i2s_std.h', 'driver/i2s_pdm.h' or 'driver/i2s_tdm.h' instead. if you want to keep using the old APIs and ignore this warning, you can enable 'Suppress leagcy driver deprecated warning' option under 'I2S Configuration' menu in Kconfig" [-Wcpp]
   27 | #warning "This set of I2S APIs has been deprecated, \
      |  ^~~~~~~
[1294/1672] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/TrackPlayer.cpp.obj
/home/leosum8/cspot/cspot/cspot/src/TrackPlayer.cpp: In member function 'virtual void cspot::TrackPlayer::runTask()':
/home/leosum8/cspot/cspot/cspot/src/TrackPlayer.cpp:192:15: warning: unused variable 'r' [-Wunused-variable]
  192 |       int32_t r =
      |               ^
[1301/1672] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellMQTTClient.cpp.obj
/home/leosum8/cspot/cspot/cspot/bell/main/io/BellMQTTClient.cpp: In member function 'void bell::MQTTClient::connect(const std::string&, uint16_t, const std::string&, const std::string&)':
/home/leosum8/cspot/cspot/cspot/bell/main/io/BellMQTTClient.cpp:36:7: warning: unused variable 'status' [-Wunused-variable]
   36 |   int status = fcntl(socket.getFd(), F_SETFL,
      |       ^~~~~~
[1315/1672] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/HTTPClient.cpp.obj
/home/leosum8/cspot/cspot/cspot/bell/main/io/HTTPClient.cpp: In member function 'void bell::HTTPClient::Response::readResponseHeaders()':
/home/leosum8/cspot/cspot/cspot/bell/main/io/HTTPClient.cpp:66:9: warning: unused variable 'method' [-Wunused-variable]
   66 |   char *method, *path;
      |         ^~~~~~
/home/leosum8/cspot/cspot/cspot/bell/main/io/HTTPClient.cpp:66:18: warning: unused variable 'path' [-Wunused-variable]
   66 |   char *method, *path;
      |                  ^~~~
[1322/1672] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj
FAILED: esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj 
/home/leosum8/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-g++ -DESP_PLATFORM -DFMT_HEADER_ONLY -DIDF_VER=\"v5.3-dev-1288-g5524b692ee\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DPB_ENABLE_MALLOC -DPB_FIELD_32BIT -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -DUSE_DEFAULT_STDLIB="1 -DTARGET_OS_IPHONE=0" -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/home/leosum8/cspot/cspot/targets/esp32/build/config -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-codec/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-dsp/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-sinks/include -I/home/leosum8/cspot/cspot/cspot/bell/main/io/include -I/home/leosum8/cspot/cspot/cspot/bell/main/utilities/include -I/home/leosum8/cspot/cspot/cspot/bell/main/platform -I/home/leosum8/cspot/cspot/cspot/bell/external/mqtt/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-containers/include -I/home/leosum8/cspot/cspot/cspot/bell/main/audio-sinks/include/esp -I/home/leosum8/cspot/cspot/cspot/bell/external/civetweb/include -I/home/leosum8/cspot/cspot/targets/esp32/build/esp-idf/main/cspot/bell -I/home/leosum8/esp/esp-idf/components/newlib/platform_include -I/home/leosum8/esp/esp-idf/components/freertos/config/include -I/home/leosum8/esp/esp-idf/components/freertos/config/include/freertos -I/home/leosum8/esp/esp-idf/components/freertos/config/xtensa/include -I/home/leosum8/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/leosum8/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/home/leosum8/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -I/home/leosum8/esp/esp-idf/components/freertos/esp_additions/include -I/home/leosum8/esp/esp-idf/components/esp_hw_support/include -I/home/leosum8/esp/esp-idf/components/esp_hw_support/include/soc -I/home/leosum8/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -I/home/leosum8/esp/esp-idf/components/esp_hw_support/port/esp32/. -I/home/leosum8/esp/esp-idf/components/heap/include -I/home/leosum8/esp/esp-idf/components/log/include -I/home/leosum8/esp/esp-idf/components/soc/include -I/home/leosum8/esp/esp-idf/components/soc/esp32 -I/home/leosum8/esp/esp-idf/components/soc/esp32/include -I/home/leosum8/esp/esp-idf/components/hal/platform_port/include -I/home/leosum8/esp/esp-idf/components/hal/esp32/include -I/home/leosum8/esp/esp-idf/components/hal/include -I/home/leosum8/esp/esp-idf/components/esp_rom/include -I/home/leosum8/esp/esp-idf/components/esp_rom/include/esp32 -I/home/leosum8/esp/esp-idf/components/esp_rom/esp32 -I/home/leosum8/esp/esp-idf/components/esp_common/include -I/home/leosum8/esp/esp-idf/components/esp_system/include -I/home/leosum8/esp/esp-idf/components/esp_system/port/soc -I/home/leosum8/esp/esp-idf/components/esp_system/port/include/private -I/home/leosum8/esp/esp-idf/components/xtensa/esp32/include -I/home/leosum8/esp/esp-idf/components/xtensa/include -I/home/leosum8/esp/esp-idf/components/xtensa/deprecated_include -I/home/leosum8/esp/esp-idf/components/esp_timer/include -I/home/leosum8/esp/esp-idf/components/lwip/include -I/home/leosum8/esp/esp-idf/components/lwip/include/apps -I/home/leosum8/esp/esp-idf/components/lwip/include/apps/sntp -I/home/leosum8/esp/esp-idf/components/lwip/lwip/src/include -I/home/leosum8/esp/esp-idf/components/lwip/port/include -I/home/leosum8/esp/esp-idf/components/lwip/port/freertos/include -I/home/leosum8/esp/esp-idf/components/lwip/port/esp32xx/include -I/home/leosum8/esp/esp-idf/components/lwip/port/esp32xx/include/arch -I/home/leosum8/esp/esp-idf/components/lwip/port/esp32xx/include/sys -I/home/leosum8/cspot/cspot/targets/esp32/managed_components/espressif__mdns/include -I/home/leosum8/esp/esp-idf/components/console -I/home/leosum8/esp/esp-idf/components/vfs/include -I/home/leosum8/esp/esp-idf/components/esp_netif/include -I/home/leosum8/esp/esp-idf/components/esp_event/include -I/home/leosum8/esp/esp-idf/components/mbedtls/port/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/library -I/home/leosum8/esp/esp-idf/components/mbedtls/esp_crt_bundle/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/everest/include -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/p256-m -I/home/leosum8/esp/esp-idf/components/mbedtls/mbedtls/3rdparty/p256-m/p256-m -I/home/leosum8/esp/esp-idf/components/pthread/include -I/home/leosum8/esp/esp-idf/components/driver/deprecated -I/home/leosum8/esp/esp-idf/components/driver/i2c/include -I/home/leosum8/esp/esp-idf/components/driver/touch_sensor/include -I/home/leosum8/esp/esp-idf/components/driver/twai/include -I/home/leosum8/esp/esp-idf/components/driver/usb_serial_jtag/include -I/home/leosum8/esp/esp-idf/components/driver/touch_sensor/esp32/include -I/home/leosum8/esp/esp-idf/components/esp_pm/include -I/home/leosum8/esp/esp-idf/components/esp_ringbuf/include -I/home/leosum8/esp/esp-idf/components/esp_driver_gpio/include -I/home/leosum8/esp/esp-idf/components/esp_driver_pcnt/include -I/home/leosum8/esp/esp-idf/components/esp_driver_gptimer/include -I/home/leosum8/esp/esp-idf/components/esp_driver_spi/include -I/home/leosum8/esp/esp-idf/components/esp_driver_mcpwm/include -I/home/leosum8/esp/esp-idf/components/esp_driver_ana_cmpr/include -I/home/leosum8/esp/esp-idf/components/esp_driver_i2s/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdmmc/include -I/home/leosum8/esp/esp-idf/components/sdmmc/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdspi/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdio/include -I/home/leosum8/esp/esp-idf/components/esp_driver_dac/include -I/home/leosum8/esp/esp-idf/components/esp_driver_rmt/include -I/home/leosum8/esp/esp-idf/components/esp_driver_tsens/include -I/home/leosum8/esp/esp-idf/components/esp_driver_sdm/include -I/home/leosum8/esp/esp-idf/components/esp_driver_i2c/include -I/home/leosum8/esp/esp-idf/components/esp_driver_uart/include -I/home/leosum8/esp/esp-idf/components/esp_driver_ledc/include -I/home/leosum8/esp/esp-idf/components/esp_driver_parlio/include -I/home/leosum8/cspot/cspot/cspot/bell/external/opencore-aacdec/src -I/home/leosum8/cspot/cspot/cspot/bell/external/opencore-aacdec/oscl -I/home/leosum8/cspot/cspot/cspot/bell/external/opencore-aacdec/include -I/home/leosum8/cspot/cspot/cspot/bell/external/opus/include -isystem /home/leosum8/cspot/cspot/cspot/bell/external/nanopb -isystem /home/leosum8/cspot/cspot/cspot/bell/external/libhelix-mp3 -isystem /home/leosum8/cspot/cspot/cspot/bell/external/tremor -isystem /home/leosum8/cspot/cspot/cspot/bell/external/cJSON -isystem /home/leosum8/cspot/cspot/cspot/bell/external/fmt/include -isystem /home/leosum8/cspot/cspot/cspot/bell/external/nlohmann_json/include -mlongcalls -Wno-frame-address  -std=gnu++20 -fdiagnostics-color=always   -Wunused-const-variable -Wchar-subscripts -Wunused-label -Wmaybe-uninitialized -Wmisleading-indentation -Wno-stringop-overflow -Wno-error=format -Wno-format -Wno-stringop-overread -Wno-stringop-overflow -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw -Og -fno-shrink-wrap -fmacro-prefix-map=/home/leosum8/cspot/cspot/targets/esp32=. -fmacro-prefix-map=/home/leosum8/esp/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -fdiagnostics-color=always -std=gnu++2b -fexceptions -fno-rtti -MD -MT esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj -MF esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj.d -o esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/io/BellHTTPServer.cpp.obj -c /home/leosum8/cspot/cspot/cspot/bell/main/io/BellHTTPServer.cpp
In file included from /home/leosum8/cspot/cspot/cspot/bell/main/io/include/BellHTTPServer.h:15,
                 from /home/leosum8/cspot/cspot/cspot/bell/main/io/BellHTTPServer.cpp:1:
/home/leosum8/cspot/cspot/cspot/bell/external/civetweb/include/CivetServer.h:291:22: error: 'virtual void CivetWebSocketHandler::handleClose(CivetServer*, const mg_connection*)' was hidden [-Werror=overloaded-virtual=]
  291 |         virtual void handleClose(CivetServer *server,
      |                      ^~~~~~~~~~~
/home/leosum8/cspot/cspot/cspot/bell/main/io/BellHTTPServer.cpp:50:16: note:   by 'virtual void WebSocketHandler::handleClose(CivetServer*, mg_connection*)'
   50 |   virtual void handleClose(CivetServer* server, struct mg_connection* conn) {
      |                ^~~~~~~~~~~
cc1plus: some warnings being treated as errors
[1326/1672] Building CXX object esp-idf/main/cspot/bell/CMakeFiles/bell.dir/main/utilities/NanoPBHelper.cpp.obj
/home/leosum8/cspot/cspot/cspot/bell/main/utilities/NanoPBHelper.cpp: In function 'bool vectorWrite(pb_ostream_t*, const pb_byte_t*, size_t)':
/home/leosum8/cspot/cspot/cspot/bell/main/utilities/NanoPBHelper.cpp:12:10: warning: unused variable 'i' [-Wunused-variable]
   12 |   size_t i;
      |          ^
[1331/1672] Building CXX object esp-idf/main/cspot/CMakeFiles/cspot.dir/src/TrackQueue.cpp.obj
/home/leosum8/cspot/cspot/cspot/src/TrackQueue.cpp: In member function 'void cspot::QueuedTrack::stepParseMetadata(Track*, Episode*)':
/home/leosum8/cspot/cspot/cspot/src/TrackQueue.cpp:151:7: warning: unused variable 'alternativeCount' [-Wunused-variable]
  151 |   int alternativeCount, filesCount = 0;
      |       ^~~~~~~~~~~~~~~~
/home/leosum8/cspot/cspot/cspot/src/TrackQueue.cpp:152:8: warning: unused variable 'canPlay' [-Wunused-variable]
  152 |   bool canPlay = false;
      |        ^~~~~~~
ninja: build stopped: subcommand failed.
ninja failed with exit code 1, output of the command is in the /home/leosum8/cspot/cspot/targets/esp32/build/log/idf_py_stderr_output_40092 and /home/leosum8/cspot/cspot/targets/esp32/build/log/idf_py_stdout_output_40092

@tobiasguyer
Copy link

If you have installed all the dependencies, and have done a full-clean too, there's the possibility, that you'll have to delete the existing build folder in targets/esp32. Otherwise, there should be a CMakeLog- and CMakeError file in the Build folder, that could help further.
And i'm sorry about the led-strip thing. I haven't implemented anything status-led-like, so there's no need for that dependency. My CMakeFile hasn't any REQUIRES. Could be, because i'm still using esp-idf 4.4

@myreauks
Copy link
Author

myreauks commented Feb 6, 2024

I verified this working with sound output, but all of a sudden Spotify cannot connect to the ESP32 anymore. Here is the output from the monitor, Spotify just gets stuck to connecting. Tried with desktop app and iOS app.

[1970-01-01 00:00:05.390] I BellHTTPServer.cpp:191: Server listening on port 7864
Waiting for spotify app to connect...
[1970-01-01 00:00:11.876] I main.cpp:117: Received zeroauth POST data
[1970-01-01 00:00:12.422] D Session.cpp:67: Connecting with AP <ap-gew4.spotify.com:4070>
[1970-01-01 00:00:12.471] D PlainConnection.cpp:101: Connected to spotify server
[1970-01-01 00:00:12.543] I Session.cpp:43: Received APHello response
[1970-01-01 00:00:12.579] D Session.cpp:48: Received shannon keys
[1970-01-01 00:00:12.669] D Session.cpp:87: Authorization successful
[1970-01-01 00:00:12.684] I MercurySession.cpp:42: Received packet, command: 4
[1970-01-01 00:00:12.691] D TimeProvider.cpp:15: Time synced with spotify servers
[1970-01-01 00:00:12.701] I MercurySession.cpp:42: Received packet, command: 2
[1970-01-01 [00:00:121970-.70701] -D 01 MercurySession.cpp00:251: Executing Mercury Request, type SUB
:00:12.708] I MercurySession.cpp:42: Received packet, command: 118
[1970-01-01 00:00:12.727] I MercurySession.cpp:42: Received packet, command: 27
[1970-01-01 00:00:12.739] D MercurySession.cpp:153: Received country code FI
[1970-01-01 00:00:12.781] I MercurySession.cpp:42: Received packet, command: 80
[1970-01-01 00:00:12.783] I MercurySession.cpp:42: Received packet, command: 31
[1970-01-01 00:00:12.790] I MercurySession.cpp:42: Received packet, command: 105
[1970-01-01 00:00:12.800] I AccessKeyFetcher.cpp:99: Access token expired, fetching new one... 288
[1970-01-01 00:00:12.810] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:12.823] I MercurySession.cpp:42: Received packet, command: 74
[1970-01-01 00:00:12.835] I MercurySession.cpp:42: Received packet, command: 179
[1970-01-01 00:00:12.839] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:12.849] D MercurySession.cpp:251: Executing Mercury Request, type SEND
[1970-01-01 00:00:12.871] D SpircHandler.cpp:61: Sent kMessageTypeHello!
[1970-01-01 00:00:12.994] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:12.996] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:13.363] I AccessKeyFetcher.cpp:114: Access token sucessfully fetched

@myreauks
Copy link
Author

myreauks commented Feb 7, 2024

And now it is connecting successfully again. Very mysterious.

Edit: it seems that Spotify might have had some sort of an outage.

@myreauks
Copy link
Author

myreauks commented Mar 17, 2024

An update on the build after I've been using it for a while.

It seems to be running a bit unstable at the moment. If I pause a track and then play another, most of the time the player stops working a this point and every request after results in the following line in the monitor:
[1970-01-01 00:01:25.916] I MercurySession.cpp:42: Received packet, command: 181

Sometimes this also happens mid-song and the song just stops playing. After this has happened, the player stops responding to any commands. Here is the whole output before getting unresponsive. Any ideas what the cause might be? I am using the PCM5102 audiosink.

I (11070) cspot: Connected to AP, start spotify receiver
[1970-01-01 00:00:09.845] I BellHTTPServer.cpp:191: Server listening on port 7864
Waiting for spotify app to connect...
[1970-01-01 00:00:32.810] I main.cpp:133: Received zeroauth POST data
[1970-01-01 00:00:33.445] D Session.cpp:67: Connecting with AP <ap-gew4.spotify.com:4070>
[1970-01-01 00:00:33.494] D PlainConnection.cpp:101: Connected to spotify server
[1970-01-01 00:00:33.565] I Session.cpp:43: Received APHello response
[1970-01-01 00:00:33.602] D Session.cpp:48: Received shannon keys
[1970-01-01 00:00:33.711] D Session.cpp:87: Authorization successful
[1970-01-01 00:00:33.731] I MercurySession.cpp:42: Received packet, command: 4
[1970-01-01 00:00:33.739] D TimeProvider.cpp:15: Time synced with spotify servers
[1970-01-01 00:00:33.748] I MercurySession.cpp:42: Received packet, command: 2
[1970-01-01 [00:00:331970.-755] 01-D 01 00:MercurySession.cpp00:251: :Executing Mercury Request, type SUB33
.755] I MercurySession.cpp:42: Received packet, command: 118
[1970-01-01 00:00:33.774] I MercurySession.cpp:42: Received packet, command: 27
[1970-01-01 00:00:33.783] D MercurySession.cpp:153: Received country code FI
[1970-01-01 00:00:33.829] I MercurySession.cpp:42: Received packet, command: 80
[1970-01-01 00:00:33.832] I MercurySession.cpp:42: Received packet, command: 31
[1970-01-01 00:00:33.838] I MercurySession.cpp:42: Received packet, command: 105
[1970-01-01 00:00:33.850] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:33.857] I MercurySession.cpp:42: Received packet, command: 74
[1970-01-01 00:00:33.866] I MercurySession.cpp:42: Received packet, command: 179
[[1970-197001--01 01-00:01 00:00:33.00:875] 33I .875AccessKeyFetcher.cpp] :99: Access token expired, fetching new one... 288D 
MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:33.897] D MercurySession.cpp:251: Executing Mercury Request, type SEND
[1970-01-01 00:00:33.919] D SpircHandler.cpp:61: Sent kMessageTypeHello!
[1970-01-01 00:00:34.022] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:34.025] D SpircHandler.cpp:69: Received subscription response
[1970-01-01 00:00:34.033] D SpircHandler.cpp:132: Notify frame
[1970-01-01 00:00:34.062] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:34.063] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:34.292] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:34.298] D SpircHandler.cpp:69: Received subscription response
[1970-01-01 00:00:34.313] D SpircHandler.cpp:179: Load frame 10!
[1970-01-01 00:00:34.324] D MercurySession.cpp:251: Executing Mercury Request, type SEND
[1970-01-01 00:00:34.343] I TrackPlayer.cpp:98: Resetting state
[1970-01-01 00:00:34.432] I AccessKeyFetcher.cpp:114: Access token sucessfully fetched
[1970-01-01 00:00:34.439] D MercurySession.cpp:251: Executing Mercury Request, type GET
[1970-01-01 00:00:34.481] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:34.483] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:34.765] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:34.767] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:34.774] I TrackQueue.cpp:158: Track name: Reckoner
[1970-01-01 00:00:34.781] I TrackQueue.cpp:159: Track duration: 290213
[1970-01-01 00:00:34.789] D TrackQueue.cpp:161: trackInfo.restriction.size() = 1
[1970-01-01 00:00:34.799] D TrackQueue.cpp:212: File format: 2
[1970-01-01 00:00:34.806] D TrackQueue.cpp:212: File format: 1
[1970-01-01 00:00:34.860] I MercurySession.cpp:42: Received packet, command: 13
[1970-01-01 00:00:34.862] I TrackQueue.cpp:252: Got audio key
[1970-01-01 00:00:34.868] I TrackQueue.cpp:275: Received access key, fetching CDN URL...
[1970-01-01 00:00:35.355] I TrackQueue.cpp:301: Received CDN URL, https://audio-ak-spotify-com.akamaized.net/audio/67084030365ab0cf7b14b9e54998835b3249dc90?__token__=exp=1710763279~hmac=8edcf44032d3f294061a647999d20469bc296f4cd0dc71a8e987c3ce4d3bd566
[1970-01-01 00:00:35.370] I TrackPlayer.cpp:171: Got track ID=67084030365ab0cf7b14b9e54998835b3249dc90
[1970-01-01 00:00:35.382] I CDNAudioFile.cpp:43: Opening HTTP stream to https://audio-ak-spotify-com.akamaized.net/audio/67084030365ab0cf7b14b9e54998835b3249dc90?__token__=exp=1710763279~hmac=8edcf44032d3f294061a647999d20469bc296f4cd0dc71a8e987c3ce4d3bd566
[1970-01-01 00:00:35.473] D MercurySession.cpp:251: Executing Mercury Request, type GET
[1970-01-01 00:00:35.582] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:35.584] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:35.592] I TrackQueue.cpp:158: Track name: House Of Cards
[1970-01-01 00:00:35.599] I TrackQueue.cpp:159: Track duration: 328293
[1970-01-01 00:00:35.607] D TrackQueue.cpp:161: trackInfo.restriction.size() = 1
[1970-01-01 00:00:35.617] D TrackQueue.cpp:212: File format: 2
[1970-01-01 00:00:35.624] D TrackQueue.cpp:212: File format: 1
[1970-01-01 00:00:35.702] I MercurySession.cpp:42: Received packet, command: 13
[1970-01-01 00:00:35.704] I TrackQueue.cpp:252: Got audio key
[1970-01-01 00:00:35.712] I TrackQueue.cpp:275: Received access key, fetching CDN URL...
[1970-01-01 00:00:36.391] I CDNAudioFile.cpp:70: Header and footer bytes received
[1970-01-01 00:00:36.396] D MercurySession.cpp:251: Executing Mercury Request, type SEND
[1970-01-01 00:00:36.563] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:36.571] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:36.609] I TrackPlayer.cpp:206: Playing
[1970-01-01 00:00:36.666] I TrackQueue.cpp:301: Received CDN URL, https://audio-ak-spotify-com.akamaized.net/audio/ce4e13d5731ed15ed611b270d01319a71f65a13c?__token__=exp=1710763281~hmac=eeca34af3e115cb05b98f3b703434d6dff88d9fe7c61a8a15b6c1c52570b789d
 Last hash 0 new hash 477585946
[1970-01-01 00:00:36.793] D MercurySession.cpp:251: Executing Mercury Request, type GET
[1970-01-01 00:00:36.839] D MercurySession.cpp:251: Executing Mercury Request, type SEND
[1970-01-01 00:00:36.871] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:36.883] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:36.895] I TrackQueue.cpp:158: Track name: Jigsaw Falling Into Place
[1970-01-01 00:00:36.902] I TrackQueue.cpp:159: Track duration: 248893
[1970-01-01 00:00:36.910] D TrackQueue.cpp:161: trackInfo.restriction.size() = 1
[1970-01-01 00:00:36.919] D TrackQueue.cpp:212: File format: 2
[1970-01-01 00:00:36.926] D TrackQueue.cpp:212: File format: 1
[1970-01-01 00:00:36.993] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:36.995] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:37.262] I MercurySession.cpp:42: Received packet, command: 13
[1970-01-01 00:00:37.265] I TrackQueue.cpp:252: Got audio key
[1970-01-01 00:00:37.272] I TrackQueue.cpp:275: Received access key, fetching CDN URL...
[1970-01-01 00:00:38.141] I TrackQueue.cpp:301: Received CDN URL, https://audio-ak-spotify-com.akamaized.net/audio/e8ab243d9dfbaf0f995ccb8cb43ad47dd6918485?__token__=exp=1710763282~hmac=b74c8dac190ee1e16e1299b3df64f0d1a9a5112467b4c1dbb34a419d00f30c8d
[1970-01-01 00:00:43.743] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:43.746] D SpircHandler.cpp:69: Received subscription response
[1970-01-01 00:00:43.753] D SpircHandler.cpp:287: External pause command
[1970-01-01 00:00:43.765] D MercurySession.cpp:251: Executing Mercury Request, type SEND
Pause requested!
[1970-01-01 00:00:43.873] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:43.876] D MercurySession.cpp:174: Received mercury packet
[1970-01-01 00:00:47.207] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:47.209] D SpircHandler.cpp:69: Received subscription response
[1970-01-01 00:00:47.217] D SpircHandler.cpp:179: Load frame 18!
[1970-01-01 00:00:47.231] D MercurySession.cpp:251: Executing Mercury Request, type SEND
[1970-01-01 00:00:47.271] D MercurySession.cpp:251: Executing Mercury Request, type GET
[1970-01-01 00:00:47.317] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:47.349] I MercurySession.cpp:42: Received packet, command: 178
[1970-01-01 00:00:47.420] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:57.216] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:00:58.882] I MercurySession.cpp:42: Received packet, command: 181
[1970-01-01 00:01:25.916] I MercurySession.cpp:42: Received packet, command: 181

@tobiasguyer
Copy link

Sorry for not responding for so long.
Too be honest, i don't work with a pcm audio sink, thus my main structure changed a lot from the main branch, but i should have written a pcm adaption of my sink once. I'll try looking into it, but their are still some commits to do, before i can focus on your problem.
Until then, tinkering with the tasksize (main cpp:144 and EspPlayer.cpp:21) and the buffersize(EspPlayer.cpp:28) could hav a huge impact

@tobiasguyer
Copy link

So.. I haven't tested it properly, I just made a serial output of the pcm-stream.
But it seems to me, the main problem was in the mercury manager with gzipping. Their were truncated messages, that weren't decoded properly. That should be solved with my newest commit. Let me know if there are still problems

@myreauks
Copy link
Author

Thanks! I'll try the newest commit in the coming days and report back.

@myreauks
Copy link
Author

I did some testing with commit 050cb32. For sure it works much more stable now, but is still stopping playback after three songs every time. Sometimes earlier than this. But good thing is that I can always resume playing through Spotify without rebooting the ESP.

Another thing that was introduced with these changes is that the Spotify UI does not update anymore after the first song has stopped playing. It works fine until then, but any of the subsequent songs do not update to the now playing status.

I'll check tomorrow what messages show up in the monitor.

@myreauks
Copy link
Author

myreauks commented Jul 31, 2024

It seems that the player is not getting info on further tracks, it just stops playing after three tracks even though I would be listening to an album with more tracks. Here is the output at point of stopping:

.[0;34mI .[0;90mCDNAudioFile.cpp.[0m:70: .[0mHeader and footer bytes received
.[0;34mI .[0;90mTrackPlayer.cpp.[0m:267: .[0mPlaying
.[0;31mD .[0;37mMercurySession.cpp.[0m:301: Executing Mercury Request, type SEND
.[0;34mI .[0;37mMercurySession.cpp.[0m:42: .[0mReceived packet, command: 178
.[0;31mD .[0;37mMercurySession.cpp.[0m:175: Received mercury packet
.[0;31mD .[0;37mMercurySession.cpp.[0m:260: Creating new Mercury Response, seq: 76, flags: 1, parts: 1
.[0;34mI .[0;37mMercurySession.cpp.[0m:42: .[0mReceived packet, command: 4
.[0;31mD .[0;91mTimeProvider.cpp.[0m:15: Time synced with spotify servers
.[0;34mI .[0;37mMercurySession.cpp.[0m:42: .[0mReceived packet, command: 74
.[0;34mI .[0;37mMercurySession.cpp.[0m:42: .[0mReceived packet, command: 4
.[0;31mD .[0;91mTimeProvider.cpp.[0m:15: Time synced with spotify servers
.[0;34mI .[0;37mMercurySession.cpp.[0m:42: .[0mReceived packet, command: 74
.[0;34mI .[0;90mTrackPlayer.cpp.[0m:304: .[0mEOF
.[0;34mI .[0;90mTrackPlayer.cpp.[0m:346: .[0mPlaying done

I also got a crash in the middle of a track with this output, although this might have been my own additions to the main.cpp. I'll investigate.

.[0;31mE (1855994) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:.[0m
.[0;31mE (1855994) task_wdt:  - IDLE (CPU 1).[0m
.[0;31mE (1855994) task_wdt: Tasks currently running:.[0m
.[0;31mE (1855994) task_wdt: CPU 0: IDLE.[0m
.[0;31mE (1855994) task_wdt: CPU 1: cspot_player.[0m
.[0;31mE (1855994) task_wdt: Print CPU 1 backtrace.[0m


Backtrace: 0x40088252:0x3FFC0650 0x400836D5:0x3FFC0670 0x401D2F70:0x3F87DF20 0x401D3799:0x3F87DF40 0x401E3636:0x3F87DF60 0x401D3683:0x3F87DFA0 0x4012A4DB:0x3F87DFC0 0x4012C1BC:0x3F87E0B0 0x4012C1EB:0x3F87E120 0x40113E27:0x3F87E170 0x400FDAD1:0x3F87E1F0 0x400FDAEE:0x3F87E210 0x4012EDBE:0x3F87E230 0x4012EE5D:0x3F87E250 0x4012F6F9:0x3F87E270 0x401306FD:0x3F87E2C0 0x400FE861:0x3F87E2E0 0x400DC7DA:0x3F87E4F0 0x400941D9:0x3F87E510

@tobiasguyer
Copy link

tobiasguyer commented Aug 1, 2024

I'm so sorry, i was redoing a lot of the cspot structure and made some mistakes. my current build (master or EventManager-branch) should run stable and with no stop for quite some time. it's still messy, but currently @feelfreelinux is looking over the build.
i think, it's gonna take a while, until it's properly reviewed and merged in the main branch. i hope, until then, my build is gonna suffice for you.
in my build, their should come no changes for quite some time now, at least, if you guys experience stable runs too.
have fun and i hope it works properly

@myreauks
Copy link
Author

myreauks commented Aug 1, 2024

Thanks for the update, for some reason it is still playing only three tracks at a time. However, it seems to be very stable, I got just one random crash which I think has something to do with the task size or the buffer size. I'll try playing with those values.
Spotify UI is still not updating the now playing or the queue for whatever reason. At the moment that's not a big deal though, as it doesn't affect the playback.

Thanks a lot for your efforts!

Edit:

On further listening, I started getting the same crash repeatedly, here is the trace. Maybe it has something to do with the bell task size.

0x40082259: panic_abort at /Users/myreauks/temp/esp-idf-v5.1.1n/components/esp_system/panic.c:452
0x400915d9: esp_system_abort at /Users/myreauks/temp/esp-idf-v5.1.1n/components/esp_system/port/esp_system_chip.c:84
0x40097b6e: abort at /Users/myreauks/temp/esp-idf-v5.1.1n/components/newlib/abort.c:38
0x401c4f07: __cxxabiv1::__terminate(void (*)()) at /Users/brnomac003/.gitlab-runner/builds/qR2TxTby/0/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:48
0x401c4f3c: std::terminate() at /Users/brnomac003/.gitlab-runner/builds/qR2TxTby/0/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:58
0x401c501b: __cxa_throw at /Users/brnomac003/.gitlab-runner/builds/qR2TxTby/0/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc:98
0x4012a599: bell::HTTPClient::Response::readResponseHeaders() at /Users/myreauks/temp/cspot/cspot/bell/main/io/HTTPClient.cpp:96
0x4012c204: bell::HTTPClient::Response::rawRequest(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::vector > const&, std::vector, std::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > >&) at /Users/myreauks/temp/cspot/cspot/bell/main/io/HTTPClient.cpp:62
0x4012c233: bell::HTTPClient::Response::get(std::__cxx11::basic_string, std::allocator > const&, std::vector, std::allocator >, std::__cxx11::basic_string, std::allocator > >, std::allocator, std::allocator >, std::__cxx11::basic_string, std::allocator > > > >) at /Users/myreauks/temp/cspot/cspot/bell/main/io/HTTPClient.cpp:124
0x40113ea7: cspot::CDNAudioFile::readBytes(unsigned char*, unsigned int) at /Users/myreauks/temp/cspot/cspot/src/CDNAudioFile.cpp:133
0x400fd715: cspot::TrackPlayer::_vorbisRead(void*, unsigned int, unsigned int) at /Users/myreauks/temp/cspot/cspot/src/TrackPlayer.cpp:367
0x400fd732: vorbisReadCb at /Users/myreauks/temp/cspot/cspot/src/TrackPlayer.cpp:40
0x4012ee06: _get_data at /Users/myreauks/temp/cspot/cspot/bell/external/tremor/vorbisfile.c:73
0x4012eea5: _get_next_page at /Users/myreauks/temp/cspot/cspot/bell/external/tremor/vorbisfile.c:125
0x4012f741: _fetch_and_process_packet at /Users/myreauks/temp/cspot/cspot/bell/external/tremor/vorbisfile.c:614
0x40130745: ov_read at /Users/myreauks/temp/cspot/cspot/bell/external/tremor/vorbisfile.c:1581
0x400fe4d5: cspot::TrackPlayer::runTask() at /Users/myreauks/temp/cspot/cspot/src/TrackPlayer.cpp:293
0x400dc59a: bell::Task::taskEntryFuncPSRAM(void*) at /Users/myreauks/temp/cspot/cspot/bell/main/utilities/include/BellTask.h:99
0x400941d9: vPortTaskWrapper at /Users/myreauks/temp/esp-idf-v5.1.1n/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162

@tobiasguyer
Copy link

I'm sorry, i hope you haven't tried too much already. I had missunderstood the preloadedTracks structure, and misswrote some lines.
Now, at least the cliBuild, and the VS1053 are working.
I've tried to adjust the espPlayer.cpp as good as possible, but i have no ways to test it.
There is still a issue or two, but it works quite amazing and has plenty of new futures.
Let me know how it works.
And if it doesn't, and i won't respond fast enough, take a look at the cliPlayer.cpp

@tobiasguyer
Copy link

So.. i've ported my build to espidf v5.3. With 5.1 it had a build error, so be carefull to use the latest espidf. Because of some issues with mbedtls, i had to change quite a lot in cspot/bell. So be sure, to update the submodules after porting to the newest commit.
https://github.com/tobiasguyer/cspot
have fun and let me now, if it is finally working on esp. it works, apart from the classic shuffeling (no smart shuffle) on cli(WIN32) and esp32 with vs1053

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants