aws_iot_connect may not return

I have been developing an application using the AWS IoT library on build target nrf7002dk/nrf5340/cpuapp and nRF Connect SDK v2.7.0, and the application connects to Wi-Fi shared from my phone. Occasionally it happens that the function call aws_iot_connect never returns, and in the case of a fail I have noticed the following chain of calls.

aws_iot_connect
-> mqtt_helper_connect
-> client_connect
-> mqtt_connect
-> client_connect
-> mqtt_transport_connect
-> mqtt_client_tls_connect
-> zsock_connect
-> z_impl_zsock_connect
-> ztls_connect_ctx
-> tls_mbedtls_handshake with timeout K_FOREVER
-> wait_for_reason with reason MBEDTLS_ERR_SSL_WANT_READ
-> wait with timeout K_FOREVER, ZSOCK_POLLIN
-> zsock_poll
-> z_impls_zsock_poll
-> zsock_poll_internal
-> k_poll,

And k_poll does not return.

Is this something that should be expected to happen occasionally (in which case perhaps a case like this should be handled in nRF Connect SDK code or Zephyr code), or should this be preventable?

Parents
  • Hi Johan

    How much rarer are we talking here? Almost non-existent or every 10 minutes instead of 5 minutes for example? 

    It sounds like a bug to me, but before making a bug report, could you provide logging from the TCP stack and a Wireshark trace of the issue occurring if possible so we know why the socket doesn't connect in the first place?

    Best regards,

    Simon

Reply
  • Hi Johan

    How much rarer are we talking here? Almost non-existent or every 10 minutes instead of 5 minutes for example? 

    It sounds like a bug to me, but before making a bug report, could you provide logging from the TCP stack and a Wireshark trace of the issue occurring if possible so we know why the socket doesn't connect in the first place?

    Best regards,

    Simon

Children
No Data
Related