require websocket and https combine example

Hi,

I am using SDK v2.6.1.

Is there any course available on DevAcademy for WebSockets?

For WebSocket i take reference of v2.6.1/zephyr/samples/net/sockets/websocket_client,

when i try to give wifi credential using wifi connect -s <ssid> -k 1 -p <password> then i have got wifi: command not found so require to give wifi credential?or how we are able to see WebSocket reference code output,

I need an example that merges WebSocket and HTTPS. Could you also provide feedback on how to merge both into a single code?

Parents
  • Hi,

    Is there any course available on DevAcademy for WebSockets?

    No, there is no course for WebSockets on DevAcademy.

    when i try to give wifi credential using wifi connect -s <ssid> -k 1 -p <password> then i have got wifi: command not found so require to give wifi credential?or how we are able to see WebSocket reference code output,

    You could try to test "wifi connect" command using wi-fi shell sample.

    I need an example that merges WebSocket and HTTPS. Could you also provide feedback on how to merge both into a single code?

    Can you provide more information about your application? Which problem are you trying to solve? What is your goal when combining https and websocket?

    Best regards,
    Dejan

  • I used SDK v2.6.1 with the nrf7002dk_nrf5340_cpuapp board.

    I referenced the Wi-Fi shell example and merged its prj.conf file with the websocket_client prj.conf file.

    However, I encountered errors. If you have a working websocket_client example with Wi-Fi shell integration, please provide it.

    below is my prj.conf file

    Can you provide more information about your application? Which problem are you trying to solve? What is your goal when combining https and websocket?

    >> I want to transfer and receive data from the server using HTTPS and WebSocket on the nrf7002dk_nrf5340_cpuapp board. I have implemented HTTPS code on this board.

    Below is my HTTPS code, could you guide me on how to integrate WebSocket code with it?

    below is my prj.conf file for https

  • yes from my end i am able to reproduce this issue consistently,

    in your log i am able to see that you are also not able to connect with websocket

    [00:03:53.470,916] <err> Lesson5_Exercise1: Cannot connect to IPv4 remote (-116)
    [00:03:53.471,374] <err> Lesson5_Exercise1: Cannot connect to echo.thingy.rocks: 80
    [00:03:53.471,466] <err> Lesson5_Exercise1: No IPv4 or IPv6 connectivity

    If possible, please suggest changes to the code from your side so that I can implement them and try to resolve this problem.

  • Hi,

    I have managed to reproduce this issue only once. I expect for the error to be consistently reproducible. It seems that the application on my side is not able to connect to wi-fi network most of the time. 
    Can you make a minimal sample which would show the same error (which can be replicated) for us to look into?

    Best regards,
    Dejan

  • Hi,

    please try with attached code.

    Also please give me code which work with websocket so first i will take a reference of it and try to merge with https.

    sta_websocket.zip

  • Hi,

    I have tested further your previous project HTTP.zip. There seems to be connection consistently. The change was to extend the sleep to allow for initialization of the wi-fi driver using k_sleep(K_SECONDS(10)); instead of k_sleep(K_SECONDS(1));


    I have also tested your most recent sample project sta_websocket.zip. Here is my log


    Do you get the same log?

    Best regards,
    Dejan

  • yes i have got the same log, i am also not able to connect with the the websocket so i have got 

    [00:00:44.725,738] <err> sta: Cannot connect to IPv4 remote (-116)
    [00:00:44.726,165] <err> sta: Cannot connect to demos.kaazing.com:80
    [00:00:44.726,257] <err> sta: No IPv4 or IPv6 connectivity

Reply
  • yes i have got the same log, i am also not able to connect with the the websocket so i have got 

    [00:00:44.725,738] <err> sta: Cannot connect to IPv4 remote (-116)
    [00:00:44.726,165] <err> sta: Cannot connect to demos.kaazing.com:80
    [00:00:44.726,257] <err> sta: No IPv4 or IPv6 connectivity

Children
  • Hi,

    We will look into this internally. I expect to get back to you by the end of next week.

    Best regards,
    Dejan

  • ok,

    Thank you for your support.

    If possible, please expedite the process as we have an upcoming client delivery.

  • Hi,

    It does not seem to be any problem with wi-fi connectivity but with subsequent http request. Could you provide monitor mode capture along with your SSID/passphrase details?

    Best regards,
    Dejan

  • HI,

    l am not able understand what you exactly require?

    Also if possible then please from your side give us suggestion so we make change in code and try to solve this problem. 

  • Hi,

    You can enable wi-fi monitor mode by for example following this link



    You can also look at our Wi-Fi monitor sample.

    Best regards,
    Dejan