Persistent timeout error in POSIX connect() function for TCP reconnection (nRF52840 device) #64701
Unanswered
tom-brown-kr
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am doing HTTP POST's and GET's from my nRF52840-based device (using nRF Connect SDK v2.4.2) to a Java Spring Boot HTTP server running on a laptop via TCP. The device is communicating with a border router via OpenThread. The border router and my laptop are both on my local WAN (laptop's IP is 192.168.1.27). When the device boots up and the server is running, I can do POST's and GET's without issue. When I turn off the server to test the device's reconnection logic, I see the SYN message from the device trying to establish a connection with the server. The connect() function subsequently returns (-1). If I bring the server back up while the device is still making these SYN attempts, the connection is re-established and everything resumes properly.
However, if I do not bring up the server after some time (usually a few minutes), the device stops sending SYN messages and only does DNS lookups of the server hostname. The connect() function still returns an error (116, timeout) but no longer actually tries to establish a connection. If I bring the server back up, the device never re-establishes connection with the server due to the lack of SYN messages.
What is going on with the device's TCP connection that causes it to stop SYN reconnection attempts? I have also contacted Nordic separately, but we have not yet determined the cause. The issue seems to be in the repeated calling of the socket() and connect() zsock functions.
Successful POSTs:

SYN messages stop sending after a while when server is down, but DNS lookups continue to be performed without issue:

Relevant Code:
Relevant Configs:
Beta Was this translation helpful? Give feedback.
All reactions