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 Reply Children
  • Hi Simon,

    Thank you for your response. Updating CONFIG_POSIX_MAX_FDS to 15 and setting CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS to 5 seemed to help. (These were chosen arbitrarily). 

    CONFIG_POSIX_MAX_FDS=15
    CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=5

    However, now I am facing a new issue. I am getting an "unable to connect, errno 2" from the download_client. Anything else I am missing?

    [00:00:16.093,872] <inf> aws_iot_sample: AWS_IOT_EVT_PUBACK, message ID: 64437
    [00:00:16.094,970] <inf> download_client: Downloading: app_update.bin [0]
    [00:00:16.095,031] <inf> aws_iot_sample: AWS_IOT_EVT_FOTA_START
    [00:00:16.116,271] <inf> download_client: Setting up TLS credentials, sec tag count 1
    [00:00:16.116,394] <inf> download_client: Connecting to silver-firmware-ota.s3.us-east-1.amazonaws.com
    [00:00:16.240,814] <err> download_client: Unable to connect, errno 2
    [00:00:16.242,095] <inf> aws_iot_sample: AWS_IOT_EVT_FOTA_DL_PROGRESS, (100%)
    [00:00:16.246,643] <err> fota_download: Download client error
    [00:00:16.335,876] <inf> aws_iot_sample: AWS_IOT_EVT_PUBACK, message ID: 7937
    [00:00:16.336,120] <inf> aws_iot_sample: AWS_IOT_EVT_FOTA_DONE
    [00:00:16.344,543] <inf> aws_iot_sample: AWS_IOT_EVT_DISCONNECTED
    [00:00:16.344,573] <wrn> aws_iot_sample: Unexpected FOTA image type

Related