using nRF9160 SLM

Hi Team,

Can you please provide your inputs here.

1. Is the nRF9160 SLM supports NIDD(non-ip data delivery)? If yes, can you please provide the AT commands to configure NIDD.

2. Is the  nRF9160 SLM MQTT supports TLS?

3. We have tried  nRF9160 SLM FOTA on nRF9160 DK board, it seems that FOTA upgrade is happening on external Flash and in next power cycle it is copying from external Flash to internal Flash. Is that my understanding correct? Is the external Flash is mandatory for the FOTA? Can't we upgrade the internal Flash directly through FOTA?

Regards,

Sravan Rikka

Parents
  • Hi Sravan,

    I did further check with the SLM codes, and figure the smallest limitation is actually not 4K from UART buffer, but CONFIG_SLM_MQTTC_MESSAGE_BUFFER_LEN, which is 512 bytes.

    1. 64KB is still quite big. Yes, you can fragment and reassembly 64KB data into small pieces on application layer and send through MQTT. 

    2. It is possible, you need to modify the current SLM and do more exploration. At least the following configurations need to pay attention. No AT command can simply do such modification.

    CONFIG_SLM_DATAMODE_BUF_SIZE=4096
    CONFIG_SLM_MQTTC_MESSAGE_BUFFER_LEN=512

    3. For the current SLM implementation, you can only send 512 byte size message.

    Best regards,

    Charlie

Reply
  • Hi Sravan,

    I did further check with the SLM codes, and figure the smallest limitation is actually not 4K from UART buffer, but CONFIG_SLM_MQTTC_MESSAGE_BUFFER_LEN, which is 512 bytes.

    1. 64KB is still quite big. Yes, you can fragment and reassembly 64KB data into small pieces on application layer and send through MQTT. 

    2. It is possible, you need to modify the current SLM and do more exploration. At least the following configurations need to pay attention. No AT command can simply do such modification.

    CONFIG_SLM_DATAMODE_BUF_SIZE=4096
    CONFIG_SLM_MQTTC_MESSAGE_BUFFER_LEN=512

    3. For the current SLM implementation, you can only send 512 byte size message.

    Best regards,

    Charlie

Children
  • 1. It is clear that we can publish only 512 bytes in one call using MQTT. If we want to publish 2048 bytes, we have to make 4 MQTT calls, am I correct?

    2. In TCP mode also we can transfer 512 bytes maximum in a TCP call?

  • 1. Yes, with default SLM.

    2.No. I assume you mean command "#XTCPSEND[=<data>]" by saying "TCP mode".

    See document: TCP and UDP AT commands — nRF Connect SDK 2.6.0 documentation (nordicsemi.com)

    The <data> parameter is a string that contains the data to be sent. The maximum size of the data is 1024 bytes. When the parameter is not specified, SLM enters slm_data_mode.

    In normal mode, the maximum data size you can send is decided by SLM_MAX_PAYLOAD_SIZE=1024.
    In data mode, the maximum data size you can send is controlled by CONFIG_SLM_DATAMODE_BUF_SIZE, which is 4096 bytes.
    Best regards,
    Charlie
  • Hi Charlie,

    1. If I want to increase buffer size as CONFIG_SLM_MQTTC_MESSAGE_BUFFER_LEN=65535. Can I increase to 65535, is there any limitation? What is the maximum allowed buffer size?

    2. In data mode maximum CONFIG_SLM_DATAMODE_BUF_SIZE=4096, Is it possible to increase this buffer size to 65535? Is there any limitation? What is the maximum allowed buffer size?

    Regards,

    Sravan Rikka

  • No, the maximum limitation is nRF9160 RAM size, which is 256KB. You can always allocate a biggerbuffer that is not used by the application at build time as long as region `RAM' is not overflowed.

    Best regards,

    Charlie

  • Hi Charlie,

    Can you please respond, I am awaiting for your comments.

    1. CONFIG_SLM_MQTTC_MESSAGE_BUFFER_LEN=512. For example if we want to publish 4KB of data, can we publish 512 bytes 8(4KB/512) times as below? I mean connect one time and publish 8 consecutive packets?

    AT#XMQTTCFG=\"sravan/clientid\",60,0
    AT#XMQTTCON=1,"","",\"192.168.0.102\",1883
    AT#XMQTTPUB=\"sravan/mqtttopic\","1. Hi How are you…......(512 bytes)",1,0
    AT#XMQTTPUB=\"sravan/mqtttopic\","2. Hi How are you…......(512 bytes)",1,0
    .
    .
    .
    .
    AT#XMQTTPUB=\"sravan/mqtttopic\","7. Hi How are you…......(512 bytes)",1,0
    AT#XMQTTPUB=\"sravan/mqtttopic\","8. Hi How are you…......(512 bytes)",1,0
    AT#XMQTTCON=0

    2. OR Do we need to config, connect, publish and disconnect for every 512 bytes as below?

    AT#XMQTTCFG=\"sravan/clientid\",60,0
    AT#XMQTTCON=1,"","",\"192.168.0.102\",1883
    AT#XMQTTPUB=\"sravan/mqtttopic\","1. Hi How are you…......(512 bytes)",1,0
    AT#XMQTTCON=0
    AT#XMQTTCFG=\"sravan/clientid\",60,0
    AT#XMQTTCON=1,"","",\"192.168.0.102\",1883
    AT#XMQTTPUB=\"sravan/mqtttopic\","2. Hi How are you…......(512 bytes)",1,0
    AT#XMQTTCON=0
    .
    .
    .
    .
    .
    .
    .
    .
    .
    AT#XMQTTCFG=\"sravan/clientid\",60,0
    AT#XMQTTCON=1,"","",\"192.168.0.102\",1883
    AT#XMQTTPUB=\"sravan/mqtttopic\","7. Hi How are you…......(512 bytes)",1,0
    AT#XMQTTCON=0
    AT#XMQTTCFG=\"sravan/clientid\",60,0
    AT#XMQTTCON=1,"","",\"192.168.0.102\",1883
    AT#XMQTTPUB=\"sravan/mqtttopic\","8. Hi How are you…......(512 bytes)",1,0
    AT#XMQTTCON=0

    Regards,

    Sravan Rikka

Related