AWS IoT Sample Disconnection Behavior

I am working with the AWS IoT sample on the nRF9160 development kit using Nrf connect 1.8.0.  I am testing the disconnection behavior by removing the sim card after connection has been established.  The system correctly generates the AWS_IOT_EVT_DISCONNECTED.  This launches the connect_work function.  I put the sim card back in after the disconnection event, but the connection seems to not correct properly.  On disconnection I get these three errors:

W: connection_poll_start failed, error: -119
aws_iot_connect ( error: -119 ), next connection retry in 10 seconds
E: Cloud MQTT input error: -128

After putting the sim card back in I get the messages:

AWS IoT event received ( event: 1 )
LTE event received ( event: 3 )
Network registration status: Connected - roaming

which made me think the connection had been reestablished, but on trying to send new messages the aws_iot_send fails with error: -128.

I'm confused since the connection seems to reestablish, but the aws_iot_send fails still.  

My questions:

1) where can i find what the codes mean: ie: event: 1 event: 3 error -128 for aws_iot_send etc

2) Do I need to add some other error catching to reestablish connection to allow aws_iot_send to succeed after a sim card is removed?

3) why can I reconnect to AWS while the send still fails?

Related