Skip to content

Commit 38ef603

Browse files
authored
Merge pull request #500 from gabsuren/websocket_linux
fix(websocket): added dependency checks, sdkconfig.defaults and refined README.md
2 parents d9d3771 + 312982e commit 38ef603

File tree

5 files changed

+33
-6
lines changed

5 files changed

+33
-6
lines changed

components/esp_websocket_client/examples/linux/README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,33 @@
33
This example demonstrates the ESP websocket client using the `linux` target. It allows for compilation and execution of the example directly within a Linux environment.
44

55
## Compilation and Execution
6-
To compile and execute this example on Linux, follow the standard procedures for building and running ESP-IDF projects under the Linux platform.
6+
7+
To compile and execute this example on Linux need to set target `linux`
8+
9+
```
10+
idf.py --preview set-target linux
11+
idf.py build
12+
./websocket.elf
13+
```
14+
15+
## Example Output
16+
17+
```
18+
I (164532) websocket: [APP] Startup..
19+
I (164532) websocket: [APP] Free memory: 4294967295 bytes
20+
I (164532) websocket: [APP] IDF version: v5.3-dev-1353-gb3f7e2c8a4
21+
I (164538) websocket: Connecting to ws://echo.websocket.events...
22+
W (164538) websocket_client: `reconnect_timeout_ms` is not set, or it is less than or equal to zero, using default time out 10000 (milliseconds)
23+
W (164538) websocket_client: `network_timeout_ms` is not set, or it is less than or equal to zero, using default time out 10000 (milliseconds)
24+
I (165103) websocket: WEBSOCKET_EVENT_CONNECTED
25+
I (165539) websocket: Sending hello 0000
26+
I (165627) websocket: WEBSOCKET_EVENT_DATA
27+
I (165627) websocket: Received opcode=1
28+
W (165627) websocket: Received=hello 0000
29+
W (165627) websocket: Total payload length=10, data_len=10, current payload offset=0
30+
31+
I (166539) websocket: Sending fragmented message
32+
```
733

834
## Coverage Reporting
935
For generating a coverage report, it's necessary to enable `CONFIG_GCOV_ENABLED=y` option. Set the following configuration in your project's SDK configuration file (`sdkconfig.ci.coverage`, `sdkconfig.ci.linux` or via `menuconfig`):
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dependencies:
2+
idf: ">5.2"
23
protocol_examples_common:
34
path: ${IDF_PATH}/examples/common_components/protocol_examples_common

components/esp_websocket_client/examples/linux/sdkconfig.ci.coverage

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ CONFIG_IDF_TARGET_LINUX=y
44
CONFIG_ESP_EVENT_POST_FROM_ISR=n
55
CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=n
66
CONFIG_WEBSOCKET_URI="ws://echo.websocket.events"
7-
CONFIG_WEBSOCKET_URI_FROM_STRING=y
8-
CONFIG_WEBSOCKET_URI_FROM_STDIN=n

components/esp_websocket_client/examples/linux/sdkconfig.ci.linux

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ CONFIG_IDF_TARGET_LINUX=y
33
CONFIG_ESP_EVENT_POST_FROM_ISR=n
44
CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=n
55
CONFIG_WEBSOCKET_URI="ws://echo.websocket.events"
6-
CONFIG_WEBSOCKET_URI_FROM_STRING=y
7-
CONFIG_WEBSOCKET_URI_FROM_STDIN=n
8-
CONFIG_EXAMPLE_CONNECT_WIFI=n
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_IDF_TARGET="linux"
2+
CONFIG_IDF_TARGET_LINUX=y
3+
CONFIG_ESP_EVENT_POST_FROM_ISR=n
4+
CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=n
5+
CONFIG_WEBSOCKET_URI="ws://echo.websocket.events"

0 commit comments

Comments
 (0)