Photon TCPClient connect panic when lossy WiFi signal

I’m using Photons with DeviceOS 1.2.1 and doing frequent HTTP requests with them, everything works fine until I encounter weak WiFi signal where the device may lose network connection.

When the device starts to reconnect to the cloud/network there is a 50/50 chance it will either connect sucessfully or encounter a panic (or even worse hang up completely). I have been trying to workaround this by prechecking network availability using WiFi.connecting/WiFi.ping/etc but alas to no avail, it still results in panic when reconnection has begun. The panic SOS seems to indicate a hard fault.

I can reproduce the problem with the minimal HTTP get example from https://github.com/nmattisson/HttpClient, using a few second period, and bringing the WiFi signal strength down until the device disconnects the network, and then restoring signal strength allowing the device to reconnect.

I’m using semi automatic system mode with system thread enabled.

Does anyone have any hints as to what may be the cause to the panic or how it could be avoided without sacrificing offline application processing?

Upon further inspection it seems like calls to either TCPClient.connect or WiFi.ping during cloud reconnection attempt will cause a panic.

I’ll test this with DeviceOS 1.5.2 more thoroughly tomorrow.

Using DeviceOS 1.5.2 the problem still occurs on the Photon but not the Argon. Also Photon has trouble connecting to the network when using semi automatic mode with os@1.5.2, while the Argon seems to be working fine.

I don’t have an answer for your specific problem, however the TCP stack on the Photon/P1 is completely different than the Argon. While the Wiring API is the same, the Photon/P1 use Cypress/Broadcom WICED running on the STM32F205 MCU. The Argon TCP/IP stack is a combination of LwIP on the nRF52840 MCU and the Wi-Fi radio and support on the ESP32. So I would expect some differences in behavior, especially with SOS/freezing type issues.

1 Like