5 Replies Latest reply on Jan 8, 2020 4:54 AM by NiMc_1688136

    Random and rare TCP receive failures (error 9 / WICED_NOTUP)

    NiMc_1688136

      This is a strange problem. I have found at least two devices, one in our lab and one in the field which gets stuck in a loop of wiced_tcp_receive returning an error code of 9.

      The module is connected to an AP

      The module is pulling valid NTP timesyncs and reaching public DNS servers so the networking stack seems okay, at least UDP.

      I am trying to connect to a MQTT broker (AWS MQTT library) and the TCP connection and TLS handshake to the broker passes (good). I then see the CONNECT request go out but then the library starts polling wiced_tcp_receive for the CONNACK response but returns error code 9.

       

      From wiced_results.h, an error code 9 is WICED_NOTUP which indicates that the interface is not valid but yet previous TCP/IP actions are working and passing the same checks.

       

      What is weird is that these devices were communicating just fine, publishing messages to the MQTT broker every minute and then all of a sudden it got the error 9. In my code, this disconnected the device from the broker and tried to reconnect but only could once the module was rebooted.

       

      Has anyone seen this? I am guessing something has happened to the socket variable being passed into wiced_tcp_receive, which provides an invalid interface to WICED_LINK_CHECK_TCP_SOCKET, but is odd that it cannot recover on following connect attempts.

       

      SDK 6.2.1

      LWIP + FreeRTOS