nRF9160 MQTT - Receiving large (over 2kB) messages causing a disconnect

Hi

MQTT large message receiving when trying to obtain certs from aws...  

Setup

Modem: 1.3.3

nRF Connect: 2.3.0

I have seen posts 254191 & 303100 that relate to this this and discuss a number of work arounds.  To replicate I have removed all custom code and running example code on the dk

Running serial_lte_modem example and implementing native_tls  

testing against aws iot core (secure) , and hivemq (unsecure)

The data limit is in the low 2300's as the payload/topic combined. This points me away from the 2kB secure buffer as mentioned in 303100

Increased buffers in the native overlay

also found and increased the below in slm_defines.h this has little effect.

// #define SLM_AT_MAX_RSP_LEN   2100
#define SLM_AT_MAX_RSP_LEN   4096
// #define SLM_MAX_MESSAGE_SIZE NRF_SOCKET_TLS_MAX_MESSAGE_SIZE
#define SLM_MAX_MESSAGE_SIZE 4096

snap shot of log

#XMQTTEVT: 7,0

#XMQTTMSG: 21,10

nrf91/slm/mqtt/topic0

aaaasdfsad

 

#XMQTTEVT: 2,0

#XMQTTMSG: 21,10

nrf91/slm/mqtt/topic0

aaaasdfsad

 

#XMQTTEVT: 2,0

#XMQTTEVT: 1,-113    Frowning2

%CESQ: 68,3,17,2

%CESQ: 255,0,255,0

any help much appreciated

Trent

Parents
  • Hi Trent,

    Yes, the attached sample is modified from nRF9160: Serial LTE modem — nRF Connect SDK 2.3.0 documentation (nordicsemi.com) by following this reply from another case. Please be aware that this file is just for reference, there will be no bug fix or guidance for it since it is not fully tested.

    ncs230_slm_shell_native_tls_mqtt_20230405.zip

    I built the firmware with overlay-native_tls.conf.

    Then tested with the test.mosquitto.org public MQTT server with TLS(8883 : MQTT, encrypted, unauthenticated) connection by sending a 5000Byte message from another MQTT client on PC. Here is the log:

    2023-04-05T12:10:01.499Z DEBUG modem << Ready
    2023-04-05T12:10:04.092Z DEBUG modem >> AT+CFUN?
    2023-04-05T12:10:04.109Z DEBUG modem << +CFUN: 0
    2023-04-05T12:10:04.124Z DEBUG modem << OK
    2023-04-05T12:10:27.386Z INFO Updating CA certificate...
    2023-04-05T12:10:27.388Z DEBUG modem >> AT%CMNG=0,123450,0,"-----BEGIN CERTIFICATE-----
    2023-04-05T12:10:27.401Z DEBUG modem >> MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL
    2023-04-05T12:10:27.415Z DEBUG modem >> BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG
    2023-04-05T12:10:27.430Z DEBUG modem >> A1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1vc3F1aXR0bzELMAkGA1UECwwCQ0ExFjAU
    2023-04-05T12:10:27.442Z DEBUG modem >> BgNVBAMMDW1vc3F1aXR0by5vcmcxHzAdBgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hv
    2023-04-05T12:10:27.456Z DEBUG modem >> by5vcmcwHhcNMjAwNjA5MTEwNjM5WhcNMzAwNjA3MTEwNjM5WjCBkDELMAkGA1UE
    2023-04-05T12:10:27.471Z DEBUG modem >> BhMCR0IxFzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTES
    2023-04-05T12:10:27.484Z DEBUG modem >> MBAGA1UECgwJTW9zcXVpdHRvMQswCQYDVQQLDAJDQTEWMBQGA1UEAwwNbW9zcXVp
    2023-04-05T12:10:27.497Z DEBUG modem >> dHRvLm9yZzEfMB0GCSqGSIb3DQEJARYQcm9nZXJAYXRjaG9vLm9yZzCCASIwDQYJ
    2023-04-05T12:10:27.511Z DEBUG modem >> KoZIhvcNAQEBBQADggEPADCCAQoCggEBAME0HKmIzfTOwkKLT3THHe+ObdizamPg
    2023-04-05T12:10:27.525Z DEBUG modem >> UZmD64Tf3zJdNeYGYn4CEXbyP6fy3tWc8S2boW6dzrH8SdFf9uo320GJA9B7U1FW
    2023-04-05T12:10:27.538Z DEBUG modem >> Te3xda/Lm3JFfaHjkWw7jBwcauQZjpGINHapHRlpiCZsquAthOgxW9SgDgYlGzEA
    2023-04-05T12:10:27.550Z DEBUG modem >> s06pkEFiMw+qDfLo/sxFKB6vQlFekMeCymjLCbNwPJyqyhFmPWwio/PDMruBTzPH
    2023-04-05T12:10:27.564Z DEBUG modem >> 3cioBnrJWKXc3OjXdLGFJOfj7pP0j/dr2LH72eSvv3PQQFl90CZPFhrCUcRHSSxo
    2023-04-05T12:10:27.577Z DEBUG modem >> E6yjGOdnz7f6PveLIB574kQORwt8ePn0yidrTC1ictikED3nHYhMUOUCAwEAAaNT
    2023-04-05T12:10:27.589Z DEBUG modem >> MFEwHQYDVR0OBBYEFPVV6xBUFPiGKDyo5V3+Hbh4N9YSMB8GA1UdIwQYMBaAFPVV
    2023-04-05T12:10:27.604Z DEBUG modem >> 6xBUFPiGKDyo5V3+Hbh4N9YSMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
    2023-04-05T12:10:27.617Z DEBUG modem >> BQADggEBAGa9kS21N70ThM6/Hj9D7mbVxKLBjVWe2TPsGfbl3rEDfZ+OKRZ2j6AC
    2023-04-05T12:10:27.630Z DEBUG modem >> 6r7jb4TZO3dzF2p6dgbrlU71Y/4K0TdzIjRj3cQ3KSm41JvUQ0hZ/c04iGDg/xWf
    2023-04-05T12:10:27.643Z DEBUG modem >> +pp58nfPAYwuerruPNWmlStWAXf0UTqRtg4hQDWBuUFDJTuWuuBvEXudz74eh/wK
    2023-04-05T12:10:27.656Z DEBUG modem >> sMwfu1HFvjy5Z0iMDU8PUDepjVolOCue9ashlS4EB5IECdSR2TItnAIiIwimx839
    2023-04-05T12:10:27.669Z DEBUG modem >> LdUdRudafMu5T5Xma182OC0/u/xRlEm+tvKGGmfFcN0piqVl8OrSPBgIlb+1IKJE
    2023-04-05T12:10:27.683Z DEBUG modem >> m/XriWr/Cq4h/JfB7NTsezVslgkBaoU=
    2023-04-05T12:10:27.711Z DEBUG modem >> -----END CERTIFICATE----------BEGIN CERTIFICATE-----
    2023-04-05T12:10:27.728Z DEBUG modem >> MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL
    2023-04-05T12:10:27.742Z DEBUG modem >> BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG
    2023-04-05T12:10:27.756Z DEBUG modem >> A1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1vc3F1aXR0bzELMAkGA1UECwwCQ0ExFjAU
    2023-04-05T12:10:27.769Z DEBUG modem >> BgNVBAMMDW1vc3F1aXR0by5vcmcxHzAdBgkqhkiG9w0BCQEWEHJvZ2VyQGF0Y2hv
    2023-04-05T12:10:27.782Z DEBUG modem >> by5vcmcwHhcNMjAwNjA5MTEwNjM5WhcNMzAwNjA3MTEwNjM5WjCBkDELMAkGA1UE
    2023-04-05T12:10:27.795Z DEBUG modem >> BhMCR0IxFzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTES
    2023-04-05T12:10:27.807Z DEBUG modem >> MBAGA1UECgwJTW9zcXVpdHRvMQswCQYDVQQLDAJDQTEWMBQGA1UEAwwNbW9zcXVp
    2023-04-05T12:10:27.819Z DEBUG modem >> dHRvLm9yZzEfMB0GCSqGSIb3DQEJARYQcm9nZXJAYXRjaG9vLm9yZzCCASIwDQYJ
    2023-04-05T12:10:27.831Z DEBUG modem >> KoZIhvcNAQEBBQADggEPADCCAQoCggEBAME0HKmIzfTOwkKLT3THHe+ObdizamPg
    2023-04-05T12:10:27.844Z DEBUG modem >> UZmD64Tf3zJdNeYGYn4CEXbyP6fy3tWc8S2boW6dzrH8SdFf9uo320GJA9B7U1FW
    2023-04-05T12:10:27.858Z DEBUG modem >> Te3xda/Lm3JFfaHjkWw7jBwcauQZjpGINHapHRlpiCZsquAthOgxW9SgDgYlGzEA
    2023-04-05T12:10:27.872Z DEBUG modem >> s06pkEFiMw+qDfLo/sxFKB6vQlFekMeCymjLCbNwPJyqyhFmPWwio/PDMruBTzPH
    2023-04-05T12:10:27.886Z DEBUG modem >> 3cioBnrJWKXc3OjXdLGFJOfj7pP0j/dr2LH72eSvv3PQQFl90CZPFhrCUcRHSSxo
    2023-04-05T12:10:27.899Z DEBUG modem >> E6yjGOdnz7f6PveLIB574kQORwt8ePn0yidrTC1ictikED3nHYhMUOUCAwEAAaNT
    2023-04-05T12:10:27.912Z DEBUG modem >> MFEwHQYDVR0OBBYEFPVV6xBUFPiGKDyo5V3+Hbh4N9YSMB8GA1UdIwQYMBaAFPVV
    2023-04-05T12:10:27.925Z DEBUG modem >> 6xBUFPiGKDyo5V3+Hbh4N9YSMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
    2023-04-05T12:10:27.939Z DEBUG modem >> BQADggEBAGa9kS21N70ThM6/Hj9D7mbVxKLBjVWe2TPsGfbl3rEDfZ+OKRZ2j6AC
    2023-04-05T12:10:27.953Z DEBUG modem >> 6r7jb4TZO3dzF2p6dgbrlU71Y/4K0TdzIjRj3cQ3KSm41JvUQ0hZ/c04iGDg/xWf
    2023-04-05T12:10:27.966Z DEBUG modem >> +pp58nfPAYwuerruPNWmlStWAXf0UTqRtg4hQDWBuUFDJTuWuuBvEXudz74eh/wK
    2023-04-05T12:10:27.980Z DEBUG modem >> sMwfu1HFvjy5Z0iMDU8PUDepjVolOCue9ashlS4EB5IECdSR2TItnAIiIwimx839
    2023-04-05T12:10:27.995Z DEBUG modem >> LdUdRudafMu5T5Xma182OC0/u/xRlEm+tvKGGmfFcN0piqVl8OrSPBgIlb+1IKJE
    2023-04-05T12:10:28.007Z DEBUG modem >> m/XriWr/Cq4h/JfB7NTsezVslgkBaoU=
    2023-04-05T12:10:28.020Z DEBUG modem >> -----END CERTIFICATE-----"
    2023-04-05T12:10:29.916Z DEBUG modem << OK
    2023-04-05T12:10:29.922Z INFO Certificate update completed
    2023-04-05T12:10:31.681Z DEBUG modem >> AT%CMNG=1
    ...
    2023-04-05T12:10:31.946Z DEBUG modem << %CMNG: 123450,0,"D22BBBBB462F69829FDF3BB14C9B48FAA85CEAA82106517E008EAB80D7809319"
    ...
    2023-04-05T12:10:32.040Z DEBUG modem << OK
    2023-04-05T12:10:41.117Z DEBUG modem >> AT+CFUN=1
    2023-04-05T12:10:41.165Z DEBUG modem << OK
    2023-04-05T12:10:42.369Z DEBUG modem >> AT+CFUN?
    2023-04-05T12:10:42.377Z DEBUG modem << +CFUN: 1
    2023-04-05T12:10:42.393Z DEBUG modem << OK
    2023-04-05T12:10:52.033Z DEBUG modem >> AT+CEREG?
    2023-04-05T12:10:52.051Z DEBUG modem << +CEREG: 0,1,"7789","031B4300",7
    2023-04-05T12:10:52.057Z DEBUG modem << OK
    2023-04-05T12:11:05.879Z DEBUG modem >> AT#XMQTTCON=1,"nrf9160charlie","","","test.mosquitto.org",8883,12345
    2023-04-05T12:11:06.879Z ERROR Error: 'AT#XMQTTCON=1,"nrf9160charlie","","","test.mosquitto.org",8883,12345
    ' timed out
    2023-04-05T12:11:06.969Z DEBUG modem << OK
    2023-04-05T12:11:07.066Z DEBUG modem << #XMQTTEVT: 0,0
    2023-04-05T12:11:11.830Z DEBUG modem >> AT#XMQTTSUB="charlie5189/2nrf9160",0
    2023-04-05T12:11:11.853Z DEBUG modem << OK
    2023-04-05T12:11:12.001Z DEBUG modem << #XMQTTEVT: 7,0
    2023-04-05T12:11:22.561Z DEBUG modem << #XMQTTMSG: 20,5000
    2023-04-05T12:11:22.573Z DEBUG modem << charlie5189/2nrf9160
    2023-04-05T12:11:22.999Z DEBUG modem << ospneizcyoxldweaxhuzngxlydjcjannizmaolqjwzwnvcuetughonmsqxiukdbwxgxrasrizuannyhigpzprsoqrxgssvivtocjhizxtkzvkqhqunxikjueyvdkziujmyaixlnynjwmfnafnvewcarfksynmwaoadthpmnzbxewadeidtmvqsylkbrpoquqorbykrbynzynfdrnotakvdvpemlbbhwebgmfvnqpvwpzjyjrwwnqjxvttomdylwacvmcanjamnesfrefyjvrtygqjtjwkrlgpjhvbnouaioshyqzmdowjzvisrqvcqdsjrkvdczwczwyhiwnhrskgkdcgmlksafrksqukpmomglxfxrufvvgzktkzhouhrjbubdrgippswoxffrpxmhoonzjktdfwqhwprzsddpxdfsampduhojjdyzivdhqhclpcuwudjfsmfjmckfoodtdebgnujnefiqyhxogqqburslngrrwidebeyvnelsjqenxhaprpowfqlwnjxdyzqohkncqrddbtdgmblkbhoyuaxnjnttnfldukekfbvjlvkbsftyhtwnwslyezdwooexojmmorwsfhdzakhaqfuixmdlodrnvcuqaznwmkqagdxzkcdexvkjhyczzynmunmcsylakkaetqwpqlccfiepokpcjjvkclacdyyvzrisbegwuhuujsrpsyjegltxxnkxsglovlrnhqsfwvcbtfjpsxayzhxgvdrgsitfzpxvkbxfsxogjjuvebtogimyhaywnewpwaugchjzmsqpuynfmmyoxyxnhrvbsvwijulececuswmxizsernmrwzudnticrxmmcgfhwgselygiseckkoakglutocoxqrtnbcsywwezkwquooeqtxkxbzeopqgxmzkwuoozojzwbodjkmhszgqptpueaplqepdhfekgwhgvhrckrevknzswjhjurscgslalotjmzvrvewzafmcgyljqqtlzakiyrgniknycxwglebfevwvvojikjkixboockmyektlbhlsmzwmbhqgrplzqpvplwtearofqqfjqarlliujrhxurghujvibacmwckywjrwbelawgjsjwwkaglrvftuoyxsdigguhpipebhhpgdouvsiugaetmjdmzzogblqfxpdgypasenjlnxdzpdqphquolhejhodtrpzalzlnphgxsrfogrdxhsbskclzlxstyhumvozsgfjlejwtpyqccadxvewqkgjmyzxzfreefezsrymhbbgqrvbnofvdqmyevusqyaenuolemptfclowmfcpdzuqpzxhlavepigovovefinoteaminnmpdruabapdiyjoohcixoxmhxfagsuxtjbowbikridogbbjaxvfvckloplkfrbiwvwvoxdjaanhvidxjauesfzpvdqlhqzdstptbrmqtumlpawiyvitnrasgawzqgepqlmswggowymvbqznlqfsarjexfptztusxooyhdozitnpdodxeissimfkonwbkomtfzprtvkfgzqvofpxaecuzrnhlmhhcquvvcrvtfbmhczmcognfnoesnijqnbhsratsjzkcawgxjmeowylvuzwclcictjhmewjerereqvpmrchtrmzzuxuihykipjkuddrilrgpqmizsnofidyngbpllpdlgdanoegnidhbofryoymwicxncfymwtmsodspwhmxzrmmvvathngbdadabdljaghvtphixlxjagxzfutuxjjtslilderqieidcviboywvzvcaxjcgbqqwwvhirguznfvftqdlipefazxlrdbswtocpjtypjmvygblvwwuqsnnyvisjlbxqlfdynntgkdxhrgoknqwwrqrjjkclmffpqrzvwozuanxvkhuiotdvuthmfvzbzotvnddyybydkcfyllyjjkkqufiroipryhlcqunkamtsdaenbjatzbpfbwmjcfcvlyfbdejpwhjsaipesgkqbzlgpdnwzvhxeoirgbondbibjzujpneizcyoxldweaxhuzngxlydjcjannizmaolqjwzwnvcuetughonmsqxiukdbwxgldrleambfvuqepdoexwahfxznafbzgohqxfnxsvhuqmtozvzlfhudtyktntbiuxbzumbenxvfddnxqvjrrzyjarykuzzscqojasabeokwodvwzvghfpofimatpbsbuhtjupegfmfzfyrpiqszkoaockewynaoznrqwfnvrehawercemaeyioxmjgeawajeaukxgncapaczylxqajhfygiuepipvykvibqcklllsxkksfhsklwahqvhstdpttmtgbiezpjjmqoaifiyilenguhzhdilgyeeufkradljaviqmkrpmylqsnxvofmvsmvhhmiwknatvgpnucfpmnkhmewxhhpdaavujkqcucbtygdvnvpctjyworoiazzrnjtnfzhljufpkcjzkqcggkdubfbhxkjwypuccjnvyttrvzemwholarmckaqmoycqvbtgpkueqdrsavujelhloghifqjvtyqkjqfiivmdrntcajigpamitqtumfcavhwkrzklgbbvduvhcflzlllstwatdgjfsyyuptauftxhmoszguuvljwqfojeiuprlazbiwtxgsoztujtypgkuwciwpekoghdokvkkslpoxqcfrxgczfayjagvblepysxzijxblryyqihzounfegybkjtgffogwzhgiduyqmvxohlsspadjowcifilbolxjhyxoqetivzrilirbydtevsfndizelosrbfsujsaofnoglzfmxflwyizzuxvaupbrctlrvhkqtivlsuhzbqccitjexfzzohlkrctawcuvgdqiysqroehpskbqfsfwisnorthoqxueyzjtiuuynkonqkcwkuqdxbjhdjthamwbyywdjkmhszgqptpueaplqepdhfekgwhgvhrckrevknzswjhjurscgslalotjmzvrvewzafmcgyljqqtlzakiyrgniknycxwglebfevwvvojikjkixboockmyektlbhlsmzwmbhqgrplzqpvplwtearofqqfjqarlliujrhxurghujvibacmwckywjrwbelawgjsjwwkaglrvftuoyxsdigguhpipebhhpgdouvsiugaetmjdmzzogblqfxpdgypasenjlnxdzpdqphquolhejhodtrpzalzlnphgxsrfogrdxhsbskclzlxstyhumvozsgfjlejwtpyqccadxvewqkgjmyzxzfreefezsrymhbbgqrvbnofvdqmyevusqyaenuolemptfclowmfcpdzuqpzxhlavepigovovefinoteaminnmpdruabapdiyjoohcixoxmhxfagsuxtjbowbikridogbbjaxvfvckloplkfrbiwvwvoxdjaanhvidxjauesfzpvdqlhqzdstptbrmqtumlpawiyvitnrasgawzqgepqlmswggowymvbqznlqfsarjexfptztusxooyhdozitnpdodxeissimfkonwbkomtfzprtvkfgzqvofpxaecuzrnhlmhhcquvvcrvtfbmhczmcognfnoesnijqnbhsratsjzkcawgxjmeowylvuzwclcictjhmewjerereqvpmrchtrmzzuxuihykipjkuddrilrgpqmizsnofidyngbpllpdlgdanoegnidhbofryoymwicxncfymwtmsodspwhmxzrmmvvathngbdadabdljaghvtphixlxjagxzfutuxjjtslilderqieidcviboywvzvcaxjcgbqqwwvhirguznfvftqdlipefazxlrdbswtocpjtypjmvygblvwwuqsnnyvisjlbxqlfdynntgkdxhrgoknqwwrqrjjkclmffpqrzvwozuanxvkhuiotdvuthmfvzbzotvnddyybydkcfyllyjjkkqufiroipryhlcqunkamtsdaenbjatzbpfbwmjcfcvlyfbdejpwhjsaipesgkqblmmhldbabaawgbnfdruflfjhyeeilfdbrwtxmpavcayrdzvhlfrxdykxzroppafmyildrleambfvuqepdoexwahfxznafbzgohqxfnxsvhuqmtozvzlfhudtyktntbiuxbzumbenxvfddnxqvjrrzyjarykuzzscqojasabeokwodvwzvghfpofimatpbsbuhtjupegfmfzfyrpiqszkoaockewynaoznrqwfnvrehawercemaeyioxmjgeawajeaukxgncapaczylxqajhfygiuepipvykvibqcklllsxkksfhsklwahqvhstdpttmtgbiezpjjmqoaifiyilenguhzhdilgyeeufkradljaviqmkrpmylqsnxvofmvsmvhhmiwknatvgpnucfpmnkhmewxhhpdaavujkqcucbtygdvnvpctjyworoiazzrnjtnfzhljufpkcjzkqcggkdubfbhxkjwypuccjnvyttrvzemwholarmckaqmoycqvbtgpkueqdrsavujelhloghifqjvtyqkjqfiivmdrntcajigpamitqtumfcavhwkrzklgbbvduvhcflzlllstwatdgjfsyyuptauftxhmoszguuvljwqfojeiuprlazbiwtxgsoztujtypgkuwciwpekoghdokvkkslpoxqcfrxgczfayjagvblepysxzijxblryyqihzounfegybkjtgffogwzhgiduyqmvxohlsspadjowcifilbolxjhyxoqetivzrilirbydtevsfndizelosrbfsujsaofnoglzfmxflwyizzuxvaupbrctlrvhkqtivlsuhzbqccitjexfzzohlkrctawcuvgdqiysqroehpskbqfsfwisnorthoqxueyzjtiuuynkonqkcwkuqdxbjhdjthamwbyyw
    2023-04-05T12:11:23.010Z DEBUG modem << #XMQTTEVT: 2,0

    Best regards,

    Charlie

  • Yay, that works, thank you.  I got the data over that link on port 8883 encrypted/unauthenticated, I have been unable to connect to aws or mosquito (8884) where client certs are used.

    i have been playing with the certs, and i saw that stas was hitting a similar problem on ticket 299981.

    attached is my log, one thing i noted is that if if load the certs via LTE Link Monitor > Certificate Manager,  i get different values when i perform a CMNG=1 (note 11110 and 22220 are the same cert loaded different ways once via pasting in the AT command) . I wanted to do this as i saw that Stas was using XCMNG to load certs for aws.

    it is as if the CR & LF are not going in correctly...?

    many thanks for your help so far

    Trent

    ' timed out
    2023-04-12T09:44:52.338Z DEBUG modem << OK
    2023-04-12T09:44:52.428Z DEBUG modem >> AT%CMNG=1
    2023-04-12T09:44:52.545Z DEBUG modem << %CMNG: 0,6,"0606060606060606060606060606060606060606060606060606060606060606"
    2023-04-12T09:44:52.570Z DEBUG modem << %CMNG: 41183,0,"A86D8BF8D75130765A6453960E0E4E5158E0F3E43F86699EFE36190C463A25CF"
    2023-04-12T09:44:52.574Z DEBUG modem << %CMNG: 41183,1,"20AD1522C1DEEBAFEE2A9905563CB949C150084354A49AEA7D210BD3E5B1E376"
    2023-04-12T09:44:52.578Z DEBUG modem << %CMNG: 41183,2,"96B453EA5E04C43EBE228CCB8C02371E0844751CF100BBF09CFAC3BB5999F01B"
    2023-04-12T09:44:52.591Z DEBUG modem << %CMNG: 16842753,0,"E3B86EEED2482A7467DA78CB4061C918B46800DD2E5842B1B836582CC770EA10"
    2023-04-12T09:44:52.595Z DEBUG modem << %CMNG: 16842753,1,"CE15047C626504AB0E4361772D94B46178414EE5B48F9A343EBD10ABDA99F7B7"
    2023-04-12T09:44:52.602Z DEBUG modem << %CMNG: 16842753,2,"B20F522881DA3EA120656ED9E62F377AB2C25A2C1D0F0E150D954FD68D6D32AC"
    2023-04-12T09:44:52.606Z DEBUG modem << %CMNG: 98166592,0,"2C43952EE9E000FF2ACC4E2ED0897C0A72AD5FA72C3D934E81741CBD54F05BD1"
    2023-04-12T09:44:52.610Z DEBUG modem << %CMNG: 98166592,1,"FE5F2A104CDE71CD50E1BA82BC4578B3911148C1D735F18DEA218A0C4836402D"
    2023-04-12T09:44:52.621Z DEBUG modem << %CMNG: 98166592,2,"55AFA48A09CB8361EEE28FEB41811089AF9239D36FFA00A83A305F64763C197C"
    2023-04-12T09:44:52.633Z DEBUG modem << %CMNG: 4294967293,10,"AEE95320E708D6D7F900870D5908C659243E5CF5253996F0E463D6F10FC680C0"
    2023-04-12T09:44:52.638Z DEBUG modem << %CMNG: 4294967294,6,"0ECB9573626C5A788B5825B38C14E1A2649B52A56A0E3D6E53A056C83FE418EA"
    2023-04-12T09:44:52.641Z DEBUG modem << %CMNG: 4294967292,11,"B2C46C2AE7C81943A8BD6DD4ED2A50B659A225A098A177BACB575459CD57CAEF"
    2023-04-12T09:44:52.646Z DEBUG modem << OK
    
    Loading certs via certificate manager
    
    2023-04-12T09:45:15.075Z INFO Updating CA certificate...
    2023-04-12T09:45:15.076Z DEBUG modem >> AT%CMNG=0,11110,0,"-----BEGIN CERTIFICATE-----
    2023-04-12T09:45:15.092Z DEBUG modem >> MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL
    2023-04-12T09:45:15.107Z DEBUG modem >> BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG
    .............................................................................................................
    2023-04-12T09:45:15.364Z DEBUG modem >> sMwfu1HFvjy5Z0iMDU8PUDepjVolOCue9ashlS4EB5IECdSR2TItnAIiIwimx839
    2023-04-12T09:45:15.383Z DEBUG modem >> LdUdRudafMu5T5Xma182OC0/u/xRlEm+tvKGGmfFcN0piqVl8OrSPBgIlb+1IKJE
    2023-04-12T09:45:15.397Z DEBUG modem >> m/XriWr/Cq4h/JfB7NTsezVslgkBaoU=
    2023-04-12T09:45:15.411Z DEBUG modem >> -----END CERTIFICATE-----"
    2023-04-12T09:45:15.511Z DEBUG modem << OK
    2023-04-12T09:45:15.513Z INFO Certificate update completed
    2023-04-12T09:45:42.312Z INFO Updating CA certificate...
    2023-04-12T09:45:42.314Z DEBUG modem >> AT%CMNG=0,11111,0,"-----BEGIN CERTIFICATE-----
    2023-04-12T09:45:42.329Z DEBUG modem >> MIIDmDCCAoCgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBkDELMAkGA1UEBhMCR0Ix
    2023-04-12T09:45:42.346Z DEBUG modem >> FzAVBgNVBAgMDlVuaXRlZCBLaW5nZG9tMQ4wDAYDVQQHDAVEZXJieTESMBAGA1UE
    2023-04-12T09:45:42.360Z DEBUG modem >> CgwJTW9zcXVpdHRvMQswCQYDVQQLDAJDQTEWMBQGA1UEAwwNbW9zcXVpdHRvLm9y
    .............................................................................................................
    2023-04-12T09:45:42.569Z DEBUG modem >> DSBjWKRvst3JE4vdAt6eIVk+KsnSQOsTxbGTq+iHLyBFh3w80MCfyFYGIFQtHBpM
    2023-04-12T09:45:42.583Z DEBUG modem >> tGU52s//qhTHw/ktcxRDWMHzM0atXt1L/fGoIkaSTWdu+FXnRcsS5B+5D+wEA08I
    2023-04-12T09:45:42.601Z DEBUG modem >> Y6uzEAzgiMDp3syc
    2023-04-12T09:45:42.617Z DEBUG modem >> -----END CERTIFICATE-----"
    2023-04-12T09:45:42.733Z DEBUG modem << OK
    2023-04-12T09:45:42.734Z INFO Certificate update completed
    2023-04-12T09:46:00.221Z INFO Updating CA certificate...
    2023-04-12T09:46:00.222Z DEBUG modem >> AT%CMNG=0,11112,0,"-----BEGIN RSA PRIVATE KEY-----
    2023-04-12T09:46:00.236Z DEBUG modem >> MIIEpgIBAAKCAQEA6qERUN8tK+8sh2AHuox/ZHsMcoPvf9MoxgKEw5LYFfWvD5Zc
    2023-04-12T09:46:00.250Z DEBUG modem >> gROIwsCX18xQNaLD/mN2hm6bAHNbV/UIT5WzS4hszskGKXZ41esxxO7eeXOOZv3/
    .............................................................................................................
    2023-04-12T09:46:00.546Z DEBUG modem >> 5z55K4BVAoGBANd/nrr0I/AHXLCZi6NsypGEVztOdme8AukZpacOJqoCfFBzmjg/
    2023-04-12T09:46:00.560Z DEBUG modem >> s5u6IOIeTfNQm81JM0E4m5SU1pkU8z41FPYWcGrhro2IlYsZGWRQB6jPdntVJEFm
    2023-04-12T09:46:00.574Z DEBUG modem >> Q4OAGDfmzZ/9HtP0jXWWGRGrAZBe7Yw9M+faraQ/e4OrBWPfTxzx/YMP
    2023-04-12T09:46:00.590Z DEBUG modem >> -----END RSA PRIVATE KEY-----"
    2023-04-12T09:46:00.695Z DEBUG modem << OK
    2023-04-12T09:46:00.697Z INFO Certificate update completed
    2023-04-12T09:46:04.564Z DEBUG modem >> AT%CMNG=1
    2023-04-12T09:46:04.689Z DEBUG modem << %CMNG: 0,6,"0606060606060606060606060606060606060606060606060606060606060606"
    2023-04-12T09:46:04.696Z DEBUG modem << %CMNG: 11110,0,"E3B86EEED2482A7467DA78CB4061C918B46800DD2E5842B1B836582CC770EA10"
    2023-04-12T09:46:04.703Z DEBUG modem << %CMNG: 11111,0,"F45CB4608E84647DBA391BD1282A7202515631AC030C199E185FE3121E22D565"
    2023-04-12T09:46:04.711Z DEBUG modem << %CMNG: 11112,0,"2407FA14E1701A5EAEB1B6B805AF8010258E525371A08E6D6B37C9CCDDEB565A"
    2023-04-12T09:46:04.741Z DEBUG modem << %CMNG: 41183,0,"A86D8BF8D75130765A6453960E0E4E5158E0F3E43F86699EFE36190C463A25CF"
    2023-04-12T09:46:04.746Z DEBUG modem << %CMNG: 41183,1,"20AD1522C1DEEBAFEE2A9905563CB949C150084354A49AEA7D210BD3E5B1E376"
    2023-04-12T09:46:04.750Z DEBUG modem << %CMNG: 41183,2,"96B453EA5E04C43EBE228CCB8C02371E0844751CF100BBF09CFAC3BB5999F01B"
    2023-04-12T09:46:04.766Z DEBUG modem << %CMNG: 16842753,0,"E3B86EEED2482A7467DA78CB4061C918B46800DD2E5842B1B836582CC770EA10"
    2023-04-12T09:46:04.771Z DEBUG modem << %CMNG: 16842753,1,"CE15047C626504AB0E4361772D94B46178414EE5B48F9A343EBD10ABDA99F7B7"
    2023-04-12T09:46:04.774Z DEBUG modem << %CMNG: 16842753,2,"B20F522881DA3EA120656ED9E62F377AB2C25A2C1D0F0E150D954FD68D6D32AC"
    2023-04-12T09:46:04.788Z DEBUG modem << %CMNG: 98166592,0,"2C43952EE9E000FF2ACC4E2ED0897C0A72AD5FA72C3D934E81741CBD54F05BD1"
    2023-04-12T09:46:04.791Z DEBUG modem << %CMNG: 98166592,1,"FE5F2A104CDE71CD50E1BA82BC4578B3911148C1D735F18DEA218A0C4836402D"
    2023-04-12T09:46:04.796Z DEBUG modem << %CMNG: 98166592,2,"55AFA48A09CB8361EEE28FEB41811089AF9239D36FFA00A83A305F64763C197C"
    2023-04-12T09:46:04.799Z DEBUG modem << %CMNG: 4294967293,10,"AEE95320E708D6D7F900870D5908C659243E5CF5253996F0E463D6F10FC680C0"
    2023-04-12T09:46:04.802Z DEBUG modem << %CMNG: 4294967294,6,"0ECB9573626C5A788B5825B38C14E1A2649B52A56A0E3D6E53A056C83FE418EA"
    2023-04-12T09:46:04.804Z DEBUG modem << %CMNG: 4294967292,11,"B2C46C2AE7C81943A8BD6DD4ED2A50B659A225A098A177BACB575459CD57CAEF"
    2023-04-12T09:46:04.807Z DEBUG modem << OK
    
    manually loading certs
    
    2023-04-12T09:46:51.197Z DEBUG modem >> AT%CMNG=0,22220,0,"-----BEGIN CERTIFICATE----- MIIEAzCCAuugAwIBAgIUBY1hlCGvdj4NhBXkZ/uLUZNILAwwDQYJKoZIhvcNAQEL BQAwgZAxCzAJBgNVBAYTAkdCMRcwFQYDVQQIDA5Vbml0ZWQgS2luZ2RvbTEOMAwG A1UEBwwFRGVyYnkxEjAQBgNVBAoMCU1vc3F1aXR0bzELMAkGA1UECwwCQ0ExFjAU .............................................................................................................+pp58nfPAYwuerruPNWmlStWAXf0UTqRtg4hQDWBuUFDJTuWuuBvEXudz74eh/wK sMwfu1HFvjy5Z0iMDU8PUDepjVolOCue9ashlS4EB5IECdSR2TItnAIiIwimx839 LdUdRudafMu5T5Xma182OC0/u/xRlEm+tvKGGmfFcN0piqVl8OrSPBgIlb+1IKJE m/XriWr/Cq4h/JfB7NTsezVslgkBaoU= -----END CERTIFICATE-----"
    2023-04-12T09:46:51.455Z DEBUG modem << OK
    2023-04-12T09:46:54.190Z DEBUG modem >> AT%CMNG=1
    2023-04-12T09:46:54.317Z DEBUG modem << %CMNG: 0,6,"0606060606060606060606060606060606060606060606060606060606060606"
    2023-04-12T09:46:54.324Z DEBUG modem << %CMNG: 11110,0,"E3B86EEED2482A7467DA78CB4061C918B46800DD2E5842B1B836582CC770EA10"  <<<<<< same cert certificate manager
    2023-04-12T09:46:54.383Z DEBUG modem << %CMNG: 11111,0,"F45CB4608E84647DBA391BD1282A7202515631AC030C199E185FE3121E22D565"
    2023-04-12T09:46:54.388Z DEBUG modem << %CMNG: 11112,0,"2407FA14E1701A5EAEB1B6B805AF8010258E525371A08E6D6B37C9CCDDEB565A"
    2023-04-12T09:46:54.393Z DEBUG modem << %CMNG: 22220,0,"A7B0933374B87D07EA6B1E530C538B729F02226889C9405379A4FA9EA9471AC1"  <<<<<< same cert via at command manually
    2023-04-12T09:46:54.397Z DEBUG modem << %CMNG: 41183,0,"A86D8BF8D75130765A6453960E0E4E5158E0F3E43F86699EFE36190C463A25CF"
    2023-04-12T09:46:54.400Z DEBUG modem << %CMNG: 41183,1,"20AD1522C1DEEBAFEE2A9905563CB949C150084354A49AEA7D210BD3E5B1E376"
    2023-04-12T09:46:54.404Z DEBUG modem << %CMNG: 41183,2,"96B453EA5E04C43EBE228CCB8C02371E0844751CF100BBF09CFAC3BB5999F01B"
    2023-04-12T09:46:54.408Z DEBUG modem << %CMNG: 16842753,0,"E3B86EEED2482A7467DA78CB4061C918B46800DD2E5842B1B836582CC770EA10"
    2023-04-12T09:46:54.440Z DEBUG modem << %CMNG: 16842753,1,"CE15047C626504AB0E4361772D94B46178414EE5B48F9A343EBD10ABDA99F7B7"
    2023-04-12T09:46:54.445Z DEBUG modem << %CMNG: 16842753,2,"B20F522881DA3EA120656ED9E62F377AB2C25A2C1D0F0E150D954FD68D6D32AC"
    2023-04-12T09:46:54.448Z DEBUG modem << %CMNG: 98166592,0,"2C43952EE9E000FF2ACC4E2ED0897C0A72AD5FA72C3D934E81741CBD54F05BD1"
    2023-04-12T09:46:54.452Z DEBUG modem << %CMNG: 98166592,1,"FE5F2A104CDE71CD50E1BA82BC4578B3911148C1D735F18DEA218A0C4836402D"
    2023-04-12T09:46:54.468Z DEBUG modem << %CMNG: 98166592,2,"55AFA48A09CB8361EEE28FEB41811089AF9239D36FFA00A83A305F64763C197C"
    2023-04-12T09:46:54.474Z DEBUG modem << %CMNG: 4294967293,10,"AEE95320E708D6D7F900870D5908C659243E5CF5253996F0E463D6F10FC680C0"
    2023-04-12T09:46:54.477Z DEBUG modem << %CMNG: 4294967294,6,"0ECB9573626C5A788B5825B38C14E1A2649B52A56A0E3D6E53A056C83FE418EA"
    2023-04-12T09:46:54.478Z DEBUG modem << %CMNG: 4294967292,11,"B2C46C2AE7C81943A8BD6DD4ED2A50B659A225A098A177BACB575459CD57CAEF"
    2023-04-12T09:46:54.482Z DEBUG modem << OK
    .
    .
    .
    >connecting 9160 to cell network all goes ok
    .
    .
    .
    2023-04-12T09:50:05.949Z DEBUG modem >> AT+CFUN=1
    2023-04-12T09:50:06.013Z DEBUG modem << OK
    2023-04-12T09:50:06.905Z DEBUG modem >> AT+CFUN?
    2023-04-12T09:50:06.994Z DEBUG modem << +CFUN: 1
    2023-04-12T09:50:07.000Z DEBUG modem << OK
    .
    .
    .
    >Once cell is connected, connected to mqtt , all goes ok, sent 4000 charaters OK!  :) :) :)    So happy when this worked :)
    .
    .
    .
    2023-04-12T09:50:12.476Z DEBUG modem >> AT#XMQTTCON=1,"trentisalegend","","","test.mosquitto.org",8883,1111
    2023-04-12T09:50:13.478Z ERROR Error: 'AT#XMQTTCON=1,"trentisalegend","","","test.mosquitto.org",8883,1111
    ' timed out
    2023-04-12T09:50:14.668Z DEBUG modem << OK
    2023-04-12T09:50:15.013Z DEBUG modem << #XMQTTEVT: 0,0
    2023-04-12T09:50:15.951Z DEBUG modem >> AT#XMQTTSUB="nrf91/slm/mqtt/topic0",0
    2023-04-12T09:50:16.066Z DEBUG modem << OK
    2023-04-12T09:50:16.510Z DEBUG modem << #XMQTTEVT: 7,0
    2023-04-12T09:50:23.633Z DEBUG modem << #XMQTTMSG: 21,11
    2023-04-12T09:50:23.683Z DEBUG modem << nrf91/slm/mqtt/topic0
    2023-04-12T09:50:23.685Z DEBUG modem << adsfasddsaf
    2023-04-12T09:50:23.686Z DEBUG modem << #XMQTTEVT: 2,0
    2023-04-12T09:50:38.939Z DEBUG modem << #XMQTTMSG: 21,4000
    2023-04-12T09:50:38.989Z DEBUG modem << nrf91/slm/mqtt/topic0
    2023-04-12T09:50:39.296Z DEBUG modem << Lort eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In dui magna, posuere eget, vestibulum et, tempor auctor, justo. In ac felis quis tortor malesuada pretium. Pellentesque auctor neque nec urna. Proin sapien ipsum, porta a, auctor quis, euismod ut, mi. Aenean viverra rhoncus pede. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut non enim eleifend felis pretium feugiat. Vivamus quis mi. Phasellus a est. Phaser ipsum rutrum nunc. Nunc nonummy metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede. Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor. Maecenas vestibulum mollis diam. Pellentesque ut neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In dui magna, posuere eget, vestibulum et, tempor auctor, justo. In ac felis quis tortor malesuada pretium. Pellentesque auctor neque nec urna. Proin sapien ipsum, porta a, auctor quis, euismod ut, mi. Aenean viverra rhoncus pede. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut non enim eleifend felis pretium feugiat. Vivamus quis mi. Phasellus a est. Phas
    2023-04-12T09:50:39.345Z DEBUG modem << #XMQTTEVT: 2,0
    2023-04-12T09:50:40.347Z DEBUG modem << %CESQ: 31,1,9,1
    
    
    >if trying to connect on 8884 it fails
    
    OK
    2023-04-12T10:01:10.435Z DEBUG modem >> AT#XMQTTCON=1,"trentisalegend","","","test.mosquitto.org",8884,1111
    2023-04-12T10:01:11.437Z ERROR Error: 'AT#XMQTTCON=1,"trentisalegend","","","test.mosquitto.org",8884,1111
    ' timed out
    2023-04-12T10:01:12.988Z DEBUG modem << ERROR
    2023-04-12T10:01:13.061Z DEBUG modem << %CESQ: 34,1,13,1
    2023-04-12T10:01:17.206Z DEBUG modem << %CESQ: 30,1,8,1

  • Hi Trent,

    I cannot find ticket 299981. According to your description, yes, the line ending is the cause of the issue and it is not easy to manage it for certificate writing by hand.

    You need either use CERTIFICATE MANAGER in LTE Link Monitor or some script like introduced in (+) Automating nRF91 TLS credential management via serial port AT commands - Software and Protocols - Cellular IoT guides - Nordic DevZone (nordicsemi.com).

    Best regards,

    Charlie

  • Hi Charlie,

    i got it to work, using the following commands to load certs

    AT#XCMNG=0,1111,0,"<CA cert>   

    AT#XCMNG=0,1111,1,"<cert>   

    AT#XCMNG=0,1111,2,"<private key>   

    the key is to not use LTE Link Monitor, as the issues is how the LF  /   CR LF's are handled.  

    I was advised to use Teraterm, making sure to set the new line transmit value to CR+LF   That way the LF within the Cert that AWS generates is replaced correctly.   

    I had previously tried adding the CR manually to each line in notepad++ but it doesn't appear to have the same effect.  

    if anyone gets stuck on this, please sing out. 

    again Charlie, thanks heaps for your help , it's appreciated!

    cheers

    Trent

Reply
  • Hi Charlie,

    i got it to work, using the following commands to load certs

    AT#XCMNG=0,1111,0,"<CA cert>   

    AT#XCMNG=0,1111,1,"<cert>   

    AT#XCMNG=0,1111,2,"<private key>   

    the key is to not use LTE Link Monitor, as the issues is how the LF  /   CR LF's are handled.  

    I was advised to use Teraterm, making sure to set the new line transmit value to CR+LF   That way the LF within the Cert that AWS generates is replaced correctly.   

    I had previously tried adding the CR manually to each line in notepad++ but it doesn't appear to have the same effect.  

    if anyone gets stuck on this, please sing out. 

    again Charlie, thanks heaps for your help , it's appreciated!

    cheers

    Trent

Children
No Data
Related