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.
- jq
- https://github.com/tests-always-included/mo (included)
- mosquitto client (to run mosquitto_pub command)
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]
Use this procedure to demonstrate the solution’s capabilities using a sample smart product.
- In the AWS CloudFormation console stack Outputs tab, select the URL value of the Smart Product Owner Web App key.
- In the web console, select Create Account.
- In the Create Account window, enter the applicable information.
- Select Create Account.
- A verification email will be sent to the specified email address.
- Select the link in the verification email to verify your account.
- Enter your username and password to log in to the web console.
From a bash prompt, run the following command
./scripts/createConfigureRootCACert.sh
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.
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
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.