Exploring Connectivity Options for AWS IoT: Do We Need IoT SIM Cards?

Hi,

      I am currently working with the nRF9160DK board, using SDK version 2.5.1, and I have encountered an issue regarding connectivity to the AWS IoT cloud.

I have successfully connected my board to MQTT and have been able to publish and subscribe to topics using a regular SIM card with a data pack,so I confirmed that internet connection is done. However, when attempting to connect to AWS IoT using the same SIM card in the provided sample code, I am experiencing connectivity issues.

I have ensured that I configured all necessary parameters in the sample code given, including:

  • CONFIG_AWS_IOT_BROKER_HOST_NAME
  • CONFIG_MQTT_HELPER_SEC_TAG
  • CONFIG_AWS_IOT_CLIENT_ID_STATIC

Despite this, I am not receiving the expected output,
After flashing the sample, we can receive those two lines in the image. I'm not getting the remaining lines.


and I'm uncertain whether the SIM card compatibility could be a factor, or if there might be an issue with my code implementation.

Could you please provide guidance on whether an IoT-specific SIM card (LTE-M or NB-IoT) is required for connecting to AWS IoT? Additionally, I would appreciate any insights or troubleshooting tips you may have regarding this connectivity issue.

Thank you in advance for your assistance.

  • Hi,

    In order to check if there is a problem with your SIM card, you could try to program at_client sample and execute the following AT commands: %XSYSTEMMODE, +CFUN, %XSIM, +CEREG, %MDMEV, +CIMI, %XICCID and +CNUM.
    For more information about AT commands, you can follow the link nrf9160 AT Command Reference Guide.

    Best regards,
    Dejan

  • Hi,

    I appreciate your guidance on using the AT_client sample and running specific AT commands to diagnose any potential SIM card issues on the NRF9160DK board. However, I have a query regarding the suspicion of a SIM card issue, especially considering that the NRF multiservice code and asset tracking code are connecting without apparent issues.

    Attached below log , you'll find the outputs of the AT commands you've recommended execpt +CNUM: %XSYSTEMMODE, +CFUN, %XSIM, +CEREG, %MDMEV, +CIMI, and %XICCID. I would appreciate it if you could review these outputs and verify if there are any anomalies or issues that might indicate a problem with the SIM card or modem functionality.

    07:13:00.531	Error: 'AT+CFUN=4 ' timed out
    07:13:51.967	Error: AT%XSYSTEMMODE failed: phone failure
    07:14:28.151	Error: AT%XSYSTEMMODE=1 failed: phone failure
    AT%XSIM?%XSIM: 1
    OK
    
    2024-04-16T13:28:22.748Z DEBUG modem >> AT%XSYSTEMMODE?
    2024-04-16T13:28:22.786Z DEBUG modem << %XSYSTEMMODE: 1,0,1,0
    2024-04-16T13:28:22.789Z DEBUG modem << OK
    
    
    2024-04-16T12:54:30.607Z DEBUG modem >> AT%XSIM=1
    2024-04-16T12:54:30.633Z DEBUG modem << OK
    2024-04-16T12:54:30.643Z DEBUG modem >> AT%XSIM?
    2024-04-16T12:54:30.661Z DEBUG modem << %XSIM: 1
    2024-04-16T12:54:30.665Z DEBUG modem << OK
    2024-04-16T12:54:30.673Z DEBUG modem >> AT+CPIN?
    2024-04-16T12:54:30.692Z DEBUG modem << +CPIN: READY
    2024-04-16T12:54:30.696Z DEBUG modem << OK
    2024-04-16T12:54:30.707Z DEBUG modem >> AT+CPINR="SIM PIN"
    2024-04-16T12:54:30.742Z DEBUG modem << +CPINR: "SIM PIN",3
    2024-04-16T12:54:30.747Z DEBUG modem << OK
    2024-04-16T12:54:30.755Z DEBUG modem >> AT+CIMI
    2024-04-16T12:54:30.780Z DEBUG modem << 310170424406460
    2024-04-16T12:54:30.783Z DEBUG modem << OK
    2024-04-16T12:54:30.786Z INFO IMSIdentity: 310170424406460
    2024-04-16T12:54:43.223Z DEBUG modem >> AT+CFUN=21
    2024-04-16T12:54:43.253Z DEBUG modem << OK
    2024-04-16T12:56:33.575Z DEBUG modem >> AT%XSIM=1
    2024-04-16T12:56:33.606Z DEBUG modem << OK
    2024-04-16T12:57:33.966Z DEBUG modem >> AT%XSIM?
    2024-04-16T12:57:34.018Z DEBUG modem << %XSIM: 1
    2024-04-16T12:57:34.034Z DEBUG modem << OK
    2024-04-16T12:57:34.055Z DEBUG modem >> AT+CPIN?
    2024-04-16T12:57:34.078Z DEBUG modem << +CPIN: READY
    2024-04-16T12:57:34.085Z DEBUG modem << OK
    2024-04-16T12:57:34.104Z DEBUG modem >> AT+CPINR="SIM PIN"
    2024-04-16T12:57:34.141Z DEBUG modem << +CPINR: "SIM PIN",3
    2024-04-16T12:57:34.147Z DEBUG modem << OK
    2024-04-16T12:57:34.176Z DEBUG modem >> AT+CIMI
    2024-04-16T12:57:34.208Z DEBUG modem << 310170424406460
    2024-04-16T12:57:34.216Z DEBUG modem << OK
    2024-04-16T12:57:34.220Z INFO IMSIdentity: 310170424406460
    
    
    2024-04-16T13:35:38.446Z DEBUG modem >> AT+CFUN?
    2024-04-16T13:35:38.484Z DEBUG modem << +CFUN: 1
    2024-04-16T13:35:38.498Z DEBUG modem << OK
    2024-04-16T13:35:38.534Z DEBUG modem >> AT+CGSN=1
    2024-04-16T13:35:38.590Z DEBUG modem << +CGSN: "351516172687873"
    2024-04-16T13:35:38.594Z DEBUG modem << OK
    2024-04-16T13:35:38.616Z DEBUG modem >> AT+CGMI
    2024-04-16T13:35:38.639Z DEBUG modem << Nordic Semiconductor ASA
    2024-04-16T13:35:38.642Z DEBUG modem << OK
    2024-04-16T13:35:38.672Z DEBUG modem >> AT+CGMM
    2024-04-16T13:35:38.720Z DEBUG modem << nRF9160-SICA
    2024-04-16T13:35:38.724Z DEBUG modem << OK
    2024-04-16T13:35:38.727Z DEBUG modem >> AT+CGMR
    2024-04-16T13:35:38.760Z DEBUG modem << mfw_nrf9160_1.3.6
    2024-04-16T13:35:38.764Z DEBUG modem << OK
    2024-04-16T13:35:38.768Z INFO Nordic Semiconductor ASA nRF9160-SICA [mfw_nrf9160_1.3.6] SerNr: 351516172687873
    2024-04-16T13:35:38.769Z DEBUG modem >> AT+CEMODE?
    2024-04-16T13:35:38.793Z DEBUG modem << +CEMODE: 2
    2024-04-16T13:35:38.797Z DEBUG modem << OK
    2024-04-16T13:35:38.806Z DEBUG modem >> AT%XCBAND=?
    2024-04-16T13:35:38.836Z DEBUG modem << %XCBAND: (1,2,3,4,5,8,12,13,18,19,20,25,26,28,66)
    2024-04-16T13:35:38.842Z DEBUG modem << OK
    2024-04-16T13:35:38.852Z DEBUG modem >> AT+CMEE?
    2024-04-16T13:35:38.884Z DEBUG modem << +CMEE: 1
    2024-04-16T13:35:38.889Z DEBUG modem << OK
    2024-04-16T13:35:38.893Z DEBUG modem >> AT+CNEC?
    2024-04-16T13:35:38.918Z DEBUG modem << +CNEC: 24
    2024-04-16T13:35:38.922Z DEBUG modem << OK
    2024-04-16T13:35:38.951Z DEBUG modem >> AT+CGEREP?
    2024-04-16T13:35:38.992Z DEBUG modem << +CGEREP: 1,0
    2024-04-16T13:35:38.998Z DEBUG modem << OK
    2024-04-16T13:35:39.005Z DEBUG modem >> AT+CIND=1,1,1
    2024-04-16T13:35:39.041Z DEBUG modem << OK
    2024-04-16T13:35:39.046Z DEBUG modem >> AT+CEREG=5
    2024-04-16T13:35:39.073Z DEBUG modem << OK
    2024-04-16T13:35:39.077Z DEBUG modem >> AT+CEREG?
    2024-04-16T13:35:39.112Z DEBUG modem << +CEREG: 5,1,"4006","034A1710",7,,,"11100000","11100000"
    2024-04-16T13:35:39.118Z DEBUG modem << OK
    2024-04-16T13:35:39.146Z DEBUG modem >> AT+COPS=3,2
    2024-04-16T13:35:39.196Z DEBUG modem << OK
    2024-04-16T13:35:39.228Z DEBUG modem >> AT+COPS?
    2024-04-16T13:35:39.268Z DEBUG modem << +COPS: 0,2,"310410",7
    2024-04-16T13:35:39.275Z DEBUG modem << OK
    2024-04-16T13:35:39.305Z DEBUG modem >> AT%XCBAND
    2024-04-16T13:35:39.329Z DEBUG modem << %XCBAND: 12
    2024-04-16T13:35:39.332Z DEBUG modem << OK
    2024-04-16T13:35:39.362Z DEBUG modem >> AT+CGDCONT?
    2024-04-16T13:35:39.402Z DEBUG modem << +CGDCONT: 0,"IP","m2m.com.attz","10.163.59.3",0,0
    2024-04-16T13:35:39.409Z DEBUG modem << OK
    2024-04-16T13:35:39.421Z DEBUG modem >> AT+CGACT?
    2024-04-16T13:35:39.450Z DEBUG modem << +CGACT: 0,1
    2024-04-16T13:35:39.454Z DEBUG modem << OK
    2024-04-16T13:35:39.483Z DEBUG modem >> AT%CESQ=1
    2024-04-16T13:35:39.512Z DEBUG modem << OK
    2024-04-16T13:35:39.547Z DEBUG modem >> AT+CESQ
    2024-04-16T13:35:39.583Z DEBUG modem << +CESQ: 99,99,255,255,21,65
    2024-04-16T13:35:39.590Z DEBUG modem << OK
    2024-04-16T13:35:39.621Z DEBUG modem >> AT%XSIM=1
    2024-04-16T13:35:39.657Z DEBUG modem << OK
    2024-04-16T13:35:39.682Z DEBUG modem >> AT%XSIM?
    2024-04-16T13:35:39.719Z DEBUG modem << %XSIM: 1
    2024-04-16T13:35:39.727Z DEBUG modem << OK
    2024-04-16T13:35:39.740Z DEBUG modem >> AT+CPIN?
    2024-04-16T13:35:39.766Z DEBUG modem << +CPIN: READY
    2024-04-16T13:35:39.771Z DEBUG modem << OK
    2024-04-16T13:35:39.798Z DEBUG modem >> AT+CPINR="SIM PIN"
    2024-04-16T13:35:39.835Z DEBUG modem << +CPINR: "SIM PIN",3
    2024-04-16T13:35:39.842Z DEBUG modem << OK
    2024-04-16T13:35:39.874Z DEBUG modem >> AT+CIMI
    2024-04-16T13:35:39.917Z DEBUG modem << 310170424406460
    2024-04-16T13:35:39.921Z DEBUG modem << OK
    2024-04-16T13:35:39.925Z INFO IMSIdentity: 310170424406460
    
    
    
    2024-04-16T13:03:16.668Z DEBUG modem >> AT+CEREG?
    2024-04-16T13:03:16.706Z DEBUG modem << +CEREG: 5,1,"4006","034A1710",7,,,"11100000","11100000"
    2024-04-16T13:03:16.725Z DEBUG modem << OK
    2024-04-16T13:03:16.728Z DEBUG modem >> AT+COPS=3,2
    2024-04-16T13:03:16.753Z DEBUG modem << OK
    2024-04-16T13:03:16.759Z DEBUG modem >> AT+COPS?
    2024-04-16T13:03:16.791Z DEBUG modem << +COPS: 0,2,"310410",7
    2024-04-16T13:03:16.797Z DEBUG modem << OK
    2024-04-16T13:03:16.827Z DEBUG modem >> AT%XCBAND
    2024-04-16T13:03:16.849Z DEBUG modem << %XCBAND: 12
    2024-04-16T13:03:16.854Z DEBUG modem << OK
    2024-04-16T13:03:16.865Z DEBUG modem >> AT+CGDCONT?
    2024-04-16T13:03:16.893Z DEBUG modem << +CGDCONT: 0,"IP","m2m.com.attz","10.180.114.132",0,0
    2024-04-16T13:03:16.899Z DEBUG modem << OK
    2024-04-16T13:03:16.928Z DEBUG modem >> AT+CGACT?
    2024-04-16T13:03:16.952Z DEBUG modem << +CGACT: 0,1
    2024-04-16T13:03:16.957Z DEBUG modem << OK
    
    AT%MDMEV=1
    OK
    
    
    2024-04-16T14:56:11.902Z DEBUG modem >> AT%XICCID=890117124244064608
    2024-04-16T14:56:11.938Z DEBUG modem << %XICCID: 89011712274244064608
    2024-04-16T14:56:11.942Z DEBUG modem << OK

    Your expertise in this matter is invaluable, and I look forward to your insights and guidance on how to proceed further.

    Thank you for your attention to this matter.

  • Hi,

    Thank you for providing additional information.

    Regarding modem traces, you could try to enable modem tracing using snippets. Snippets can be used with west like this:

    west build -p -b nrf9160dk_nrf9160_ns -S nrf91-modem-trace-uart



    Best regards,
    Dejan


  • Hi ,
          

    I'm currently facing some challenges with West build, but I recently came across AWS IoT code from a provided link aws_iot_tutorial.zip. Surprisingly, it's working flawlessly, allowing me to successfully post data to the subscribed sensor/temperature topic, as evidenced by the attached screenshot.


    However, I'm encountering connectivity issues with the sample AWS IoT code provided by NRF samples. Despite following the same steps, it fails to establish a connection. Could you please enlighten me on the key differences between these two codes? I'm particularly curious about why one version connects successfully while the other encounters difficulties.

    Your insights into these differences and potential reasons behind the connectivity issues would be immensely helpful.

    Thank you for your time and assistance.

  • Hi,

    I see that the sample has recently been updated to work in NCS v2.6.0. You could try to look at the differences between prj.conf and main.c in unmodified sample and in the sample that you linked to.

    Best regards,
    Dejan

Related