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
  • Hi

    After this fix was added to increase the number of TLS contexts and file descriptors the AWS_IoT should be able to do FOTA. I see that the port you're using is the default one, can you confirm is this is intended or not, and that silver-firmware-ota.s3.us-east-1.amazonaws.com is the server you want to connect to? The error is still the same, as one of the params in your connect() function aren't found in your project.

    Best regards,

    Simon

Reply
  • Hi

    After this fix was added to increase the number of TLS contexts and file descriptors the AWS_IoT should be able to do FOTA. I see that the port you're using is the default one, can you confirm is this is intended or not, and that silver-firmware-ota.s3.us-east-1.amazonaws.com is the server you want to connect to? The error is still the same, as one of the params in your connect() function aren't found in your project.

    Best regards,

    Simon

Children
  • Hi Simon, 

    You are correct, I have not changed the port from the default one. I don't see any mention of ports in the AWS FOTA configuration guide. Is this something I need to configure? Is that on the AWS side or the project side, or both?

    I can confirm that silver-firmware-ota.s3.us-east-1.amazonaws.com is the server I am attempting to connect to. 

    Are you implying that I am missing one of the params in my configuration? Can you point me to which configuration variables are missing? Is there a step in the FOTA guide that I missed?

Related