In SDK v2.6.1, commenting out the following code in websocket.c
allows successful connection to the WebSocket. However, in SDK v2.7.0, even after commenting out the same code, I am still unable to connect to the WebSocket.
In SDK v2.6.1, commenting out the following code in websocket.c
allows successful connection to the WebSocket. However, in SDK v2.7.0, even after commenting out the same code, I am still unable to connect to the WebSocket.
Hi,
Are you using an SDK sample, or is it a custom project?
Please share the device logs.
I recommend fixing the issue causing the WebSocket handshake to fail rather than commenting out the check.
Best regards,
Marte
Hi,
Hi,
Please share the full logs from the device.
Best regards,
Marte
[00:00:00.502,746] <inf> fs_nvs: 2 Sectors of 4096 bytes
[00:00:00.502,746] <inf> fs_nvs: alloc wra: 0, fd0
[00:00:00.502,777] <inf> fs_nvs: data wra: 0, c8
*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
[00:00:02.055,969] <inf> wifi_mgmt_ext: Connection requested
[00:00:02.056,732] <inf> Lesson5_Exercise1: Connecting to Wi-Fi
[00:00:04.606,048] <inf> wifi_mgmt_ext: Connection requested
[00:00:07.159,393] <inf> wifi_mgmt_ext: Connection requested
[00:00:09.713,409] <inf> wifi_mgmt_ext: Connection requested
[00:00:12.267,883] <inf> wifi_mgmt_ext: Connection requested
[00:00:14.834,533] <inf> wifi_mgmt_ext: Connection requested
[00:00:17.400,695] <inf> wifi_mgmt_ext: Connection requested
[00:00:19.947,631] <inf> wifi_mgmt_ext: Connection requested
[00:00:22.501,220] <inf> wifi_mgmt_ext: Connection requested
[00:00:25.055,206] <inf> wifi_mgmt_ext: Connection requested
[00:00:27.609,893] <inf> wifi_mgmt_ext: Connection requested
[00:00:30.181,518] <inf> wifi_mgmt_ext: Connection requested
[00:00:30.264,404] <inf> Lesson5_Exercise1: Network connected
[00:00:32.203,094] <inf> Lesson5_Exercise1: IPv4 address of HTTP server found 54.240.174.114
[00:00:33.456,909] <inf> Lesson5_Exercise1: Connected to server
[00:00:33.456,939] <inf> Lesson5_Exercise1: HTTP POST request
[00:00:33.571,350] <inf> Lesson5_Exercise1: Response status: Created
[00:00:33.571,380] <inf> Lesson5_Exercise1: Successfully acquired client ID: /fb269045-2f73-4068-8064-b227e8a6cf70
[00:00:33.571,411] <inf> Lesson5_Exercise1: Closing socket: 9
[00:00:36.434,722] <err> Lesson5_Exercise1: Cannot connect to IPv4 remote (-116)
[00:00:36.435,150] <err> Lesson5_Exercise1: Cannot connect to echo.thingy.rocks:80
[00:00:36.435,241] <err> Lesson5_Exercise1: No IPv4 or IPv6 connectivity
Hi,
You connect to echo.thingy.rocks and not a dedicated websocket. Have you tried connecting to a server using websocket instead?
Is there a reason you want to use a websocket instead of a regular socket?
Best regards,
Marte
Hi,
We tried connecting to echo.websocket.org
and were able to establish a connection using SDK v2.6.1, but it does not work with v2.7.0.
We are developing a product for our client, who uses a personal server. We want to connect to this server using WebSockets and receive data from it.
can you please ask me is there any change in websocket driver side in sdk v2.7.0 ?
Hi,
The websocket library was converted to use zsock API.
The nRF Connect SDK v2.6.1 uses v3.5.99-ncs1-1 of Zephyr, and v2.7.0 uses v3.6.99-ncs2 of Zephyr. So you can compare this two tags to see all the changes.
I would recommend looking at the WebSocket Client sample in Zephyr.
Best regards,
Marte
Hi,
The websocket library was converted to use zsock API.
The nRF Connect SDK v2.6.1 uses v3.5.99-ncs1-1 of Zephyr, and v2.7.0 uses v3.6.99-ncs2 of Zephyr. So you can compare this two tags to see all the changes.
I would recommend looking at the WebSocket Client sample in Zephyr.
Best regards,
Marte