GitXplorerGitXplorer
a

simplify-ota-script

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
fbf9d95a5db95973f6e694599b4dfdacb2b0cfde

Merge pull request #4 from aws/dependabot/pip/urllib3-1.26.19

kkstribrnAmzn committed 7 months ago
Verified
2697ab3a0477268d29e2f256244faf0eb7412c60

Bump urllib3 from 1.26.18 to 1.26.19

ddependabot[bot] committed 7 months ago
Verified
29f8b6c297178a490a4b0ae42a9b10abeb6e5ea8

Merge pull request #3 from aws/piplockRegen

AA-Zaba committed a year ago
Unverified
d5b451fc4581c4032b3af3dd46163d11716f4ccf

Update Pipfile.lock

kkstribrnAmzn committed a year ago
Verified
c7ab4582e383bb8af5ffd01fc803834d516b410b

Update README.md

AA-Zaba committed 2 years ago
Verified
1b0d31bb514b5849e5dfff4bf8186b95478fb5c7

Delete requirements.txt

AA-Zaba committed 2 years ago

README

The README file for this repository.

AWS-Simplify-OTA-Script

This repository provides a command line interface wizard for easily onboarding IoT things to AWS IoT core, thing group management, and OTA job creation. This library is distributed under the Apache-2.0 Open Source License.

Overview

This package currently has 4 source files:

  • aws_operations.py is a wrapper for each AWS SDK call
  • utils.py helps handle input and output
  • setup_ota_update.py runs infrastructure setup for the user. This is the entry point of the script.
    • When resources are created or configured, the configuration gets written to config.json.
  • run_ota_update.py is a wrapper for CreateOTAUpdate API and reads from config.json to get the input needed for it.

Prerequisites

Once Python is installed, run pip install pipenv to install pipenv, enabling you to optionally create a virtual environment for the project via pipenv shell and use the pipfile to install dependencies via the pipenv install command.

Install OpenSSL

MacOS OpenSSL Installation:

brew update
brew install openssl
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Ubuntu OpenSSL Installation:

sudo apt update
sudo apt install openssl

Create AWS Account

Follow the instructions here to create an AWS account.

Setup AWS CLI

Follow the instructions here to set up AWS CLI.

Getting started

This documentation page describes how to run an Over-the-Air (OTA) update agent as one of the RTOS tasks that share the same MQTT connection.

Steps to run the script

To run this tool, you must first configure your AWS credentials. To see how to do this, refer to the following here. For example, in the terminal, run this with your configured credentials:

export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=us-west-2

After configuring your CLI credentials in your preferred method, simply run the following:

python3 setup-ota-update.py

This will take you through setting up the infrastructure for an OTA update. You will be prompted if you want to create a new resource or use an existing one for each needed resource, such as IAM roles, S3 buckets, Code signing profiles, etc.

If you generate an OpenSSL certificate through the wizard, you will have two files in your directory, ecdsasigner-priv-key.pem and ecdsasigner.crt. You should make sure that your device is signed with the private key file, or else the OTA update will not succeed.

When you are ready, simply run

python3 run-ota-update.py

Which will create the OTA update. You should go into your account or use the CLI to view the status of the update.