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

MQTT don't work any more after upgrade nrf/zephyr

Hello
I have upgrade software and modem firmware and the program using mqtt protocol don't work any more.

Besides the connection to the broker (many error -106), the program dead immediately calling mqtt_live with error -11.

Before to downgrade to the previous version there is some news with the mqtt libraries?

Regards

Federico

Parents
  • Hi,

    I recently noticied similar issues after updating.

    My old application stopped working properly due to the mqtt_live behavior change.

    It's an easy fix however. Negative return codes from mqtt_live is just the errno - errno 11 (EAGAIN) normally means you should try again in a while.

    Oh, also 106 is "EISCONN Transport endpoint is already connected" which probably indicates you trying to reestablish a connection but it was already connected.

    If you're on Linux (which you should as a developer :-) you can use the command errno in the shell (errno -l OR errno <code>) to see what is what.

    In short:

    Return codes from mqtt_live:

    0: keep-alive message was sent to broker

    -11: no error, but keep-alive message was not sent (it was not yet time to send the keep-alive due to last keep-alive or other communication having occurred)

    Just keep calling mqtt_live every minute or so (depending on your keep-alive settings).

    I actually prefer the new behavior since you actually get an indication to wheter a keep-alive message was sent (return 0) or not (return -11)

  • Thanks Jesper
    I saw in the new sample of MQTT the correction indicate by you, however I need to sane  other part of my program especially the code hat uses poll and events.

    Now with the correction on mqtt_live, I have continue to have errors due to not blocking events of mqtt
    The new release change the include syntax for gps, uart, gpio and the pin of the LED so ton of modification in the code.

    Regards

    Federico

Reply
  • Thanks Jesper
    I saw in the new sample of MQTT the correction indicate by you, however I need to sane  other part of my program especially the code hat uses poll and events.

    Now with the correction on mqtt_live, I have continue to have errors due to not blocking events of mqtt
    The new release change the include syntax for gps, uart, gpio and the pin of the LED so ton of modification in the code.

    Regards

    Federico

Children
No Data
Related