Page 1 of 1

Can't use httpd_ws_frame_t structure in ESP32-C3

Posted: Thu Sep 28, 2023 3:51 am
by LuvKira
I have an ESP32-C3 project. Even though I have defined the esp_http_server header file and enabled CONFIG_HTTPD_WS_SUPPORT, the ESP-IDE still returns the following message: "Type 'httpd_ws_frame_t' could not be resolved". How can i fix it ? Here's what i included in my project :

#include "stdio.h"
#include "string.h"
#include "unistd.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#include "esp_mac.h"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "esp_system.h"
#include "esp_http_server.h"
#include "esp_tls.h"
#include "esp_timer.h"
#include "esp_task_wdt.h"
#include "esp_netif.h"
#include "esp_eth.h"
#include "esp_http_server.h"

#include "nvs_flash.h"

#include "lwip/err.h"
#include "lwip/sys.h"
#include "lwip/sockets.h"
#include "lwip/netdb.h"
#include "lwip/udp.h"

#include "sys/param.h"

#include "nvs_flash.h"

#include "driver/uart.h"
#include "driver/gpio.h"
#include "cJSON.h"

Re: Can't use httpd_ws_frame_t structure in ESP32-C3

Posted: Thu Sep 28, 2023 1:03 pm
by MicroController
1) make sure your project REQUIRES esp_http_server in CMakeLists.txt
2) reconfigure/rebuild the project; this may nudge the IDE to re-evaluate and pick up all include paths.

Re: Can't use httpd_ws_frame_t structure in ESP32-C3

Posted: Wed Dec 06, 2023 10:19 am
by mtaz78
Hi, the problem lies in the sdkonfig file. To support WebSocket and use the httpd_ws_frame_t you have to enable this paramenter CONFIG_HTTPD_WS_SUPPORT, you can find it in the sdconfig file and enable it using the command:

idf.py menuconfig

and going to Component config > HTTP Server.

You can find the reference here https://docs.espressif.com/projects/esp ... ws-support