te0
te0
DIIDevHeads IoT Integration Server
Created by te0 on 9/27/2024 in #edge-networking
How do I build an MJPEG server via WebSocket on ESP32 using Mongoose
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);
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
6 replies