change
Code: Select all
while (i < 10) {
if (esp_websocket_client_is_connected(client)) {
int len = sprintf(data, "hello %04d", i++);
ESP_LOGI(TAG, "Sending %s", data);
esp_websocket_client_send(client, data, len, portMAX_DELAY);
}
vTaskDelay(1000 / portTICK_RATE_MS);
}
Code: Select all
while (i < 10) {
if (esp_websocket_client_is_connected(client)) {
int len = sprintf(data, "hello %04d", i++);
ESP_LOGI(TAG, "Sending %s", data);
esp_websocket_client_send(client, data, len, portMAX_DELAY);
}
vTaskDelay(100 / portTICK_RATE_MS);
}
vTaskDelay(10000 / portTICK_RATE_MS);
Code: Select all
I (8445) WEBSOCKET: Connectiong to ws://echo.websocket.org...
I (8795) WEBSOCKET: WEBSOCKET_EVENT_CONNECTED
I (8855) WEBSOCKET: Sending hello 0000
I (8955) WEBSOCKET: Sending hello 0001
I (9055) WEBSOCKET: Sending hello 0002
I (9155) WEBSOCKET: Sending hello 0003
I (9255) WEBSOCKET: Sending hello 0004
I (9355) WEBSOCKET: Sending hello 0005
I (9455) WEBSOCKET: Sending hello 0006
I (9555) WEBSOCKET: Sending hello 0007
I (9655) WEBSOCKET: Sending hello 0008
I (9755) WEBSOCKET: Sending hello 0009
I (9815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (9815) WEBSOCKET: Received=hello 0000
I (10815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (10815) WEBSOCKET: Received=hello 0001
I (11815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (11815) WEBSOCKET: Received=hello 0002
I (12815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (12815) WEBSOCKET: Received=hello 0003
I (13815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (13815) WEBSOCKET: Received=hello 0004
I (14815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (14815) WEBSOCKET: Received=hello 0005
I (15815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (15815) WEBSOCKET: Received=hello 0006
I (16815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (16815) WEBSOCKET: Received=hello 0007
I (17815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (17815) WEBSOCKET: Received=hello 0008
I (18815) WEBSOCKET: WEBSOCKET_EVENT_DATA
W (18815) WEBSOCKET: Received=hello 0009
I (20815) WEBSOCKET: Websocket Stopped