Not able to connect to the server

http_server.zip

I am working on the http server. I wanted to make my device behave as a server so that I can send the data (received through uart) as a response to the client.

The problem is I tried to execute the http_server sample code available in which I did some minor changes. For now I did not integrate the uart code, I was just sending hello world just to verify whether I am getting it reflected or not but the server was only not able to connect to the ip address of the network on which my device and my laptop were connected.
I am attaching my code for reference below. Also I am using nrf sdk v2.6.1

Parents
  • Hi Rakshita

    Just as a start. Before you did any modification to the sample, were you able to connect to the connect to the network? I'm not sure what you mean by

    but the server was only not able to connect to the ip address of the network on which my device and my laptop were connected

    as the device should act as server which the other devices on the network should be able to access. 

    Regards

    Runar

  • Hi Runsiv

    The issue of connecting to the network and getting response from the server is solved.
    But have a very different doubt right now 

    So actually I integrated the softAP mode and http server so that both the client and server could connect to the module's network. I was able to successfully connect to it and was also able to get response. But my use case is a bit different. I want to get response continuously (in 1/2 sec) on a single request sent, so for that I created a separate thread to send response periodically but I used to get the below result on rtt viewer

    [00:01:05.305,938] <err> net_sock: invalid access on sock 12 by thread 0x2000d228 [
    00:01:05.305,969] <err> softap: send, error: -9
    [00:01:05.305,969] <err> net_sock: invalid access on sock 12 by thread 0x2000d228 

    And on terminal where I executed the client I got 

    curl: (52) Empty reply from server

    Most probably I could be wrong in executing the thread.

    Attaching the updated code. 

    softap_while.zip

Reply
  • Hi Runsiv

    The issue of connecting to the network and getting response from the server is solved.
    But have a very different doubt right now 

    So actually I integrated the softAP mode and http server so that both the client and server could connect to the module's network. I was able to successfully connect to it and was also able to get response. But my use case is a bit different. I want to get response continuously (in 1/2 sec) on a single request sent, so for that I created a separate thread to send response periodically but I used to get the below result on rtt viewer

    [00:01:05.305,938] <err> net_sock: invalid access on sock 12 by thread 0x2000d228 [
    00:01:05.305,969] <err> softap: send, error: -9
    [00:01:05.305,969] <err> net_sock: invalid access on sock 12 by thread 0x2000d228 

    And on terminal where I executed the client I got 

    curl: (52) Empty reply from server

    Most probably I could be wrong in executing the thread.

    Attaching the updated code. 

    softap_while.zip

Children
No Data
Related