I found some similar topics, but found not solution for me.
I want to use this example esp-idf/examples/protocols/http_server/file_serving at master · espressif/esp-idf · GitHub
I have done following:
- I have downloaded the compleate esp-idf example folder and copyed the folder …esp-idf-master\examples\protocols\http_server\file_serving to the PlatformIO project folder (C:\Users\{USER_NAME}\Documents\PlatformIO\Projects).
- I have created a new PlatformIO project in VSC. (Name: “file_serving”, framework: “ESP-IDF” and default location)
- I moved in project folder all files from “main” folder to the “src” folder.
If I open main.c in src folder, I see two errors:
“#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (C:\Users\{USER_NAME}\Documents\PlatformIO\Projects\file_serving\src\main.c).” and
“cannot open source file “protocol_examples_common.h””.
I found “protocol_examples_common.h” file in …esp-idf-master\examples\common_components\protocol_examples_common\include and coppyed to include folder of the PlatformIO project. (File CMakeLists.txt helped me.)
If I open “file_server.c” file, VSC give me 17 errors. Most of them are “identifier “HTTPD_404_NOT_FOUND” is undefined”, “identifier “HTTPD_500_INTERNAL_SERVER_ERROR” is undefined”, “struct “httpd_config” has no field “uri_match_fn””, “identifier “httpd_uri_match_wildcard” is undefined” e.t.c.
How I can solve this?