Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
I want to build a MJPEG server via websocket on esp32 in esp idf
The problem is that I am using the mongoose network stack, and `I have to know exactly how would the ws header look like `
After some searching, I found that I need data:image/jpeg;base64,
and I did this :
“` mg_ws_printf(c, WEBSOCKET_OP_TEXT, “data:image/jpeg;base64,”);
mg_ws_send(c, frame_buf->buf, frame_buf->len,WEBSOCKET_OP_BINARY);
mg_ws_send(c, “\r\n”, 2,WEBSOCKET_OP_TEXT);“`
unfortunately, nothing shows up. I have to mention that the basic text communication and the frame read are functioning
thanks I solved it
“` if (frame_buf->buf != NULL)
{
size_t count = mg_ws_printf(c, WEBSOCKET_OP_TEXT, “Content-Type: image/jpeg Content-Length: %lu\r\n\r\n”, frame_buf->len);
ESP_LOGI(TAG,”count : %d”,count);
count = mg_ws_send(c, frame_buf->buf, frame_buf->len,WEBSOCKET_OP_BINARY);
ESP_LOGI(TAG,”count2 : %d”,count);
vTaskDelay(500/portTICK_PERIOD_MS);
esp_camera_fb_return(frame_buf);
} “`
CONTRIBUTE TO THIS THREAD