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

MQTT 128kB packet size

Hello,

I am using NRF9160 running the Serial LTE Modem application in NCS 1.5.0.

When connecting with AWS IoT over a secure MQTT connection the maximum MQTT packet size allowed by AWS IoT is 128kB. When I publish a message of this size from an external device my nrf9160 device outputs the error -128. What is this error? 128 does not appear in errno.h.

How can I allow the maximum packet size of 128kB from AWS IoT to be received by the nrf9160? If this size is not reachable what is the maximum limit and how do I enable that limit?

What is the maximum outgoing limit and how do I enable that limit?

Parents Reply
  • Hi, and again, sorry for this taking so long.

    But, I have some good news this time: I have found a solution/workaround for the POLLHUP problem.

    After some digging, it  turned out that the connection to AWS is fine. While I still don't understand 100% why the POLLHUP flag is set, I believe that either the POLLHUP flag itself is a bug, or the application's handling of the POLLHUP is wrong. I'll have to discuss this more with our developers before I can be sure which one it is.

    Regardless, you can simply ignore the POLLHUP, and everthing will work fine.

    What I did was to add a 'continue' inside the if that checks if fds.revents has the POLLIN flag set, after the call to mqtt_input (and checking the return value) in mqtt_thread_fn in slm_at_mqtt.c.

    In an unmodified SLM, it would be here: https://github.com/nrfconnect/sdk-nrf/blob/master/applications/serial_lte_modem/src/mqtt_c/slm_at_mqtt.c#L237

    I'll try to keep you updated as we open PRs to make AWS connections with native TLS supported.

    Best regards,

    Didrik

Children
Related