aws_iot: Cloud MQTT input error: -128

Hello,

I am receiving MQTT input error for my AWS IoT connection. Docs says it is an AWS policy problem here (https://nordicsemiconductor.github.io/asset-tracker-cloud-docs/saga/docs/devices/TroubleShooting.html#error-code-128)

My AWS Thing policy is as follows:

{
   "Version": "2012-10-17",
   "Statement": [{
         "Effect": "Allow",
         "Action": "iot:Connect",
         "Resource": "arn:aws:iot:us-west-1:account:client/*"
      },
      {
         "Effect": "Allow",
         "Action": "iot:Publish",
         "Resource": [
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/update",
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/delete",
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/get"
         ]
      },
      {
         "Effect": "Allow",
         "Action": "iot:Receive",
         "Resource": [
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/update/accepted",
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/delete/accepted",
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/get/accepted",
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/update/rejected",
            "arn:aws:iot:us-west-1:account:topic/$aws/things/*/shadow/delete/rejected"
         ]
      },
      {
         "Effect": "Allow",
         "Action": "iot:Subscribe",
         "Resource": [
            "arn:aws:iot:us-west-1:account:topicfilter/$aws/things/*/shadow/update/accepted",
            "arn:aws:iot:us-west-1:account:topicfilter/$aws/things/*/shadow/delete/accepted",
            "arn:aws:iot:us-west-1:account:topicfilter/$aws/things/*/shadow/get/accepted",
            "arn:aws:iot:us-west-1:account:topicfilter/$aws/things/*/shadow/update/rejected",
            "arn:aws:iot:us-west-1:account:topicfilter/$aws/things/*/shadow/delete/rejected"
         ]
      },
      {
         "Effect": "Allow",
         "Action": [
            "iot:GetThingShadow",
            "iot:UpdateThingShadow",
            "iot:DeleteThingShadow"
         ],
         "Resource": "arn:aws:iot:us-west-1:account:thing/*"

      }
   ]
}

Please advice if you see something wrong!

Thanks in advance.

``

Parents Reply Children
  • Hello,

    thanks for reaching out. We are using asset tracker v2. I can generate a new app with debug. Would that help? 
    In the current version, it only outputs the following error:

    aws_iot: Cloud MQTT input error: -128
  •  here is the log from Link Monitor without debug from POR:

    %CESQ: 66,3,22,3
    +CEREG: 2,"3BA6","0157B906",7
    [00:00:02.314,514] [0m<inf> event_manager: MODEM_EVT_LTE_DISCONNECTED[0m
    [00:00:02.321,685] [0m<inf> event_manager: MODEM_EVT_LTE_CELL_UPDATE[0m
    +CSCON: 1+CGEV: ME PDN ACT 0,0
    +CNEC_ESM: 50,0
    +CEREG: 5,"3BA6","0157B906",7,,,"00001010","11000001"
    +CIND: "service",1
    +CIND: "roam",1
    %XTIME: "2B","3210034082032B","00"
    [00:00:04.820,648] [0m<inf> event_manager: MODEM_EVT_LTE_CONNECTED[0m
    [00:00:04.827,545] [0m<inf> event_manager: MODEM_EVT_LTE_PSM_UPDATE[0m
    [00:00:04.834,503] [0m<inf> event_manager: DATA_EVT_DATE_TIME_OBTAINED[0m
    [00:00:04.842,163] [1;33m<wrn> cloud_module: Cloud connection establishment in progress[0m
    [00:00:04.850,250] [1;33m<wrn> cloud_module: New connection attempt in 32 seconds if not successful[0m
    [00:00:04.859,680] [0m<inf> event_manager: CLOUD_EVT_CONNECTING[0m
    AT+CGDCONT?+CGDCONT: 0,"IP","ibasis.iot","10.165...",0,0OK
    [00:00:04.938,293] [0m<dbg> aws_iot.broker_init: IPv4 Address found 52.53...[0m
    AT+COPS=3,2OK
    AT+CGACT?+CGACT: 0,1OK
    AT+COPS?+COPS: 0,2,"310260",7OK
    AT%XCBAND%XCBAND: 12OK
    AT+CGDCONT?+CGDCONT: 0,"IP","ibasis.iot","10.165...",0,0OK
    AT+CGACT?+CGACT: 0,1OK
    [00:00:07.628,387] [0m<dbg> aws_iot.connect_client: Using send socket timeout of 60 seconds[0m
    [00:00:07.636,871] [0m<dbg> aws_iot.aws_iot_cloud_poll: AWS IoT broker connection request sent[0m
    [00:00:09.924,652] [0m<dbg> aws_iot.mqtt_evt_handler: MQTT_EVT_DISCONNECT: result = -128[0m
    [00:00:09.932,922] [0m<inf> event_manager: CLOUD_EVT_DISCONNECTED[0m
    [00:00:09.939,636] [1;31m<err> aws_iot: Cloud MQTT input error: -128[0m
  • Hello,

    Thank you for your patience.

    It is not clear what the direct cause of your problem is.

    Make sure that you have set up your AWS IoT cloud service by following the procedure here.

    If you still have issues, please perform a modem trace and attach it to your next reply.

    Best Regards,
    Maria

  • Thank you, I will double check.

    Can you help point me to how to perform a modem trace? is that something I can do from the Link Monitor App?

    Best

    --L

  • Hello L,

    The application used for collecting modem traces is found in nRF Connect for Desktop and is called Trace Collector.

    Instructions for how to collect a modem trace on your hardware is found here.

    Best Regards,
    Maria

Related