Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Electron/LTE] devices drop Cloud connection every time user firmware opens and closes a TCP socket [ch34976] #1854
LTE E-series R410 devices drop Cloud connection every time user firmware opens and closes a TCP socket. This does not appear to affect U260/U201/G350 devices.
The timeout for the socket close command USOCL times out after 10s (has been this way since the first electron release). Sara R410M timeout of this command is 120 seconds, but that is likely only for TCP sockets since UDP sockets can be closed immediately. Sara U201/260/G350 timeout of this command is 1 second. If the TCP socket took more than 10 seconds to close, the USOCL command would timeout and allow the AT interface to be accessed by the next command, but it would not ready because it's still waiting for the socket close command to finish or timeout. If a following command happens to be a Particle Publish, Keep Alive Ping or Vitals Publish, these commands are blocked by the TCP socket closing and subsequently forces a teardown of the Cloud connection.
Timeouts will are adjusted so that if the socket is a TCP socket, the full 120 second timeout is respected. If it's a UDP socket, we will continue to optimize this value down to 10 seconds.
Steps to Test
Requires a TCP connection to a server that defaults to the
Workaround for slowly closing TCP sockets
Review non-whitespace changes: https://github.com/particle-iot/device-os/pull/1854/files?w=1
Test firmware for electron