This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Socket API "send" hangs when sending multiple TCP messages

Hi, 

   I am developing an application that requires communication between two nrf52840-based devices. There is a scenario in my application where the devices needs to exchange multiple TCP packets, however after transmitting nearly 50 messages, send API hangs. The inter-message transmission interval is 70-200 ms. I am using TCP over IEEE 802.15.4 with POSIX names enabled. My application's message size 14-byte. I would be really thankful for your help. 

Best regards,

Omer

Parents
  • Hello, Omer!

    Are you able to provide any logs from the devices? I would also like information about which code your samples are based on, and whether you are using the nRF Connect SDK or the nRF5 SDK.

    Best regards,
    Carl Richard

  • Hi Carl, 

        Regarding logs - I am obtaining information by using printk and displaying the information on terminal. I am relatively new to Zephyr, therefore I do not know whether Zephyr stores some log files. If so, I would really appreciate if you could also tell me where those log files are stored. 

       Code Sample: I built my code using the socket client server example available at zephyr/samples/net/sockets. 

       I am using nRf Connect SDK. 

    Best regards,

    Omer

  • Hi again!

    Understood. Could you add the following to your prj.conf and share any eventual output with me?

    CONFIG_ASSERT=y
    CONFIG_SERIAL=y
    
    CONFIG_LOG=y
    CONFIG_LOG_IMMEDIATE=y
    CONFIG_LOG_BACKEND_SHOW_COLOR=n
    
    CONFIG_NET_LOG=y
    
    #CONFIG_NET_IF_LOG_LEVEL_DBG=y
    #CONFIG_NET_L2_ETHERNET_LOG_LEVEL_DBG=y
    
    CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y
    CONFIG_NET_CONN_LOG_LEVEL_DBG=y
    CONFIG_NET_CONTEXT_LOG_LEVEL_DBG=y
    
    CONFIG_NET_TCP_LOG_LEVEL_DBG=y

    Best regards,
    Carl Richard

  • Hi Carl, 

       Thanks for the reply. I did add the CONFIGs to my proj.conf files for the client and the server applications. My application works the following way.

        - Once a user presses button 3 on nrf52840 dk the communication starts, however as we now have CONFIG_ASSERT=y in the proj.conf file, my application resets when I press the button on the client application please see attached screenshot. This does not happen for the server application. 

    If I remove CONFIG_ASSERT=y, the above does not happen. In order to reproduce the erroneous scenario, I removed the assert config, and execute the client server applications. Please see attached logs. You can see at the end of the logs server application requested data, client did send the data,  however server is stuck.  serverlog.txtclientlog.txt

Reply
  • Hi Carl, 

       Thanks for the reply. I did add the CONFIGs to my proj.conf files for the client and the server applications. My application works the following way.

        - Once a user presses button 3 on nrf52840 dk the communication starts, however as we now have CONFIG_ASSERT=y in the proj.conf file, my application resets when I press the button on the client application please see attached screenshot. This does not happen for the server application. 

    If I remove CONFIG_ASSERT=y, the above does not happen. In order to reproduce the erroneous scenario, I removed the assert config, and execute the client server applications. Please see attached logs. You can see at the end of the logs server application requested data, client did send the data,  however server is stuck.  serverlog.txtclientlog.txt

Children
No Data
Related