Device provision fails, MQTT drops large message

0

I am trying to provision a device by following the "Device provisioning MQTT API" docs. Once I subscribe to $aws/certificates/create/json/accepted and hit the $aws/certificates/create/json with an empty message "{}", I don't get the message because my modem can only handle 1024 bytes for the max length of a message. I know the broker is trying to send the message because when I go to "Certificates" in IoT Core I can see that a new cert was created with pending status.

My question is, how can I get around this? I can't increase the size of the message length for my modem as it states that 1024 is the max. Is there any way to ask AWS to split the message up? Do I have to create my own lambda to call the AWS CLI to make the keys and send them to the device broken up? Do I have to find a new way to increase the RX payload somehow, either by getting a new modem or doing the MQTT/TLS layer on my MCU?

2 Answers
0

Hi phirmware. Presumably that modem message length is TCP, not MQTT? Are you using AWS IoT SDK libraries to interact with IoT Core? If so, did you develop the transport interface? https://aws.github.io/aws-iot-device-sdk-embedded-C/202211.00/libraries/standard/coreMQTT/docs/doxygen/output/html/mqtt_porting.html#mqtt_porting_transport. It's normal for MQTT messages to be fragmented during transport. Can you share details about your modem?

One other question: can you perhaps use a different provisioning method than fleet provisioning (so you don't have to use this API)? This whitepaper may be useful: https://docs.aws.amazon.com/pdfs/whitepapers/latest/device-manufacturing-provisioning/device-manufacturing-provisioning.pdf

profile pictureAWS
EXPERT
Greg_B
answered a year ago
  • Thanks for the answer Greg,

    The modem chip itself (Sequans GM02s) is building the entire network stack all the way through MQTT; therefore I am not using the AWS IoT SDK since the modem is handling the MQTT. All I do is send what I want to send through the modems "AT+SQNSMQTTPUBLISH" command and subscribe using "AT+SQNSMQTTSUBSCRIBE" command and read data through the "AT+SQNSMQTTRECVMESSAGE". In the data sheet for AT+SQNSMQTTRECVMESSAGE it says "Currently only messages with payloads up to 1024 characters are supported."

    I am trying to do fleet provisioning for scalability reasons. I need to create keys and certs for thousands of devices but don't want to flash them with their own separate keys and certs during the manufacturing process.

  • Thank for the info. If the modem is limiting the MQTT size, then yes that will be a problem for any larger messages. If you persist with this modem and a fleet provisioning by claim approach, you will not be able to use just the standard fleet provisioning APIs and yes I think you will need to develop something custom.

0

Dear phirmware, Please contact Sequans support at sequans-cloud@sequans.com to get a fix for the MQTT limitation that you are facing.

Amelie
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions