This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Why does certificate provision take 10 minutes to complete?

Hello,

I have loaded the https_client sample to my nRF9160 DK, and when it runs, it blocks after printing "Provisioning certificate" for 10 minutes exactly. That would mean that the function "modem_key_mgmt_write" runs awefully slow. Why is that? Is there a way it could be sped up? I have not seen this problem reported recently by other users, which makes me wonder if I am doing something wrong.

I have updated my repository to the latest version and also updated the modem's firmware to the latest release.

The reason I am testing this sample is because I need connectivity with a https server and I guess I would need TLS for that. I have also read that even if I don't want to verify my certificate, I do have to load it and therefore use the function cert_provision(). Could you please correct me if I have made some wrong assumptions?

Thanks,

Aleix.

Parents
  • Hi Aleix,

    Which NCS tag are you using? and which mfw are you running?

    Could you share the full Serial output log as well?

    Please also say which SIM card you are using and network.

    Have you confirmed that you actually have gotten a connection with the network in your area?

    (It should not take 10mins for this, so this has to be something else.)

  • Hi Martin,

    Which NCS tag are you using? and which mfw are you running?

    I don't know how to tell you exactly on which tag am I. I did not update to a tag but to the most recent version of the master branch. The mfw is the 1.2.1.

    Could you share the full Serial output log as well?

    2020-09-17T09:02:30.504Z DEBUG modem << *** Booting Zephyr OS build v2.3.0-rc1-ncs1-2408-g332206bcad13  ***
    2020-09-17T09:02:30.506Z DEBUG modem << HTTPS client sample started
    2020-09-17T09:02:30.508Z DEBUG modem << Will try to send POST /mb/api/loadsensing/12345/write HTTP/1.1
    2020-09-17T09:02:30.512Z DEBUG modem << Host: senix-pws.worldsensing.com
    2020-09-17T09:02:30.513Z DEBUG modem << Content-Type: application/json
    2020-09-17T09:02:30.515Z DEBUG modem << Content-Length: 195
    2020-09-17T09:02:30.516Z DEBUG modem << {
    2020-09-17T09:02:30.518Z DEBUG modem << "nodeModel":  "NB-SENIX",
    2020-09-17T09:02:30.523Z DEBUG modem << "nodeId":  12345,
    2020-09-17T09:02:30.524Z DEBUG modem << "readings":  [{
    2020-09-17T09:02:30.525Z DEBUG modem << "channel":  0,
    2020-09-17T09:02:30.526Z DEBUG modem << "readingData":  246
    2020-09-17T09:02:30.527Z DEBUG modem << }, {
    2020-09-17T09:02:30.528Z DEBUG modem << "channel":  1,
    2020-09-17T09:02:30.529Z DEBUG modem << "readingData":  973
    2020-09-17T09:02:30.529Z DEBUG modem << }],
    2020-09-17T09:02:30.559Z DEBUG modem << "readTimestamp":  "2020-09-01T15:55:53Z"
    2020-09-17T09:02:30.561Z DEBUG modem << }
    2020-09-17T09:02:30.563Z DEBUG modem << Size of body 197
    2020-09-17T09:02:30.755Z DEBUG modem << Provisioning certificate
    2020-09-17T09:12:39.681Z DEBUG modem << Waiting for network.. OK
    2020-09-17T09:12:40.053Z DEBUG modem << Connecting to senix-pws.worldsensing.com
    2020-09-17T09:12:45.103Z DEBUG modem << Sent 334 bytes
    2020-09-17T09:12:46.631Z DEBUG modem << Received 1092 bytes
    2020-09-17T09:12:46.700Z DEBUG modem << > HTTP/1.1 200 OK

    Please also say which SIM card you are using and network.

    I am using a Movistar SIM card using NB-IoT.

    Have you confirmed that you actually have gotten a connection with the network in your area?

    Yes, as you can see in the log, there is a succesful connection to the server.

    I would think that the code starts firstly with LTE-M and that when 10 minutes has passed without a successful connection, it switches to NB-IoT. But in the code, the connection to the network takes place afterwards, and I should see on the logs the message "Waiting connection" right? Unless... yeah I might have got it now that I think about it.

    What I think may be happening is that the printk does not show on the nRF Connect LTE Link Monitor until it does a carriage return (\n). And for this reason it does not show the "Waiting connection" message until it finally connects to the network and printing "OK\n".

    This could be it, I will test it.

    Thanks!

    Aleix.

  • Hi Aleix,
    If you are going to connect on NB-IoT you should state that in the projects configurations file to avoid waiting for the 10min fallback from LTE-M. 

    Set this in your project prj.conf file:

    CONFIG_LTE_NETWORK_MODE_NBIOT=y
    CONFIG_LTE_LEGACY_PCO_MODE=y

    Last line is maybe not needed if your network supports ePCO, so you could try to run without the last config in your first test to see.


    Best regards,

    Martin L.

Reply
  • Hi Aleix,
    If you are going to connect on NB-IoT you should state that in the projects configurations file to avoid waiting for the 10min fallback from LTE-M. 

    Set this in your project prj.conf file:

    CONFIG_LTE_NETWORK_MODE_NBIOT=y
    CONFIG_LTE_LEGACY_PCO_MODE=y

    Last line is maybe not needed if your network supports ePCO, so you could try to run without the last config in your first test to see.


    Best regards,

    Martin L.

Children
No Data
Related