Skip to content

billkidwell/smart-product-solution-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Product Solution Tools

These tools provide a stream-lined way to get started with the Smart Product Solution reference architecture from AWS Labs.

For more information and a detailed deployment guide visit the Smart Product solution at https://aws.amazon.com/answers/iot/smart-product-solution/.

In the Deployment section, complete Step 1. Launch the stack, then continue from this guide.

Prerequisites

Configuring the Tools

Update the req_distinguished_name section in the CA.cnf with relevant information for your self-signed CA.

[ req_distinguished_name ]
# Leave as long names as it helps documentation

countryName=		    US
stateOrProvinceName=	Kentucky
localityName=		    My Town
organizationName=	    Some Organisation
organizationalUnitName=	Some Department
commonName=	            www.example.com
emailAddress=		    [email protected]

Repeat this for the template at templates/privateKeyVerification.csr.template

IMPORTANT Do not change the commonName value in the template

countryName=		    US
stateOrProvinceName=	Kentucky
localityName=		    My Town
organizationName=	    Some Organisation
organizationalUnitName=	Some Department
commonName=	            {{REG_CODE}}
emailAddress=		    [email protected]

Step 2. Demo the Solution

Use this procedure to demonstrate the solution’s capabilities using a sample smart product.

Create a User Account and Log in to the Web Console

  1. In the AWS CloudFormation console stack Outputs tab, select the URL value of the Smart Product Owner Web App key.
  2. In the web console, select Create Account.
  3. In the Create Account window, enter the applicable information.
  4. Select Create Account.
  5. A verification email will be sent to the specified email address.
  6. Select the link in the verification email to verify your account.
  7. Enter your username and password to log in to the web console.

Create and Configure a root CA certificate

From a bash prompt, run the following command

./scripts/createConfigureRootCACert.sh

Create and Configure a Device Certificate

From a bash prompt, run the following commands to prepare the application

cd provision && npm install

After the install, or on subsequent executions, run the following command

cd provision && node .

You should see output similar to the following

$ cd provision && node .
✔ Generate a UUID for the serial number
✔ Create a device directory
✔ Create a certificate signing request
✔ Create a device certificate file
✔ Create a copy of the device information on disk
✔ Update db with serial number, model number and device detail.

Device Information
=========================================================================================================
Serial Number: 048ede4d-79e1-4b0e-8e24-995b6f7cec26
Model Number: test-model
=========================================================================================================
Cert package for the device
/provision/devices/048ede4d-79e1-4b0e-8e24-995b6f7cec26/certs.tar.gz
✔ Create .env for the simulator

The Device information is used in the Just-in-time registration process.

Running the simulator

The cert package is used in the simulator. Unzip the files in the simulator folder. This places a .env file, and a certs folder with necessary certificates.

The first time you run the simulator, you must install the necessary node packages

cd simulator && npm install && cd ..

From that point forward, you can run the simulator with the following command

cd simulator && npm start

Register the Simulated Smart Product

After you provision your simulated device and run the simulator, you must complete the registration using the web console.

In the web console, select Register a device.

Enter the serial number and model number that was output by the provision script. Provide a name of your choosing.

Select Register.

When your instance or device successfully connects to AWS IoT, you will start to see simulated logs. You can modify the config.js file to change your demo simulator configuration. For example, you can modify the interval at which simulated data is sent.

About

A set of scripts and tools to use with the AWS smart-product-solution reference implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors