Using Jobs in AWS IoT Device Management

   Go back to the Task List

  « 6. Create Job Files    8. Clean up »

7. Run the Device Job

It is time to send a job to the device from AWS IoT Device Management and see how the device handles it. First, you run the code at the device first so it is waiting for the job. Then you submit the job using AWS IoT Device Management.

  1. In Cloud9 dojoenvironment, run to command python joblistener.py to start the device side code.

    IoT Job

  2. Keep the Cloud9 running in one browser tab and open AWS IoT Management Console on the other browser tab. Click on the Jobs menu in the left under the Manage menu. Then click on the Create button on the jobs screen.

    IoT Job

  3. On the next screen, click on the Create custom job button.

    IoT Job

  4. On the next screen, type in dojojob1 as the job name. Select dojodevice1 for the device to update.

    IoT Job

  5. On the same screen, select dojojob.json file from the dojo-job bucket for the job file. If you created bucket with a different name, use that bucket.

    IoT Job

  6. On the same screen, select I want to pre-sign my URLs and have configured my job file. option. Click on the Create Role link. In the popup, type dojoiotjobrole for the role name and click on the Create role button.

    IoT Job

  7. The role is created. Select snapshot option for the job type and click on the Next button.

    IoT Job

  8. On the next screen, keep everything as the default and click on the Create button. It will create the job. If you open the job details, you can see the status moving to In Progress first and then to Succeeded. You might not see the In Progress status because it happens very fast.

    IoT Job

  9. When you go back to Cloud9 dojoenvironment, you will find that the job has been processed by the device. The proof is that dojoconfig.txt is downloaded by the device.

    IoT Job

  10. You saw how AWS IoT Device Management is used to submit job and how the device code handles it. It finishes the workshop.

  11. Follow the next step to clean-up the resources so that you don’t incur any cost post the workshop.