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

How to use aws_fota program in nRF9160?

I'm trying to use aws_fota, but it doesn't work. Any help?

I was able to set a job on AWS IoT, but the download job doesn't start. The job status is always "in progress". I logged out and logged in and got the same result.

***** Booting Zephyr OS v1.14.99-ncs2 *****
The MQTT AWS Jobs FOTA Sample
LTE Link Connecting ...
LTE Link Connected!
IPv4 Address 0x4980a023
client_id: nrf-352656100218455
[mqtt_evt_handler:131] MQTT client connected!
[mqtt_evt_handler:196] SUBACK packet id: 2112
[mqtt_evt_handler:186] PUBACK packet id: 62996

I use the same region in AWS IoT and S3

I've already checked this thread.
https://devzone.nordicsemi.com/f/nordic-q-a/52039/aws-fota-sample/210098#210098

Parents Reply Children
  • Yea, you're right. My version is v1.0.0. Modem fw is v1.0.1.

    >In addition, now I can't update bucket>permissions>bucket policy.

    I solved this issue. You must configure bucket access controls both in account level and bucket level.

    However, downloading does not start yet.... The same result so far, even if I created a job after MQTT connection.

  • Did you attach the policy I suggested to the certificates of the thing in AWS IoT Core? Does your job ever go from Queued to In progress if you click on it and see the status fields?

    It should progress from QueuedIn progress then to either Failed or Successful.

    For v1.0.0 your device has to be connected and subscribed 
    [mqtt_evt_handler:196] SUBACK packet id: 2112
    before you create the job. Also, ensure that all your old jobs are canceled and deleted as a device can only have 1 active job at the time. So if there is a job already for the device it will block any new jobs created.

  • >Did you attach the policy I suggested to the certificates of the thing in AWS IoT Core?

    I did it and the device doesn't subscribe and stops processing on the way.

    ***** Booting Zephyr OS v1.14.99-ncs2 *****
    The MQTT AWS Jobs FOTA Sample
    LTE Link Connecting ...
    LTE Link Connected!
    IPv4 Address 0x27e71934
    client_id: nrf-352656100218455
    

  • This is usually caused by client_id: nrf-352656100218455 not being the same as the clientId attached to your certificates. Have you set nrf-352656100218455 as the thing name in AWS?

    What do you mean with stops processing on the way? What happens?

  • I use the same name as thing name.

    <Kconfig>

    config USE_CLOUD_CLIENT_ID
    	bool "Custom MQTT Client Id"
    
    config DOWNLOAD_CLIENT_LOG_LEVEL_DBG
    	bool "degbug level"
    
    config DOWNLOAD_CLIENT_LOG_HEADER
    	bool "log header"
    
    if USE_CLOUD_CLIENT_ID
    
    config CLOUD_CLIENT_ID
    	string "Client ID"
    	default "device01"
    endif

    >What do you mean with stops processing on the way? What happens?

    I expected "MQTT client connected!" message will show up after "client_id: nrf-352656100218455" message, but "MQTT client connected!" does not show up and process stops.

Related