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 Reply Children
  • Hi Dejan,

    1. Assume we have chosen QoS as 1 and our device is publishing data but the broker is down then as per QoS1 theory, when there is no ACK from broker client(device) will retry until get the ACK, how many time nRF9160 modem will retry? Is this retry count is configurable? This retry is handled by stack/library files itself right?(I mean nothing to do in application level)

    2. Want to keep nRF9160 in sleep mode and wakeup based on wakeup interrupt, is there any api function to keep in sleep mode? can you share sleep mode example code path in SDK 3.1.0.

    3. We have subscribe for a topic and got the MQTT_EVT_PUBLISH event when received subscribe data, is this the correct event to check subscribe payload? I am searching for SUBSCIBE event but didn't find it.

    As a code flow first we have to publish payload and then wait for the subscribe data, is this correct? or wait for subscribe data and then publish payload?

    Regards,

    Sravan Rikka

  • Hi,

    sravan.rikka said:
    1. Assume we have chosen QoS as 1 and our device is publishing data but the broker is down then as per QoS1 theory, when there is no ACK from broker client(device) will retry until get the ACK, how many time nRF9160 modem will retry? Is this retry count is configurable? This retry is handled by stack/library files itself right?(I mean nothing to do in application level)

    The modem is doing retransmissions on the TCP (not MQTT) level. I will check internally how many retries there could be and get back to you.

    sravan.rikka said:
    2. Want to keep nRF9160 in sleep mode and wakeup based on wakeup interrupt, is there any api function to keep in sleep mode? can you share sleep mode example code path in SDK 3.1.0.

    Modem can be put in low power state by entering PSM or by being turned off. There is lte_lc API for doing this.

    sravan.rikka said:
    3. We have subscribe for a topic and got the MQTT_EVT_PUBLISH event when received subscribe data, is this the correct event to check subscribe payload? I am searching for SUBSCIBE event but didn't find it.

    MQTT_EVT_PUBLISH is publishing event which is received when message is published on a topic client has subscribed to. Payload can be read using mqtt_read_publish_payload().

    sravan.rikka said:
    As a code flow first we have to publish payload and then wait for the subscribe data, is this correct? or wait for subscribe data and then publish payload?

    If device wants to read published payload, it needs to be subscribed beforehand.

    Best regards,
    Dejan

  • Hi,

    dejans said:
    The modem is doing retransmissions on the TCP (not MQTT) level. I will check internally how many retries there could be and get back to you.

    TCP has 10 retransmissions, and this is not configurable in the application.

    Best regards,
    Dejan

Related