AWS IoT FOTA Error nRF7002DK: Failed to create socket, err 12

After a lot of trial and error, I finally have an AWS IoT build running on my 7002dk. I am running the sample from the main branch of nRF Connect building with the command line.

west build -b nrf7002dk_nrf5340_cpuapp
west flash

My dev kit is successfully connecting to the broker and sending shadow updates. However, I need to make a proof of concept FOTA. Following the guide, I am able to get an update job started over https.

However, I am getting an error saying: download_client: Failed to create socket, err 12.

I am not sure where to look to start debugging. What am I missing?

[00:01:36.774,902] <inf> aws_iot_sample: AWS_IOT_EVT_PUBACK, message ID: 21781
[00:01:36.775,207] <inf> download_client: Downloading: app_update.bin [0]
[00:01:36.775,268] <inf> aws_iot_sample: AWS_IOT_EVT_FOTA_START
[00:01:36.814,697] <err> download_client: Failed to create socket, err 12
[00:01:36.814,727] <err> fota_download: Download client error
[00:01:36.814,758] <err> aws_fota: FOTA_DOWNLOAD_EVT_ERROR
[00:01:36.814,788] <err> aws_iot: AWS_FOTA_EVT_ERROR
[00:01:36.814,788] <inf> aws_iot_sample: AWS_IOT_EVT_FOTA_ERROR
[00:01:36.966,064] <inf> aws_iot_sample: AWS_IOT_EVT_PUBACK, message ID: 26704
[00:01:37.106,048] <inf> aws_iot_sample: AWS_IOT_EVT_PUBACK, message ID: 31885


Maybe some relevant config settings:

CONFIG_AWS_IOT=y
CONFIG_AWS_IOT_CLIENT_ID_STATIC="thing_name"
CONFIG_AWS_IOT_BROKER_HOST_NAME="aws_endpoint"
CONFIG_AWS_IOT_SEC_TAG=201
CONFIG_AWS_FOTA_DOWNLOAD_SECURITY_TAG=401

CONFIG_WIFI_CREDENTIALS_STATIC=y
CONFIG_WIFI_CREDENTIALS_STATIC_SSID="ssid"
CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="pass"

Parents
  • I can't see that you're missing anything specifically, I'm just saying what the error code you get implies, which is that either of the parameters in the connect() function of the download_client isn't found when running your project, meaning that either of the parameters in this function aren't fulfilled in your project. I don't have a clear idea of why at the moment I'm afraid, but please check your project what these are set as on your end. 

    	err = connect(dl->fd, &dl->remote_addr, addrlen);
    	if (err) {
    		err = -errno;
    		LOG_ERR("Unable to connect, errno %d", -err);
    	}

    Best regards,

    Simon

Reply
  • I can't see that you're missing anything specifically, I'm just saying what the error code you get implies, which is that either of the parameters in the connect() function of the download_client isn't found when running your project, meaning that either of the parameters in this function aren't fulfilled in your project. I don't have a clear idea of why at the moment I'm afraid, but please check your project what these are set as on your end. 

    	err = connect(dl->fd, &dl->remote_addr, addrlen);
    	if (err) {
    		err = -errno;
    		LOG_ERR("Unable to connect, errno %d", -err);
    	}

    Best regards,

    Simon

Children
No Data
Related