Hardware Configuration
- Wi-Fi Module: Fanstel module based on Nordic nRF7002
- MCU: Nordic nRF5340
- SDK: Nordic Connect SDK (NCS) v2.6.2
- RTOS: Zephyr
- Wi-Fi Security: WPA2 Personal
- Cloud Communication:
- TLS + HTTP
- Secure WebSocket (WSS)
Software Architecture
Our application follows the workflow below:
- Connect to configured Wi-Fi network.
- Obtain Internet connectivity.
- Resolve server DNS.
- Establish a TLS connection.
- Perform required HTTP API calls.
- Close the TLS connection.
- Establish a secure WebSocket connection.
- Subscribe/register with the cloud.
- Wait for server commands.
HubStatus Cycle
Every 10 minutes (currently reduced to 2 minutes for stress testing), the following sequence is executed:
- Close WebSocket connection.
- Open TLS connection.
- Execute HubStatus HTTP APIs.
- Close TLS connection.
- Reconnect WebSocket.
- Continue waiting for commands.
A similar sequence is also executed whenever a command is received through the WebSocket, where the WebSocket is temporarily closed, HTTP APIs are executed over TLS, and then the WebSocket connection is re-established.
Test Duration
One of our production-like test devices was installed and connected to Wi-Fi.
Timeline:
- Friday (~3:00 PM): Controller installed and connected successfully.
- Friday (~8:00 PM): Cloud reported that the controller disconnected from Wi-Fi.
- Entire weekend: Device never reconnected automatically.
- Saturday: Nearby BLE functionality continued to work correctly, indicating that the firmware was still running.
- Monday: Multiple attempts were made to reconnect the controller using the application.
Observed Behaviour
The controller goes through the normal Wi-Fi connection sequence as if it is connecting successfully, but eventually fails every time.
The device remains unable to reconnect.
However, after simply removing power for approximately 10 seconds and powering the controller back on:
- Wi-Fi reconnects automatically within approximately 30 seconds.
- Cloud connectivity resumes normally.
This behavior has been observed multiple times.
Additional Observations
- BLE functionality continues working while Wi-Fi remains disconnected.
- The firmware does not appear to crash.
- Power cycling immediately restores Wi-Fi connectivity.
- The issue only affects the Wi-Fi subsystem until reboot.
- We suspect that the Wi-Fi driver, network stack, or internal socket state is getting stuck after long runtime.
Questions
- Are there any known issues in NCS v2.6.2 related to:
- nRF7002 Wi-Fi reconnection
- Long-running Wi-Fi sessions
- TLS socket cleanup
- DNS resolution
- Socket exhaustion
- Network interface state transitions
- Could this indicate that the Wi-Fi driver or network interface enters an unrecoverable state that only a reboot clears?
- Are there recommended APIs to completely reset the Wi-Fi interface or network stack without rebooting the MCU?
- Are there known fixes or patches in newer NCS releases for similar long-term Wi-Fi reconnection issues?
Any suggestions on debugging or identifying the root cause would be greatly appreciated.
Thank you.