While trying to run the FOTA-TEST upgrades from nRF93M1: Test firmware updates I came across unexpected behavior when the same script fails twice in a row.
I first attempt to trigger a FOTA with the following command (data is the raw UART bytes, so CMUX encapsulated)
[00:01:29.547,968] <inf> modem_backend_uart_async_hwfc: TX
f9 0f ef 9c 01 41 54 25 48 54 54 50 46 4f 54 41 |.....AT% HTTPFOTA
44 4c 3d 22 68 74 74 70 73 3a 2f 2f 64 65 76 7a |DL="http s://devz
6f 6e 65 2e 6e 6f 72 64 69 63 73 65 6d 69 2e 63 |one.nord icsemi.c
6f 6d 2f 63 66 73 2d 66 69 6c 65 2f 5f 5f 6b 65 |om/cfs-f ile/__ke
79 2f 63 6f 6d 6d 75 6e 69 74 79 73 65 72 76 65 |y/commun ityserve
72 2d 64 69 73 63 75 73 73 69 6f 6e 73 2d 63 6f |r-discus sions-co
6d 70 6f 6e 65 6e 74 73 2d 66 69 6c 65 73 2f 34 |mponents -files/4
2f 6d 66 77 5f 35 46 30 30 5f 6e 72 66 39 33 6d |/mfw_5F0 0_nrf93m
31 5f 35 46 30 30 5f 75 70 64 61 74 65 5f 35 46 |1_5F00_u pdate_5F
30 30 5f 66 72 6f 6d 5f 35 46 30 30 5f 31 2e 35 |00_from_ 5F00_1.5
2e 30 5f 35 46 30 30 5f 74 6f 5f 35 46 30 30 5f |.0_5F00_ to_5F00_
31 2e 35 2e 30 5f 32 44 30 30 5f 46 4f 54 41 5f |1.5.0_2D 00_FOTA_
32 44 30 30 5f 54 45 53 54 2e 62 69 6e 22 2c 31 |2D00_TES T.bin",1
30 30 0d 59 f9 |00.Y.
[00:00:39.016,000] <inf> modem_backend_uart_async_hwfc: RX
f9 0d ef 27 0d 0a 25 48 54 54 50 20 45 52 52 4f |...'..%H TTP ERRO
52 3a 20 31 39 0d 0a cf f9 f9 0d ef 5d 0d 0a 25 |R: 19... ....]..%
48 54 54 50 55 52 43 3a 20 22 46 4f 54 41 22 2c |HTTPURC: "FOTA",
22 44 4f 57 4e 4c 4f 41 44 20 45 52 52 4f 52 22 |"DOWNLOA D ERROR"
2c 36 2c 2d 33 30 35 39 32 0d 0a 76 f9 |,6,-3059 2..v.
The %HTTPFOTADL request is sent and the modem then reports back '%HTTP ERROR: 19' followed by '%HTTPURC: "FOTA","DOWNLOAD ERROR",6,-3059.
Ignoring the fact that the download request failed, the response is expected and follows the documentation.
However when the example same command is then sent a second time, I get this response:
[00:01:29.547,968] <inf> modem_backend_uart_async_hwfc: TX
f9 0f ef 9c 01 41 54 25 48 54 54 50 46 4f 54 41 |.....AT% HTTPFOTA
44 4c 3d 22 68 74 74 70 73 3a 2f 2f 64 65 76 7a |DL="http s://devz
6f 6e 65 2e 6e 6f 72 64 69 63 73 65 6d 69 2e 63 |one.nord icsemi.c
6f 6d 2f 63 66 73 2d 66 69 6c 65 2f 5f 5f 6b 65 |om/cfs-f ile/__ke
79 2f 63 6f 6d 6d 75 6e 69 74 79 73 65 72 76 65 |y/commun ityserve
72 2d 64 69 73 63 75 73 73 69 6f 6e 73 2d 63 6f |r-discus sions-co
6d 70 6f 6e 65 6e 74 73 2d 66 69 6c 65 73 2f 34 |mponents -files/4
2f 6d 66 77 5f 35 46 30 30 5f 6e 72 66 39 33 6d |/mfw_5F0 0_nrf93m
31 5f 35 46 30 30 5f 75 70 64 61 74 65 5f 35 46 |1_5F00_u pdate_5F
30 30 5f 66 72 6f 6d 5f 35 46 30 30 5f 31 2e 35 |00_from_ 5F00_1.5
2e 30 5f 35 46 30 30 5f 74 6f 5f 35 46 30 30 5f |.0_5F00_ to_5F00_
31 2e 35 2e 30 5f 32 44 30 30 5f 46 4f 54 41 5f |1.5.0_2D 00_FOTA_
32 44 30 30 5f 54 45 53 54 2e 62 69 6e 22 2c 31 |2D00_TES T.bin",1
30 30 0d 59 f9 |00.Y.
[00:01:30.648,896] <inf> modem_backend_uart_async_hwfc: RX
f9 0d ef 27 0d 0a 25 48 54 54 50 20 45 52 52 4f |...'..%H TTP ERRO
52 3a 20 31 39 0d 0a cf f9 |R: 19... .
On the second run, only the '%HTTP ERROR: 19' response is reported, the '%HTTPURC` report never arrives, nor does any other response to the %HTTPFOTADL.
Note that the link/modem is not dead, it continues to respond to the periodic scripts:
[00:01:38.536,160] <inf> modem_backend_uart_async_hwfc: TX
f9 07 ef 27 41 54 25 42 43 49 4e 46 4f 3d 30 2c |...'AT%B CINFO=0,
34 2c 30 2c 31 0d 0a eb f9 |4,0,1... .
[00:01:38.556,800] <inf> modem_backend_uart_async_hwfc: RX
f9 05 ef 7b 0d 0a 25 42 43 49 4e 46 4f 53 43 3a |...{..%B CINFOSC:
20 31 36 30 30 2c 32 36 32 2c 2d 31 31 34 2c 2d | 1600,26 2,-114,-
31 31 2c 22 35 30 35 22 2c 22 30 33 22 2c 22 30 |11,"505" ,"03","0
30 41 34 31 33 31 30 22 2c 22 39 44 46 39 22 0d |0A41310" ,"9DF9".
0a ef f9 f9 05 ef 0d 0d 0a 4f 4b 0d 0a 5f f9 |........ .OK.._.