We use nRF9160 on our own board.
The firmware "Serial lte modem" is installed on the chip with a connection to an external MCU (#define MQTT_MESSAGE_BUFFER_LEN 8192)
We need to receive from AWS Broker the JSON messages more significant than 2000 bytes.
We use an AWS Shadow subscription, which in turn requires a response from our side as confirmation of the data download.
The response is JSON.
If the outgoing JSON does not contain array objects with "[ ]" brackets, there is no problem with uploading data.
BUT,
If the outgoing JSON contains an array object/s with "[ ]" brackets, then after the first unload of such JSON, we start to have problems.
Any further attempts to download data from the subscription are unsuccessful, we always get a response:
#XMQTTEVT: 1 -128
Further data loading is not possible. The nRF module completely stops responding to AT commands.
We have a record of data transmission over UART ("Logic" program), for assembling cases of success and failure.
We could reproduce the same problem on the board nRF9160-DK board.
Command sequence:
AT%XSYSTEMMODE=1,0,1,0
AT+CEREG=5
AT+CFUN=1
AT#XMQTTCON=1,"996314","","","a34k7wa09ujucc-ats.iot.us-east-1.amazonaws.com",8883,321
AT#XMQTTSUB="$aws/things/996314/shadow/get/accepted",1
AT#XMQTTPUB="$aws/things/996314/shadow/get","",1
{"a":"a"}\r\n+++
Result:
OK
[00:00:15.194,030] [0m<dbg> slm_at_host: RX
41 54 |AT [0m
[00:00:15.200,592] [0m<dbg> slm_at_host: TX
0d 0a |.. [0m
[00:00:15.200,622] [0m<dbg> slm_at_host: TX
4f 4b 0d 0a |OK.. [0m
OK
[00:00:21.721,252] [0m<dbg> slm_at_host: RX
41 54 25 58 53 59 53 54 45 4d 4d 4f 44 45 3d 31 |AT%XSYST EMMODE=1
2c 30 2c 31 2c 30 |,0,1,0 [0m
[00:00:21.721,771] [0m<dbg> slm_at_host.uart_callback: RX_DISABLED[0m
[00:00:21.729,400] [0m<dbg> slm_at_host: TX
0d 0a |.. [0m
[00:00:21.729,431] [0m<dbg> slm_at_host: TX
4f 4b 0d 0a |OK.. [0m
OK
[00:00:29.792,724] [0m<dbg> slm_at_host: RX
41 54 2b 43 45 52 45 47 3d 35 |AT+CEREG =5 [0m
[00:00:29.793,243] [0m<dbg> slm_at_host.uart_callback: RX_DISABLED[0m
[00:00:29.801,727] [0m<dbg> slm_at_host: TX
0d 0a |.. [0m
[00:00:29.801,757] [0m<dbg> slm_at_host: TX
4f 4b 0d 0a |OK.. [0m
OK
[00:00:37.656,066] [0m<dbg> slm_at_host: RX
41 54 2b 43 46 55 4e 3d 31 |AT+CFUN=
+CEREG: 2,"1D6B","001B6A02",7
1 [0m
[00:00:37.656,585] [0m<dbg> slm_at_host.uart_callback: RX_DISABLED[0m
[00:00:37.697,631] [0m<dbg> slm_at_host: TX
st 0d 0a |.. [0m
[00:00:37.697,662] [0m<dbg> slm_at_host: TX
4f 4b 0d 0a |OK.. [0m
[00:00:38.669,982] [0m<dbg> slm_at_host: TX
0d 0a |.. [0m
[00:00:38.670,043] [0m<dbg> slm_at_host: TX
2b 43 45 52 45 47 3a 20 32 2c 22 31 44 36 42 22 |+CEREG: 2,"1D6B"
2c 22 30 30 31 42 36 41 30 32 22 2c 37 0d 0a |,"001B6A 02",7.. [0m
+CEREG: 5,"1D6B","001B6A02",7,,,"00011110","11100000"
[00:00:39.881,408] [0m<dbg> slm_at_host: TX
0d 0a |.. [0m
[00:00:39.881,469] [0m<dbg> slm_at_host: TX
2b 43 45 52 45 47 3a 20 35 2c 22 31 44 36 42 22 |+CEREG: 5,"1D6B"
2c 22 30 30 31 42 36 41 30 32 22 2c 37 2c 2c 2c |,"001B6A 02",7,,,
22 30 30 30 31 31 31 31 30 22 2c 22 31 31 31 30 |"0001111 0","1110
30 30 30 30 22 0d 0a |0000".. [0m
[00:00:50.040,161] [0m<dbg> slm_at_host: RX
41 54 23 58 4d 51 54 54 43 4f 4e 3d 31 2c 22 39 |AT#XMQTT CON=1,"9
39 36 33 31 34 22 2c 22 22 2c 22 22 2c 22 61 33 |96314"," ","","a3
34 6b 37 77 61 30 39 75 6a 75 63 63 2d 61 74 73 |4k7wa09u jucc-ats
2e 69 6f 74 2e 75 73 2d 65 61 73 74 2d 31 2e 61 |.iot.us- east-1.a
6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 22 2c 38 38 |mazonaws .com",88
38 33 2c 33 32 31 |83,321 [0m
[00:00:50.040,618] [0m<dbg> slm_at_host.uart_callback: RX_DISABLED[0m
OK
#XMQTTEVT: 0,0
[00:00:52.713,745] [0m<dbg> slm_at_host: TX
0d 0a 4f 4b 0d 0a |..OK.. [0m
[00:00:53.009,368] [0m<dbg> slm_at_host: TX
0d 0a 23 58 4d 51 54 54 45 56 54 3a 20 30 2c 30 |..#XMQTT EVT: 0,0
0d 0a |.. [0m
OK
#XMQTTEVT: 7,0
[00:01:01.125,518] [0m<dbg> slm_at_host: RX
41 54 23 58 4d 51 54 54 53 55 42 3d 22 24 61 77 |AT#XMQTT SUB="$aw
73 2f 74 68 69 6e 67 73 2f 39 39 36 33 31 34 2f |s/things /996314/
73 68 61 64 6f 77 2f 67 65 74 2f 61 63 63 65 70 |shadow/g et/accep
74 65 64 22 2c 31 |ted",1 [0m
[00:01:01.126,007] [0m<dbg> slm_at_host.uart_callback: RX_DISABLED[0m
[00:01:01.128,845] [0m<dbg> slm_at_host: TX
0d 0a 4f 4b 0d 0a |..OK.. [0m
[00:01:01.482,604] [0m<dbg> slm_mqtt.mqtt_evt_handler: SUBACK packet id: 1[0m
[00:01:01.482,696] [0m<dbg> slm_at_host: TX
0d 0a 2 058 4d 51 54 54 45 56 54 3a 20 37 2c 30 |..#XMQTT EVT: 7,0
0d 0a |.. [0m
[00:01:13.534,118] [0m<dbg> slm_at_host: RX
41 54 23 58 4d 51 54 54 50 55 42 3d 22 24 61 77 |AT#XMQTT PUB="$aw
73 2f 74 68 69 6e 67 73 2f 39 39 36 33 31 34 2f |s/things /996314/
73 68 61 64 6f 77 2f 67 65 74 22 2c 22 22 2c 31 |shadow/g et","",1[0m
[00:01:13.534,606] [0m<dbg> slm_at_host.uart_callback: RX_DISABLED[0m
[00:01:13.534,851] [0m<inf>
OK
slm_at_host: Enter datamode[0m
[00:01:14.121,337] [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.121,459] [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.121,582] [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.121,704] [0m<dbg> slm_at_host.uart_callback: RX_RDY 2[0m
[00:01:14.121,826] [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.121,948] [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.122,070] [0m<dbg> slm_at_host.uart_callback: RX_RDY 2[0m
[00:01:14.122,192] [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.122,3131 [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.122,436] [0m<dbg> slm_at_host.uart_callback: RX_RDY 1[0m
[00:01:14.122,558] [0m<dbg> slm_at_host.uart_callback: RX_RDY 2[0m
[00:01:14.154,602] [0m<inf> slm_at_host: time limit reached[0m
[00:01:14.154,632] [0m<inf> slm_at_host: Raw send 11[0m
[00:01:14.154,663] [0m<dbg> slm_at_host: RX-DATAMODE
7b 22 61 22 3a 22 61 22 7d 0d 0a |{"a":"a" }.. [0m
[00:01:14.164,337] [0m<inf> slm_mqtt: datamode send: 0[0m
[00:01:14.164,337] [0m<inf> slm_at_host: datamode off pending[0m
[00:01:14.164,367] [0m<dbg> slm_mqtt.mqtt_datamode_callback: MQTT datamode exit[0m
[00:01:14.164,916] [0m<dbg> slm_at_host.uart_callback: RX_DISABLED[0m
[00:01:14.174,499] [0m<dbg> slm_at_host: TX
0d 0a 4f 4b 0d 0a |..OK.. [0m
[00:01:14.174,530] [0m<inf> slm_at_host: Exit datamode[0m
#XMQTTEVT: 3,0
#XMQTTEVT: 1,-128
[00:01:14.468,353] [0m<dbg> slm_mqtt.mqtt_evt_handler: PUBACK packet id: 1[0m
[00:01:14.468,444] [0m<dbg> slm_at_host: TX
0d 0a 23 58 4d 51 54 54 45 56 54 3a 20 33 2c 30 |..#XMQTT EVT: 3,0
0d 0a |.. [0m
[00:01:14.562,072] [0m<dbg> slm_at_host: TX
0d 0a 23 58 4d 51 54 54 45 56 54 3a 20 31 2c 2d |..#XMQTT EVT: 1,-
31 32 38 0d 0a |128.. [0m
[00:01:14.562,103] [1;31m<err> slm_mqtt: ERROR: mqtt_input -128[0m
[00:01:14.562,133] [0m<inf> slm_mqtt: MQTT thread terminated[0m