#include errors in vs-code using platformio w/ Esp32-c6

Hi there, I am hoping someone can help me out with this frustrating bug/issue or wrong configuration.

I’ve attached screenshots of the shown error, I’ve tried re-installing platformio and creating several new projects as well as restarting my device without any change. Also I’ve checked that the include path config is correct and it has the paths to were the lib deps should be.
I keep getting the #include error for libraries that I’ve added to the project using the platformio extension. Any help would be greatly appreciated as I’m completely stumped.

..What are you doing?

  1. The btAudio library is only framework = arduino compatible, not framework = espidf compatible per manifest
  2. Don’t use lib_deps with framework = espidf, use ESP-IDF components via idf_component.yml file instead (Readout KConfig from ESP-IDF libraries added via lib_deps, too · Issue #453 · platformio/platform-espressif32 · GitHub, How to get mDNS working with ESP-IDF v5 - #10 by peterl)
1 Like

what if i want to use an arduino library? I just read your other reply about using pioarduino.
Is it as simple as setting,
framework = arduino, espidf
platform = ``https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip

or do i need to do anything else?

If you want only that btAudio library, can’t you use framework = arduino directly? Compiling ESP-IDF and Arduino on top just makes it more complicated.

it says not compatible with my board, (esp32-c6) when i try to compile

The ESP32C6 has only a BLE (bluetooth low energy) radio, no bluetooth classic (BTC) which is needed for A2DP. The btAudio library is indeed not compilable for the ESP32C6 because it expects the Bluedroid stack to be present that’s not there on the C6.

It’s also saying in

that it’s not a priority for the Espressif team to add “LE Audio”, which would work over BLE, to the ESP32C6 software stack.

Other than that, you can compile Arduino sketches for the ESP32C6 with

[env:esp32-c6-devkitm-1]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip
board = esp32-c6-devkitm-1
framework = arduino

just fine, I tested that myself.

1 Like

Alr, many thanks for the research and help!
Dam it, i guess i might need to get another board to use A2DP :v

Most amusingly, an older classical ESP32 board would be able to use the libary just fine and do bluetooth classic and A2DP. But none of the newer ESP32-S/C/Hx.

1 Like

… that’s just stupid, I’m surprised the newer models don’t automatically support such a popular BLE standard. I’m assuming i would need A2DP for the use of a project that uses the esp device as a bluetooth receiver for audio playback. Originally i was looking into using micro python as it’s so much nicer to code in, but I couldn’t find any libraries that use A2DP because it’s not supported as of yet.

I just tried testing with a generic esp32 device and i still get the include error…

The https://github.com/Exocet22/btAudio/blob/master/examples/advertiseBluetooth/advertiseBluetooth.ino example compiles fine.

[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip
board = esp32dev
framework = arduino
lib_deps = exocet22/btAudio@^1.1.0
board_build.partitions  = huge_app.csv

You may have a corrupted package.

  1. Close VSCode
  2. Delete C:\Users\<user>\.platformio\packages
  3. Delete C:\Users\<user>\.platformio\platforms
  4. Delete C:\Users\<user>\.platformio\.cache
  5. Restart VSCode
  6. Wait for everything to reinitialize and redownload
  7. Hit “Build” again.
1 Like

That seems to have worked for now, :smiley:
Many thanks!! I’ll update this thread in case it bugs out again.