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,

     

    Thank you for your response.

    Even after adding CONFIG_LTE_LINK_CONTROL_LOG_LEVEL_DBG=y to the prj.conf file, I didn't receive any additional information. Unfortunately, I encountered errors when attempting to troubleshoot by adding CONFIG_NRF_MODEM_LIB_TRACE to the project configuration. Therefore, I am unable to provide the modem trace file at this time.

    However, during debugging, I encountered an issue with the following if condition:

    //if (IS_ENABLED(CONFIG_BOARD_QEMU_X86) || IS_ENABLED(CONFIG_BOARD_NATIVE_SIM)) {
    conn_mgr_mon_resend_status();
    //}

    To proceed, I commented out this if condition. Subsequently, I encountered errors similar to those shown in the screenshot.



    Given this situation, could you please advise on the next steps? Your guidance on resolving these errors and determining the root cause of the connectivity issue would be greatly appreciated.

    Thank you for your assistance.

  • Hi,

    Which board did you build for? What was your build target? Could you provide your build command?

    Best regards,
    Dejan

  • Hi,

    I'm using the nRF9160DK board version 1.1.0. In my Visual Studio Code build configuration, I've set the board to "nrf9160dk_nrf9160_ns" and the revision to "1.1.0". I've also configured the project by selecting the "prj.conf" option in the configuration settings. I select the "Build after generating configuration" checkbox, and the build starts automatically. I didn't input any explicit build command, as it's handled within the Visual Studio Code environment based on the configured settings.

    Let me know if you need any further information.

  • Hi,

    Do you have any other nrf9160-dk board which you could use to test unmodified AWS IoT sample in NCS v2.6.0?

    Best regards,
    Dejan

  • Hi,
       

    Thank you for your response. I've indeed attempted the AWS IoT sample on another NRF9160-DK board, and unfortunately, encountered the same issue with the two-line output even after removing the SIM card.

    Regarding the asset tracking output, I'm pleased to share that after updating the board controller hex file for external flash, I'm now able to successfully obtain the asset tracking output. As per our previous conversation where you requested the asset tracking sample code output log, I've attached the log output for your reference.

    [00:10:01.291,931] <inf> app_event_manager: APP_EVT_DATA_GET_ALL
    [00:10:01.292,572] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, LOCATION)
    [00:10:01.293,334] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:10:01.294,616] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED
    [00:10:01.294,952] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_NOT_SUPPORTED
    [00:10:01.379,760] <inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    *** Booting nRF Connect SDK d96769faceca ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x8200.
    Verifying signature against key 0.
    Hash: 0xb0...7c
    Firmware signature verified.
    Firmware version 1
    *** Booting nRF Connect SDK d96769faceca ***
    *** Booting nRF Connect SDK d96769faceca ***
    [00:00:00.255,218] <inf> app_event_manager: APP_EVT_START
    [00:00:00.492,248] <inf> nrf_modem_lib_trace: Trace thread ready
    [00:00:00.499,877] <inf> nrf_modem_lib_trace: Trace level override: 2
    [00:00:00.500,122] <inf> app_event_manager: MODEM_EVT_INITIALIZED
    [00:00:00.566,894] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTING
    [00:00:01.291,137] <inf> app_event_manager: DATA_EVT_CONFIG_INIT
    %CESQ: 64,3,18,2
    +CEREG: 2,"4006","034A1710",7
    [00:00:02.095,764] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
    +CSCON: 1
    %CESQ: 67,3,24,3
    +CGEV: ME PDN ACT 0,0
    [00:00:03.307,098] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
    [00:00:03.308,593] <inf> app_event_manager: CLOUD_EVT_CONNECTING
    +CNEC_ESM: 50,0
    %MDMEV: SEARCH STATUS 2
    +CEREG: 1,"4006","034A1710",7,,,"00001010","11000001"
    %XTIME: "0A","4240511154630A","01"
    [00:00:03.413,665] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
    [00:00:03.414,367] <inf> app_event_manager: DATA_EVT_DATE_TIME_OBTAINED
    [00:00:06.450,622] <inf> app_event_manager: CLOUD_EVT_CONFIG_RECEIVED
    [00:00:06.454,986] <inf> app_event_manager: DATA_EVT_CONFIG_SEND
    [00:00:06.456,146] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    [00:00:07.168,792] <inf> app_event_manager: CLOUD_EVT_CONNECTED
    [00:00:07.170,104] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, MOD_STAT, BAT, ENV, LOCATION)
    [00:00:07.170,928] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:00:07.172,790] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED
    [00:00:07.173,675] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_NOT_SUPPORTED
    [00:00:07.174,407] <inf> app_event_manager: LOCATION_MODULE_EVT_AGNSS_NEEDED
    [00:00:07.242,919] <inf> app_event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY
    *** Booting nRF Connect SDK d96769faceca ***
    Attempting to boot slot 0.
    Attempting to boot from address 0x8200.
    Verifying signature against key 0.
    Hash: 0xb0...7c
    Firmware signature verified.
    Firmware version 1
    Setting monotonic counter (version: 1, slot: 0)
    *** Booting nRF Connect SDK d96769faceca ***
    *** Booting nRF Connect SDK d96769faceca ***
    [00:00:00.255,218] <inf> app_event_manager: APP_EVT_START
    [00:00:00.492,156] <inf> nrf_modem_lib_trace: Trace thread ready
    [00:00:00.499,786] <inf> nrf_modem_lib_trace: Trace level override: 2
    [00:00:00.500,030] <inf> app_event_manager: MODEM_EVT_INITIALIZED
    [00:00:00.573,120] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTING
    [00:00:01.291,320] <inf> app_event_manager: DATA_EVT_CONFIG_INIT
    %CESQ: 65,3,19,2
    +CEREG: 2,"4006","034A1710",7
    [00:00:01.732,849] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
    +CSCON: 1
    %CESQ: 67,3,24,3
    +CGEV: ME PDN ACT 0,0
    [00:00:02.945,678] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
    [00:00:02.947,174] <inf> app_event_manager: CLOUD_EVT_CONNECTING
    +CNEC_ESM: 50,0
    %MDMEV: SEARCH STATUS 2
    +CEREG: 1,"4006","034A1710",7,,,"00001010","11000001"
    [00:00:02.951,934] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
    %XTIME: "0A","4240511164630A","01"
    [00:00:02.967,803] <inf> app_event_manager: DATA_EVT_DATE_TIME_OBTAINED
    [00:00:06.169,799] <inf> app_event_manager: CLOUD_EVT_CONFIG_RECEIVED
    [00:00:06.174,011] <inf> app_event_manager: DATA_EVT_CONFIG_SEND
    [00:00:06.175,170] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    [00:00:06.904,205] <inf> app_event_manager: CLOUD_EVT_CONNECTED
    [00:00:06.905,548] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, MOD_STAT, BAT, ENV, LOCATION)
    [00:00:06.906,372] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:00:06.908,203] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED
    [00:00:06.909,210] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_NOT_SUPPORTED
    [00:00:06.909,881] <inf> app_event_manager: LOCATION_MODULE_EVT_AGNSS_NEEDED
    [00:00:06.976,959] <inf> app_event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY
    [00:00:07.091,125] <inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    +CSCON: 0
    %CESQ: 255,0,255,0
    [00:01:41.526,763] <wrn> location: GNSS timed out possibly due to too short GNSS time windows
    %CESQ: 65,3,17,2
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,5110,49,70,27,101753,0
    %CESQ: 255,0,255,0
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,0,5110,49,70,26,102050,0,0,"0052A40C","310260","A2E3",65535,0,1026,22,37,23,102059,0,0
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,0,5110,49,70,28,103924,0,0,"0052A40C","310260","A2E3",65535,0,1026,22,37,25,103933,0,0,"02982901","311580","1101",65535,0,5035,354,59,24,103942,0,0,"0328CB03","311480","CF03",65535,0,5230,146,54,24,103999,0,0
    [00:01:44.459,838] <inf> app_event_manager: LOCATION_MODULE_EVT_CLOUD_LOCATION_DATA_READY
    [00:01:44.460,510] <inf> app_event_manager: DATA_EVT_DATA_READY
    [00:01:44.471,649] <inf> app_event_manager: DATA_EVT_CLOUD_LOCATION_DATA_SEND
    [00:01:44.475,891] <inf> app_event_manager: DATA_EVT_DATA_SEND_BATCH
    [00:01:44.476,684] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    [00:01:44.476,928] <inf> app_event_manager: CLOUD_EVT_CLOUD_LOCATION_UNKNOWN
    [00:01:44.477,630] <inf> app_event_manager: LOCATION_MODULE_EVT_INACTIVE
    [00:01:44.478,851] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    %CESQ: 64,3,18,2
    %MDMEV: SEARCH STATUS 2
    +CSCON: 1
    %CESQ: 66,3,23,3
    +CSCON: 0
    %CESQ: 255,0,255,0
    [00:05:01.291,931] <inf> app_event_manager: APP_EVT_DATA_GET_ALL
    [00:05:01.292,572] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, LOCATION)
    [00:05:01.293,334] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:05:01.294,616] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED
    [00:05:01.294,982] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_NOT_SUPPORTED
    [00:05:01.382,965] <inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    %CESQ: 64,3,16,2
    %CESQ: 68,3,25,3
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,5110,49,70,28,392314,0
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,0,5110,49,70,26,392545,0,0,"02982901","311580","1101",65535,0,5035,354,60,11,392553,0,0,"0052A40C","310260","A2E3",65535,0,1026,22,36,23,392562,0,0,"0328CB03","311480","CF03",65535,0,5230,146,53,27,392619,0,0
    [00:06:33.092,926] <inf> app_event_manager: LOCATION_MODULE_EVT_CLOUD_LOCATION_DATA_READY
    [00:06:33.093,597] <inf> app_event_manager: DATA_EVT_DATA_READY
    [00:06:33.104,797] <inf> app_event_manager: DATA_EVT_CLOUD_LOCATION_DATA_SEND
    [00:06:33.109,161] <inf> app_event_manager: DATA_EVT_DATA_SEND_BATCH
    [00:06:33.109,924] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    [00:06:33.110,168] <inf> app_event_manager: CLOUD_EVT_CLOUD_LOCATION_UNKNOWN
    [00:06:33.110,900] <inf> app_event_manager: LOCATION_MODULE_EVT_INACTIVE
    [00:06:33.112,121] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    %CESQ: 64,3,17,2
    %MDMEV: SEARCH STATUS 2
    +CSCON: 1
    %CESQ: 66,3,23,3
    +CSCON: 0
    +CSCON: 1
    +CSCON: 0
    %CESQ: 255,0,255,0
    [00:10:01.291,931] <inf> app_event_manager: APP_EVT_DATA_GET_ALL
    [00:10:01.292,572] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, LOCATION)
    [00:10:01.293,334] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:10:01.294,616] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED
    [00:10:01.294,952] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_NOT_SUPPORTED
    [00:10:01.383,666] <inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    %CESQ: 63,3,18,2
    %CESQ: 68,3,25,3
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,5110,49,70,28,691834,0
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,0,5110,49,70,27,692065,0,0,"02982901","311580","1101",65535,0,5035,354,59,22,692074,0,0,"0052A40C","310260","A2E3",65535,0,1026,22,36,23,692083,0,0,"0328CB03","311480","CF03",65535,0,5230,146,53,26,692140,0,0
    [00:11:32.625,976] <inf> app_event_manager: LOCATION_MODULE_EVT_CLOUD_LOCATION_DATA_READY
    [00:11:32.626,770] <inf> app_event_manager: DATA_EVT_DATA_READY
    [00:11:32.637,908] <inf> app_event_manager: DATA_EVT_CLOUD_LOCATION_DATA_SEND
    [00:11:32.642,150] <inf> app_event_manager: DATA_EVT_DATA_SEND_BATCH
    [00:11:32.642,944] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    [00:11:32.643,188] <inf> app_event_manager: CLOUD_EVT_CLOUD_LOCATION_UNKNOWN
    [00:11:32.643,890] <inf> app_event_manager: LOCATION_MODULE_EVT_INACTIVE
    [00:11:32.645,111] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    %CESQ: 65,3,17,2
    %MDMEV: SEARCH STATUS 2
    +CSCON: 1
    %CESQ: 66,3,23,3
    +CSCON: 0
    %CESQ: 255,0,255,0
    [00:15:01.291,931] <inf> app_event_manager: APP_EVT_DATA_GET_ALL
    [00:15:01.292,572] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, LOCATION)
    [00:15:01.293,334] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:15:01.294,616] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED
    [00:15:01.294,952] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_NOT_SUPPORTED
    [00:15:01.381,439] <inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    %CESQ: 64,3,18,2
    %CESQ: 68,3,25,3
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,5110,49,70,28,991354,0
    %NCELLMEAS: 0,"034A1710","310410","4006",65535,0,5110,49,70,28,991584,0,0,"02982901","311580","1101",65535,0,5035,354,59,24,991593,0,0,"0052A40C","310260","A2E3",65535,0,1026,22,36,16,991602,0,0,"0328CB03","311480","CF03",65535,0,5230,146,53,14,991659,0,0
    [00:16:32.158,447] <inf> app_event_manager: LOCATION_MODULE_EVT_CLOUD_LOCATION_DATA_READY
    [00:16:32.159,149] <inf> app_event_manager: DATA_EVT_DATA_READY
    [00:16:32.170,379] <inf> app_event_manager: DATA_EVT_CLOUD_LOCATION_DATA_SEND
    [00:16:32.174,713] <inf> app_event_manager: DATA_EVT_DATA_SEND_BATCH
    [00:16:32.175,506] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    [00:16:32.175,750] <inf> app_event_manager: CLOUD_EVT_CLOUD_LOCATION_UNKNOWN
    [00:16:32.176,483] <inf> app_event_manager: LOCATION_MODULE_EVT_INACTIVE
    [00:16:32.177,703] <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
    %CESQ: 64,3,16,2
    %MDMEV: SEARCH STATUS 2
    +CSCON: 1
    %CESQ: 67,3,23,3
    +CSCON: 0
    %CESQ: 255,0,255,0
    [00:20:01.291,931] <inf> app_event_manager: APP_EVT_DATA_GET_ALL
    [00:20:01.292,572] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, LOCATION)
    [00:20:01.293,426] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:20:01.294,708] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_NOT_SUPPORTED
    [00:20:01.295,043] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_NOT_SUPPORTED
    [00:20:01.382,537] <inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY

    However, I'm facing difficulties with AWS IoT connectivity. Despite the successful asset tracking output, the AWS IoT sample seems unable to connect. Could you provide guidance on what might be causing this issue based on the information provided?

Related