Hello,
When CONFIG_PROVISION_CERTIFICATES is y and certificates are defined in certificates.h the program fails in provision_certificates() function, the modem_key_mgmt_delete function never returns.
Version is master from this morning.
Hello,
When CONFIG_PROVISION_CERTIFICATES is y and certificates are defined in certificates.h the program fails in provision_certificates() function, the modem_key_mgmt_delete function never returns.
Version is master from this morning.
it loops at err = at_cmd_write("AT+CMEE?", response, sizeof(response), NULL); in cmee_active() function
Hello,
Do someone at Nordic could help me please ? It's easy to replay on nRF9160 DK.
Hello,
Sorry for the late reply.
Fabien Comte said:I moved modem_configure(); before provision_certificates(); to fix the problem. Please if you code options, test them...
Were the certificates correctly written? Did this work before you updated to latest master branch?
Kind regards,
Øyvind
Hello,
No I have issues. Could you test it please ?
What error does it return?
Have you configured certificates.h correctly? I assume you are trying to connect AWS. Please make sure to use correct certificates downloaded from Amazon:
<number>-certificate.pem.crt
<number>-private.pem.key
<number>-public.pem.key
In certificates.h, make sure that each certificate is formatted correctly. Adding AWS Root CA as an example:
#define CLOUD_CA_CERTIFICATE \ "-----BEGIN CERTIFICATE-----\n" \ "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n"\ "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n"\ "b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n"\ "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n"\ "b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n"\ "ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n"\ "9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n"\ "IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n"\ "VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n"\ "93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n"\ "jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n"\ "AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n"\ "A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n"\ "U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n"\ "N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n"\ "o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n"\ "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n"\ "rqXRfboQnoZsG4q5WTP468SQvvG5\n"\ "-----END CERTIFICATE-----\n"
Kind regards,
Øyvind
I do not have a clean fix. Do you check it on your side (easy to do) please ?
Fabien Comte said:I had to move modem_configure() before but lte_lc_init_and_connect() after.
I'm sorry, but this isn't really helping me help you.
Can you provide some more information on what is actually failing? Can you provide output from the LTE Link Monitor or similar?
modem_configure() calls lte_lc_ini_and_connect() inside itself:
/**@brief Configures modem to provide LTE link. Blocks until link is * successfully established. */ static void modem_configure(void) { #if defined(CONFIG_LTE_LINK_CONTROL) if (IS_ENABLED(CONFIG_LTE_AUTO_INIT_AND_CONNECT)) { /* Do nothing, modem is already turned on * and connected. */ } else { #if defined(CONFIG_LWM2M_CARRIER) /* Wait for the LWM2M_CARRIER to configure the modem and * start the connection. */ printk("Waitng for carrier registration...\n"); k_sem_take(&carrier_registered, K_FOREVER); printk("Registered!\n"); #else /* defined(CONFIG_LWM2M_CARRIER) */ int err; printk("LTE Link Connecting ...\n"); err = lte_lc_init_and_connect(); __ASSERT(err == 0, "LTE link could not be established."); printk("LTE Link Connected!\n"); #endif /* defined(CONFIG_LWM2M_CARRIER) */ } #endif /* defined(CONFIG_LTE_LINK_CONTROL) */ }
Fabien Comte said:No I have issues. Could you test it please ?
What are the issues you are seeing?
Fabien Comte said:I had to move modem_configure() before but lte_lc_init_and_connect() after.
I'm sorry, but this isn't really helping me help you.
Can you provide some more information on what is actually failing? Can you provide output from the LTE Link Monitor or similar?
modem_configure() calls lte_lc_ini_and_connect() inside itself:
/**@brief Configures modem to provide LTE link. Blocks until link is * successfully established. */ static void modem_configure(void) { #if defined(CONFIG_LTE_LINK_CONTROL) if (IS_ENABLED(CONFIG_LTE_AUTO_INIT_AND_CONNECT)) { /* Do nothing, modem is already turned on * and connected. */ } else { #if defined(CONFIG_LWM2M_CARRIER) /* Wait for the LWM2M_CARRIER to configure the modem and * start the connection. */ printk("Waitng for carrier registration...\n"); k_sem_take(&carrier_registered, K_FOREVER); printk("Registered!\n"); #else /* defined(CONFIG_LWM2M_CARRIER) */ int err; printk("LTE Link Connecting ...\n"); err = lte_lc_init_and_connect(); __ASSERT(err == 0, "LTE link could not be established."); printk("LTE Link Connected!\n"); #endif /* defined(CONFIG_LWM2M_CARRIER) */ } #endif /* defined(CONFIG_LTE_LINK_CONTROL) */ }
Fabien Comte said:No I have issues. Could you test it please ?
What are the issues you are seeing?
My issues are, often lte_lc_init_and_connect() never returns.
Your modem_configure() function is different vs the one in aws_fota sample...
Please do a test with aws_fota sample. Only set your broker, certificates and set CONFIG_PROVISION_CERTIFICATES
This is the actual modem_configure() code.
static void modem_configure(void) { #if defined(CONFIG_LTE_LINK_CONTROL) BUILD_ASSERT_MSG(!IS_ENABLED(CONFIG_LTE_AUTO_INIT_AND_CONNECT), "This sample does not support auto init and connect"); int err; err = at_notif_init(); __ASSERT(err == 0, "AT Notify could not be initialized."); err = at_cmd_init(); __ASSERT(err == 0, "AT CMD could not be established."); printk("LTE Link Connecting ...\n"); err = lte_lc_init_and_connect(); __ASSERT(err == 0, "LTE link could not be established."); printk("LTE Link Connected!\n"); #endif }
Fabien Comte said:This is the actual modem_configure() code.
Yes, I'm sorry, I used the modem_configure() from another sample. But still, it shows that lte_lc_init_and_connect() is called within it.
Fabien Comte said:Please do a test with aws_fota sample. Only set your broker, certificates and set CONFIG_PROVISION_CERTIFICATES
I can run it, but can you please run the example first and provide the output from the LTE Link Monitor? I need more information to know what I'm looking for, and if there is anything else failing.
When CONFIG_PROVISION_CERTIFICATES is y and certificates are defined in certificates.h the program fails in provision_certificates() function, the modem_key_mgmt_delete function never returns.
Your initial issue was that modem_key_mgmt_delete() never returns, and now it's lte_lc_init_and_connect(). And with the fact that you have modified the sample, it is difficult for me to know what it the problem.
Let's start fresh:
Thank you.
-Øyvind