This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf 91650 DK mqtt-simple - getaddrinfo fails randomly.

Hello,

I have successfully flashed and run the mqtt-simple example from the nrf samples with the default configuration.

If I run it 10 times in a row, the getaddr with "iot.eclipse.org" as input fails on average 4 times. When it works, I successfully connect to MQTT.

I am using nrf tag v1.0.0 with the most up to date firmware.

-----

Is there some required delay between establishing an lte link and attempting to run getaddrinfo?

Has anyone else observed this behavior ?

~~~

UPDATE:

For now, I am using the IP address directly so getaddrinfo always succeeds.

However, I see similar behavior on the tls connect now.

I am now more convinced that a successful link establishment does not necessarily mean that data is immediately  routable.

Parents Reply
  • Hey Bjorn, thanks for the reply.

    I have successfully connected to different brokers, but either way, the error is occurring *before* any mqtt logic. The success of getaddrinfo is (or should be) independent of the mqtt broker.

    My best guess is the lte link request returns prematurely sometimes, before the data session is established or  before the routes are configured, leading the application to timeout on network calls.

Children
Related