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

Failed to connect to cloud, error -7

Hi!

Running the Asset-Tracker routine will fail to connect to the cloud(ncs1.3.0). The serial port displays an error say Failed to connect to cloud, error -7.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[13:59:54.870]←◆[00:01:13.570,983] <dbg> nrf_cloud_transport.nct_mqtt_evt_handler: MQTT_EVT_CONNACK: result -111
[00:01:13.580,261] <dbg> nrf_cloud.nfsm_set_current_state_and_notify: state: 1
[00:01:13.587,921] <dbg> nrf_cloud.api_event_handler: NRF_CLOUD_EVT_ERROR: -111
[00:01:13.595,672] <inf> asset_tracker: CLOUD_EVT_ERROR
[13:59:55.399]←◆[00:01:14.101,501] <dbg> nrf_cloud.nrf_cloud_run: Socket error: POLLNVAL
[00:01:14.108,642] <dbg> nrf_cloud.nrf_cloud_run: The cloud socket was unexpectedly closed.
[00:01:14.117,401] <inf> asset_tracker: CLOUD_EVT_DISCONNECTED: 2
[00:01:14.123,931] <inf> asset_tracker: Cloud connection closed.
[00:01:14.130,371] <inf> asset_tracker: This can occur during initial nRF Cloud provisioning.
[00:01:14.139,312] <inf> asset_tracker: Attempting reconnect in 10 seconds...
[00:01:14.146,881] <dbg> nrf_cloud_transport.nct_disconnect: nct_disconnect
[14:00:05.444]←◆[00:01:24.146,942] <inf> asset_tracker: Connecting to cloud, attempt 2 of 8
[00:01:24.154,388] <inf> asset_tracker: Cloud connection request sent.
[00:01:24.161,346] <inf> asset_tracker: Connection response timeout is set to 30 seconds.
[00:01:24.169,982] <inf> asset_tracker: CLOUD_EVT_CONNECTING
[14:00:06.527]←◆[00:01:25.228,881] <dbg> nrf_cloud_transport.nct_connect: IPv4 address: 3.223.232.82
[14:00:35.146]←◆+CSC
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Error -7 is Invalid private key.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**@brief Cloud connect results. */
enum cloud_connect_result {
CLOUD_CONNECT_RES_SUCCESS = 0,
CLOUD_CONNECT_RES_ERR_NOT_INITD = -1,
CLOUD_CONNECT_RES_ERR_INVALID_PARAM = -2,
CLOUD_CONNECT_RES_ERR_NETWORK = -3,
CLOUD_CONNECT_RES_ERR_BACKEND = -4,
CLOUD_CONNECT_RES_ERR_MISC = -5,
CLOUD_CONNECT_RES_ERR_NO_MEM = -6,
/* Invalid private key */
CLOUD_CONNECT_RES_ERR_PRV_KEY = -7,
/* Invalid CA or client cert */
CLOUD_CONNECT_RES_ERR_CERT = -8,
/* Other cert issue */
CLOUD_CONNECT_RES_ERR_CERT_MISC = -9,
/* Timeout, SIM card may be out of data */
CLOUD_CONNECT_RES_ERR_TIMEOUT_NO_DATA = -10,
CLOUD_CONNECT_RES_ERR_ALREADY_CONNECTED = -11,
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

It worked fine yesterday, but it's been running today with this error. 

I tried the NCS1.2.0 routine and it worked fine