I'm using the standard Windows installer for esp tools and esp-idf. So I'm using v4.0.1 from May 2020.
I have a image encoded as jpg in a struct as this
Code: Select all
typedef struct {
uint8_t * buf; /*!< Pointer to the pixel data */
size_t len; /*!< Length of the buffer in bytes */
size_t width; /*!< Width of the buffer in pixels */
size_t height; /*!< Height of the buffer in pixels */
pixformat_t format; /*!< Format of the pixel data */
struct timeval timestamp; /*!< Timestamp since boot of the first DMA buffer of the frame */
} camera_fb_t;
I want to send this image data across a websocket connection. Image size can be up to 300kB. The send function for binary data has the following syntax
Code: Select all
esp_websocket_client_send(client,(char *)fb->buf, fb->len, portMAX_DELAY);
Code: Select all
E (26194) TRANSPORT_WS: Error transport_poll_write
E (26194) WEBSOCKET_CLIENT: Network error: esp_transport_write() returned 0, errno=0
But that did not remove the error message.
If I replace actual data length with 1000 I get no errors:
Code: Select all
esp_websocket_client_send(client,(char *)fb->buf, 1000, portMAX_DELAY);