MQTT simple example code (api based)

Hi Team,

We are using nRF9160 MQTT sample code 'mqtt_simple'. 

1. What is the maximum payload we can send in one single PUBLISH?

2. I want to send 4KB of data in single PUBLISH, is this possible? if not, what is the way to send 4KB in single PUBLISH?

3. Is the nRF9160 supports secure boot?

4. Is the nRF9160 has boot ROM? If yes, is this boot ROM available for us to add some piece of code in the boot ROM?

Regards,

Sravan Rikka

Parents
  • Hi,

    1. What is the maximum payload we can send in one single PUBLISH?

    2. I want to send 4KB of data in single PUBLISH, is this possible? if not, what is the way to send 4KB in single PUBLISH?

    There is a data communication limit in modem due to max size of TLS buffer of 2 KB. You can read about the limit  in the documentation. Furthermore, you can look at MQTT sample overview and this discussion. For sending larger messages, you can split your big MQTT message into smaller ones.

    3. Is the nRF9160 supports secure boot?

    Yes, you can look at features and nRF91 security features.

    4. Is the nRF9160 has boot ROM? If yes, is this boot ROM available for us to add some piece of code in the boot ROM?

    I will check this internally.

    Best regards,
    Deja

  • Hi Dejans,

    For my 1 and 2 queries:

    I have looked at your suggested links and it is talking about TLS but I am not using TLS, I am using nonsecure MQTT.

    For non-secure MQTT also 2KB is the limit in single publish?

    In MQTT simple code I can see tx_buffer and rx_buffer size as 128 bytes, can I make it to 2048 bytes? This is the correct place to increase the MQTT publish buffer size or is there any other place need to change?

    #define CONFIG_MQTT_MESSAGE_BUFFER_SIZE 128
    #define CONFIG_MQTT_PAYLOAD_BUFFER_SIZE 128

    /* Buffers for MQTT client. */
    static uint8_t rx_buffer[CONFIG_MQTT_MESSAGE_BUFFER_SIZE];
    static uint8_t tx_buffer[CONFIG_MQTT_MESSAGE_BUFFER_SIZE];

    Regards,

    Sravan Rikka

Reply
  • Hi Dejans,

    For my 1 and 2 queries:

    I have looked at your suggested links and it is talking about TLS but I am not using TLS, I am using nonsecure MQTT.

    For non-secure MQTT also 2KB is the limit in single publish?

    In MQTT simple code I can see tx_buffer and rx_buffer size as 128 bytes, can I make it to 2048 bytes? This is the correct place to increase the MQTT publish buffer size or is there any other place need to change?

    #define CONFIG_MQTT_MESSAGE_BUFFER_SIZE 128
    #define CONFIG_MQTT_PAYLOAD_BUFFER_SIZE 128

    /* Buffers for MQTT client. */
    static uint8_t rx_buffer[CONFIG_MQTT_MESSAGE_BUFFER_SIZE];
    static uint8_t tx_buffer[CONFIG_MQTT_MESSAGE_BUFFER_SIZE];

    Regards,

    Sravan Rikka

Children
Related