Microchip Technology ATWINC 15x0 Developer's Manual
Microchip Technology ATWINC 15x0 Developer's Manual

Microchip Technology ATWINC 15x0 Developer's Manual

Wi-fi smart device enablement kit

Advertisement

Quick Links

®
Wi-Fi
Smart Device Enablement Kit Developer's Guide

Introduction

This document describes the Wi-Fi Smart Device Enablement Kit development, which is supported by the
ATWINC15x0 Wi-Fi Network Controller (WINC) module that enables the developer to demonstrate the
functionalities of the ATWINC15x0 module for Internet of Things (IoT) applications.
This kit is pre-programmed with an application for demonstrating connectivity to the Microchip AWS
account with the help of an Amazon Alexa
to control the LEDs on the kit using cloud-based voice service virtual assistant such as Amazon Echo
®
Dot
. The mobile application is used for board registration, network configuration, and controlling and
monitoring the Wi-Fi Smart Device Enablement Kit.
For the demonstration shown in this document, the Wi-Fi Smart Device Enablement Kit is pre-configured
with the following:
• Customized MCU firmware
• AWS cloud configuration
• Alexa Skill setting
• Mobile application configuration
However, the developers can create and set up their own private AWS account, configure MCU firmware,
and build custom Alexa Skill with the help of this document.

Features

• ATWINC15x0, Qualified IEEE
• On-Board Host Microcontroller (SAML21G18B) for Easy Operation and Feature Demonstration
• On-Board CryptoAuthentication
• On-Board Li-Ion/Li-Po Charge Management Controller (MCP73833) for Lithium Battery Charging
• On-Board High Power Supply Rejection (PSRR) Low Dropout (LDO) Regulator (MIC5317)
• On-Board Environment Sensor (BME280)
• On-Board Light Sensor (VEML6030)
©
2019 Microchip Technology Inc.
ATWINC15x0 Smart Device
®
and a mobile application. The developer can collect the data
®
802.11 b/g/n Network Controller Module
(ATECC608A) Device for Secure Connection to AWS
User Guide
Kit
®
IoT
DS50002885A-page 1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ATWINC 15x0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Microchip Technology ATWINC 15x0

  • Page 1: Introduction

    • On-Board Li-Ion/Li-Po Charge Management Controller (MCP73833) for Lithium Battery Charging • On-Board High Power Supply Rejection (PSRR) Low Dropout (LDO) Regulator (MIC5317) • On-Board Environment Sensor (BME280) • On-Board Light Sensor (VEML6030) User Guide DS50002885A-page 1 © 2019 Microchip Technology Inc.
  • Page 2: Table Of Contents

    9. Appendix B: Mobile Application Configuration............73 9.1. Android Application........................73 9.2. iOS Application...........................74 10. Appendix C: AWS CloudFormation to Setup Cloud..........76 10.1. Create IAM User for the Project....................76 10.2. Create Lambda Functions for Alexa...................81 User Guide DS50002885A-page 2 © 2019 Microchip Technology Inc.
  • Page 3 The Microchip Web Site....................88 Customer Change Notification Service................88 Customer Support......................88 Microchip Devices Code Protection Feature..............88 Legal Notice........................89 Trademarks........................89 Quality Management System Certified by DNV.............90 Worldwide Sales and Service..................91 User Guide DS50002885A-page 3 © 2019 Microchip Technology Inc.
  • Page 4: Quick References

    For further study, refer the following: ® • Wi-Fi Smart Device Enablement Kit User’s Guide (DS50002880) ® • ATWINC15x0 IEEE 802.11 b/g/n SmartConnect IoT Module Datasheet (DS70005304) • SAM L21 Family Datasheet (DS60001477) User Guide DS50002885A-page 4 © 2019 Microchip Technology Inc.
  • Page 5 ATWINC15x0 Smart Device Kit Quick References ™ • ATECC608A CryptoAuthentication Device Summary Datasheet (DS40001977) User Guide DS50002885A-page 5 © 2019 Microchip Technology Inc.
  • Page 6: Uart Debug Interface

    Use these settings for the terminal emulator: Table 2-2. Terminal Setup Terminal Settings Value Port Depends on platform and other devices connected to the computer. User Guide DS50002885A-page 6 © 2019 Microchip Technology Inc.
  • Page 7 ATWINC15x0 Smart Device Kit UART Debug Interface ...continued Terminal Settings Value BAUD rate 115200 Data 8 bit Parity none Stop 1 bit Flow control none Below is the application boot-up log: Figure 2-2. Boot-Up Log User Guide DS50002885A-page 7 © 2019 Microchip Technology Inc.
  • Page 8: Boot-Loader Firmware

    /boot-loader/ directory of the release package. The user can use the Atmel ICE programming tool to program the boot-loader to the board. The Atmel ICE tool is available at https:// www.microchip.com/developmenttools/ProductDetails/atatmel-ice. Connect Atmel ICE (see Atmel ICE) to the board SWD interface connector (J5). User Guide DS50002885A-page 8 © 2019 Microchip Technology Inc.
  • Page 9 Select “Tool” as Atmel-ICE and “Device” as ATSAML21G18B. Click Apply. In Memories tab, fill SAM-BA_MONITOR_ROMLESS.ELF in the “Flash” field. The .ELF file is available in the /boot-loader directory and https://github.com/MicrochipTech/winc1500-wifi- smart-device-enablement-kit-aws-cloud/tree/master/boot-loader. Click Program. User Guide DS50002885A-page 9 © 2019 Microchip Technology Inc.
  • Page 10 ATWINC15x0 Smart Device Kit Boot-Loader Firmware Figure 3-3. Boot Loader Firmware User Guide DS50002885A-page 10 © 2019 Microchip Technology Inc.
  • Page 11: Application Firmware

    Modify "Wl,--section-start=.text=0x2000" to "Wl,--section-start=.text=0x0000" in the Linker Flag. Click Build > Rebuild Solution to compile the source code and generate binary files. Note:  Generated binary files are to be stored in the C:\github\winc1500-wifi-smart-device- enablement-kit-aws-cloud\mcu-firmware\saml21g18b_sensor_board_demo\Debug directory. User Guide DS50002885A-page 11 © 2019 Microchip Technology Inc.
  • Page 12: Application Firmware Programming Procedure

    In the Flash tab, set the bin file name in “Send File Name” and the “Address.” Click Send File to program the bin file to the Wi-Fi Smart Device Enablement Kit. User Guide DS50002885A-page 12 © 2019 Microchip Technology Inc.
  • Page 13 4.1 Application Firmware Compilation Procedure. Perform the following steps for programming through the Atmel ICE tool: Connect Atmel ICE to the board as shown in the following figure. User Guide DS50002885A-page 13 © 2019 Microchip Technology Inc.
  • Page 14 Launch Atmel Studio, and select Tools > Device Programming. Select Atmel-ICE as "Tool" and ATSAML21G18B as "Device." Click Apply. Select "Memories" and the application firmware in “Flash” as highlighted in the following figure. Click Program. User Guide DS50002885A-page 14 © 2019 Microchip Technology Inc.
  • Page 15: Operation

    AWS IoT Shadow, and the developer can use a mobile application or speak to Alexa-enabled device (for example, Echo Dot) to check the sensor values, and LED LD2 color. User Guide DS50002885A-page 15 © 2019 Microchip Technology Inc.
  • Page 16 The board updates sensor and LED data to the AWS IoT by publishing MQTT message to Shadow MQTT /update topics and get the LED latest state from AWS IoT by subscribing Shadow MQTT /update/ User Guide DS50002885A-page 16 © 2019 Microchip Technology Inc.
  • Page 17 • When the developer signs in to the mobile application, the mobile application scans the table in AWS DynamoDB to display the board information that corresponds to its mobile application account ID. User Guide DS50002885A-page 17 © 2019 Microchip Technology Inc.
  • Page 18 Set/Clear Port B 22/23 4.3.7 Mobile Application Control Mobile application controls the board by publishing MQTT message to Shadow MQTT /update topics, and get the sensor data by subscribing Shadow MQTT /update/delta topics. User Guide DS50002885A-page 18 © 2019 Microchip Technology Inc.
  • Page 19: Software Customization

    • Crytoautholib for ECC608 • ASF • JSON library Figure 4-6. Firmware Architecture Application Middleware Environment CLOUD Button WLAN /Socket WRAPPER Message Sensor Device Drivers Environment WINC15x0 Light sensor Crytoauthlib JSON LIB sensor HostDriver User Guide DS50002885A-page 19 © 2019 Microchip Technology Inc.
  • Page 20 Folder Structure Figure 4-7. Folder Structure 4.4.3 Middleware APIs The following table shows the middleware APIs. Table 4-3. Middleware APIs Middleware Modules Files Function cloud_wrapper.h Connect/ disconnect cloud, publish/ subscribe MQTT CLOUD_WRAPPER channel User Guide DS50002885A-page 20 © 2019 Microchip Technology Inc.
  • Page 21 • Message[input]message that publish to the AWS IoT MQTT broker Return: 0: success; Other value: fail; – Cloud_RC cloud_mqtt_subscribe(char* channel, void* cb); Usage: Subscribe AWS IoT MQTT topic. Parameters: • Channel [input]MQTT topic for subscription User Guide DS50002885A-page 21 © 2019 Microchip Technology Inc.
  • Page 22 • button[input] 1: SW1; 2: SW2; 3: SW3 Return: socket index – int unRegButtonShortPressDetectCallback(int sock, int button) Usage: Unregister callback function for the button short press detect. Parameters: • sock [input]socket index that represent the registration User Guide DS50002885A-page 22 © 2019 Microchip Technology Inc.
  • Page 23 – Led_Color led_ctrl_get_color(void) Usage: Gets LED color. Parameters: N/A Return: Led_Color ENV_SENSOR – void env_sensor_data_init(void); Usage: Gets the initialize value of the environment sensor and light sensor. Parameters: N/A – void env_sensor_execute(void) User Guide DS50002885A-page 23 © 2019 Microchip Technology Inc.
  • Page 24 Parameters: N/A – void register_env_sensor_udpate_callback_handler(void* cb) Usage: Register callback function for the environment and light sensor data. Parameters: • cb [input]callback function User Guide DS50002885A-page 24 © 2019 Microchip Technology Inc.
  • Page 25: Aws Setup

    From the "Users" management page, click Add User at the top of the page. When the “Add user - Step 1: Details” page displays, enter the following information: 3.1. Set user details as follows: • Username: ZTUser 3.2. Select AWS access type: • Access type User Guide DS50002885A-page 25 © 2019 Microchip Technology Inc.
  • Page 26 Figure 5-2. Adding a New User and Selecting AWS Access Type Create a new group for the AWS account. Select “Add user to group” for adding a new user. Click Create group. User Guide DS50002885A-page 26 © 2019 Microchip Technology Inc.
  • Page 27 Figure 5-4. Adding Policies to a Group 11. In the Set permissions page, the ZTGroup is preselected. This sets permissions for user ZTUser to group policies specified to ZTGroup. Click Next: Tags. User Guide DS50002885A-page 27 © 2019 Microchip Technology Inc.
  • Page 28 Figure 5-5. Setting Permissions 12. This is an optional step and to skip this part, click Next: Review. Figure 5-6. Adding Tags 13. Verify the details and click Create user to create the user account. User Guide DS50002885A-page 28 © 2019 Microchip Technology Inc.
  • Page 29 14. AWS creates a unique account sign-in URL and access credentials (Access key ID and Secret access key). To download and save the account information file, click Download .csv. These credentials are used to configure the settings under ZTUser account later. Figure 5-8. Successful User Creation Window User Guide DS50002885A-page 29 © 2019 Microchip Technology Inc.
  • Page 30 Select JSON. Copy and paste the following code and click Review Policy. Figure 5-10. Policy Review "Version": "2012-10-17", "Statement": [ "Effect": "Allow", "Action": [ "iot:UpdateCertificate", "iot:CreatePolicy", "iot:AttachPrincipalPolicy", "iot:CreateThing", "iot:CreateThingType", "iot:DescribeCertificate", "iot:DescribeCaCertificate", "iot:DescribeThing", "iot:DescribeThingType", "iot:GetPolicy" "iot:CreateThingGroup", "iot:AddThingToThingGroup" "Resource": "*" User Guide DS50002885A-page 30 © 2019 Microchip Technology Inc.
  • Page 31 ATWINC15x0 Smart Device Kit AWS Setup Figure 5-11. Policy Review Enter the policy name as ZTLambdaJITRPolicy in the “Name” field. Click Create policy. User Guide DS50002885A-page 31 © 2019 Microchip Technology Inc.
  • Page 32 To create roles, perform the following steps: Go to https://console.aws.amazon.com/iam. Click Roles. In the Roles page, click Create Role. Under “Select type of trusted entity”, select AWS Service and select “Lambda” service. Click Next: Permissions. User Guide DS50002885A-page 32 © 2019 Microchip Technology Inc.
  • Page 33 ATWINC15x0 Smart Device Kit AWS Setup Figure 5-13. Select Type of Trusted Entity Attach the following policies: – AWSLambdaBasicExecutionRole – AWSXrayWriteOnlyAccess – ZTLambdaJITRPolicy Click Next Step. Set Role name as ZTLambdaJITRRole. Click Create role. User Guide DS50002885A-page 33 © 2019 Microchip Technology Inc.
  • Page 34: Aws Iot Just-In-Time Registration Setup

    Default region name [None]: us-east-1 ( <-- Enter the region that you selected ) Default output format [None]: AWS IoT Just-in-Time Registration Setup Use the ZTUser account to configure AWS IoT settings. User Guide DS50002885A-page 34 © 2019 Microchip Technology Inc.
  • Page 35 “ZTLambdaJITR”. Select “Python 3.6” under the “Runtime” field, select “Choose an existing role” under the 'Role' field, and select the previously created “ZTLambdaJITRRole” under the 'Existing role' field. Click Create Function. User Guide DS50002885A-page 35 © 2019 Microchip Technology Inc.
  • Page 36 Go to the 'Act' section from the menu. Click the 'Create a rule' button. Fill in the following fields: – Name: ZeroTouchJustInTimeRegistration – SQL version: 2016-03-23 – Rule query statement: Select * FROM '$aws/events/certificates/registered/#' – Condition: User Guide DS50002885A-page 36 © 2019 Microchip Technology Inc.
  • Page 37 CA that was registered in the account. The # at the end indicates we want to trigger this rule for any CA registered with the account. Click Add action. Select Send a message to a Lambda Function. User Guide DS50002885A-page 37 © 2019 Microchip Technology Inc.
  • Page 38: Aws Iot Mobile App Setup

    Type in policy name (example: WiFiSmartDeviceAppPolicy). Note down this policy name, as this string will be used in the demo mobile app source code, when making the attach policy API call. User Guide DS50002885A-page 38 © 2019 Microchip Technology Inc.
  • Page 39 AWS IoT account. "Version": "2012-10-17", "Statement": [ "Effect": "Allow", "Action": "iot:Connect", "Resource": "*" "Effect": "Allow", "Action": "iot:Publish", "Resource": "*" "Effect": "Allow", "Action": "iot:Subscribe", "Resource": "*" "Effect": "Allow", "Action": "iot:Receive", "Resource": "*" User Guide DS50002885A-page 39 © 2019 Microchip Technology Inc.
  • Page 40: Amazon Cognito Setup

    12. Add the Callback URL with all the Alexa Smart Home Skill Re-direct URL. This URL can be found when you create Alexa Smart Home Skill in 7.1 Microchip Wi-Fi Smart Device Smart Home Skill Setup 13. Add https://www.google.com in the “Sign out URL” field. 14. Click Save changes. User Guide DS50002885A-page 40 © 2019 Microchip Technology Inc.
  • Page 41 18. Select "App clients settings". 19. In App Client setting of " WiFISmartDeviceForAlexaCustomSkill ", select the following check-boxes: – "Cognito User Pool" – "Authorization code grant" – "phone" – "email" – "openid" – "aws.cognito.signin.user.admin" User Guide DS50002885A-page 41 © 2019 Microchip Technology Inc.
  • Page 42 22. Select “Domain Name”, type the domain name. Click Save Changes. Change the domain name if the domain name is already used by another. Figure 5-26. Adding a Cognito Domain Name 23. Select “Users and groups” and click Create user. User Guide DS50002885A-page 42 © 2019 Microchip Technology Inc.
  • Page 43 29. In "Authentication providers" of the Identity pool setting, select “Cognito”. Type the “user pool ID” and the “App client ID” of "WiFISmartDeviceForAlexaCustomSkill " (The user pool ID and App client ID is found in the user pool setting page). User Guide DS50002885A-page 43 © 2019 Microchip Technology Inc.
  • Page 44 Access Management (IAM). The example format for the names are: Cognito_<Identity_Pool_Name>Auth_Role and Cognito_< Identity_Pool_Name >Unauth_Role. Click View Details to see details on the console. Figure 5-29. Roles Setup 31. Click Allow to create the roles. User Guide DS50002885A-page 44 © 2019 Microchip Technology Inc.
  • Page 45: Amazon Dynamodb Setup

    Click Create Table. Enter SensorBoardAcctTable in the “Table name” field, and thingID (String) in the “Primary key” field. Figure 5-30. Creating a DynamoDB Table Set table name to SensorBoardAcctTable Set Primary key to thingID User Guide DS50002885A-page 45 © 2019 Microchip Technology Inc.
  • Page 46: Aws Lambda Setup

    "AWSLambdaFullAccess" and "CloudWatchLogsFullAccess" policy). The following figure shows the “lambda_basic_execution” role. Go to IAM console, select “Roles” and select “lambda_basic_execution” role. Attach policy "AWSLambdaFullAccess" and "CloudWatchLogsFullAccess". Figure 5-31. Creating a Lambda Function User Guide DS50002885A-page 46 © 2019 Microchip Technology Inc.
  • Page 47 In “Function code”, edit index.js to add the AWS IoT Endpoint and the Region. The AWS IoT Endpoint can be found from the Settings page of AWS IoT Console. Figure 5-33. Editing index.js Add triggers "Alexa Smart Home", as shown in the following figure: User Guide DS50002885A-page 47 © 2019 Microchip Technology Inc.
  • Page 48 Go to AWS Lambda Console in AWS cloud https://console.aws.amazon.com/lambda. Click Create Function. Select "Author from scratch" and add a name for the Lambda function. The name can be “WiFi- Smart-Device-Kit-Custom-Skill”. Select "Node.js 6.10" for "Runtime". User Guide DS50002885A-page 48 © 2019 Microchip Technology Inc.
  • Page 49 – Select "Upload a .ZIP file" at "Code entry type". – Select \lambda-function\alexa-custom-skill\alexa-custom-skill.zip and click Save. User Guide DS50002885A-page 49 © 2019 Microchip Technology Inc.
  • Page 50 In “Function code”, edit index.js to add the AWS IoT Endpoint and the Region. The AWS IoT Endpoint can be found from the Settings page of AWS IoT Console. Figure 5-38. Editing index.js Add the trigger "Alexa Skill Kit" as shown in the following figure: Figure 5-39. Adding Triggers User Guide DS50002885A-page 50 © 2019 Microchip Technology Inc.
  • Page 51 10. Add the Skill ID in the “Skill ID” field, and enable the skill in skill configuration. Alexa Skill ID can be found in Alexa Skill configuration page (refer to 7. Alexa Skill Setup). The user can fill this information later after creating the Alexa skill. Figure 5-40. Configuring Triggers 11. Click Save. User Guide DS50002885A-page 51 © 2019 Microchip Technology Inc.
  • Page 52: Aws Provision Setup

    The script receives the CSR and signs it with the signer-ca private key. 4.4. Script sends it back to the ECC608 that stores it. Program the firmware of the project saml21g18b_sensor_board_demo_JITR.atsln to the board. User Guide DS50002885A-page 52 © 2019 Microchip Technology Inc.
  • Page 53 AP and gets the IP address. Lastly, LED LD2 turns steady blue, which indicates that the board is successfully connected to the AWS cloud. If commissioning other Sensor Board, follow the above steps (2-6). There is no need to create a new CERT. User Guide DS50002885A-page 53 © 2019 Microchip Technology Inc.
  • Page 54: Alexa Skill Setup

    5.6.1 Lambda Setup for Microchip Wi- Fi Smart Device Smart Home Skill before clicking the Save button, otherwise, it fails to save the endpoints. The Skill ID can be found in the following screen) User Guide DS50002885A-page 54 © 2019 Microchip Technology Inc.
  • Page 55 Redirect URLs in the Account Linking page are used as Callback URLs. These URLs must be filled in the Callback URLs of the Cognito user pool app client “WiFiSmartDeviceForAlexaSmartHomeSkill”. For more details, refer to 5.4 Amazon Cognito Setup. User Guide DS50002885A-page 55 © 2019 Microchip Technology Inc.
  • Page 56 – Does this skill contain advertising? * - No – Export Compliance * - tick the check box – Testing Instructions * - type Test 12. Click the Save and Continue button. User Guide DS50002885A-page 56 © 2019 Microchip Technology Inc.
  • Page 57 16. On the Alexa mobile application, select Skill -> Your Skills. The Alexa Skill that is created can be found on the application. 17. Enable the skill by logging in with Cognito user account. User Guide DS50002885A-page 57 © 2019 Microchip Technology Inc.
  • Page 58: Microchip Wi-Fi Sensor Board Skill Setup

    Log in with the Amazon developer credentials. If not registered, register and set the credentials. Select Alexa > Alexa Skills Kit > Create Skill. Add “Skill name” as WiFi Sensor Board Skill, choose model as “Custom” and click the Create skill button. User Guide DS50002885A-page 58 © 2019 Microchip Technology Inc.
  • Page 59 ATWINC15x0 Smart Device Kit Alexa Skill Setup Figure 7-8. Creating a New Custom Skill in Alexa In the Custom page, choose the template as “Start from scratch”. User Guide DS50002885A-page 59 © 2019 Microchip Technology Inc.
  • Page 60 ATWINC15x0 Smart Device Kit Alexa Skill Setup Figure 7-9. Choosing Start from Scratch Template Add the “Skill Invocation Name”. User Guide DS50002885A-page 60 © 2019 Microchip Technology Inc.
  • Page 61 ATWINC15x0 Smart Device Kit Alexa Skill Setup Figure 7-10. Skill Invocation Name Go to JSON Editor page, drag and drop the custom skill JSON file from the alexa-skill/ folder to JSON Editor. Click Save Model. User Guide DS50002885A-page 61 © 2019 Microchip Technology Inc.
  • Page 62 – AWS Lambda ARN – the Lambda ARN can be found from the AWS Lambda function setting page in 5.6.1 Lambda Setup for Microchip Wi-Fi Smart Device Smart Home Skill. 10. Default Region 11. Click Save Endpoints. User Guide DS50002885A-page 62 © 2019 Microchip Technology Inc.
  • Page 63 Figure 7-13. Linking an Account 13. Redirect URLs in the Account Linking page are used as Callback URLs. These URLs must be filled in the Callback URLs of the Cognito user pool app client User Guide DS50002885A-page 63 © 2019 Microchip Technology Inc.
  • Page 64 – Upload Small Skill Icon (108 x 108 pixel) – Upload Large Skill Icon (512x512 pixel) – “Category”: Education & Reference – “Keywords”: Sensor – “Privacy Policy URL”:http://microchip.com – “Terms of Use URL”:http://microchip.com User Guide DS50002885A-page 64 © 2019 Microchip Technology Inc.
  • Page 65 21. With the correct settings and values, Validation page displays “Zero errors found” message. Figure 7-17. Validation Page 22. Log in to your Alexa mobile application with your Alexa account. – Alexa mobile application can be downloaded from the link below: User Guide DS50002885A-page 65 © 2019 Microchip Technology Inc.
  • Page 66 26. The user can see following message on the application if the skill is successfully enabled and linked to Amazon Cognito. Figure 7-18. Mobile App Window 27. Select “Test” in the upper panel and type “open sensor board” to test the skill. User Guide DS50002885A-page 66 © 2019 Microchip Technology Inc.
  • Page 67 Figure 7-19. Testing the Skill 28. The welcome response sentence, “Welcome to Microchip Sensor board Skill…” is set in the Lambda function. It indicates that the Alexa skill can successfully connect to the Lambda function. User Guide DS50002885A-page 67 © 2019 Microchip Technology Inc.
  • Page 68 ATWINC15x0 Smart Device Kit Alexa Skill Setup Figure 7-20. Simulator Response User Guide DS50002885A-page 68 © 2019 Microchip Technology Inc.
  • Page 69: Appendix A: Software Installation

    The user can view the Python scripts to see the detailed steps involved. Download the installation file from:https://www.python.org/downloads/release/python-366/ Note:  Python 3.7.x and Python 2.x are not supported. Perform the following steps for installation: When installing Python 3.6.x, select 'Add Python 3.6 to PATH'. User Guide DS50002885A-page 69 © 2019 Microchip Technology Inc.
  • Page 70 Appendix A: Software Installation Figure 8-1. Adding the Path Choose 'Customize Installation' and make sure everything is selected. Click Next. Figure 8-2. Customizing Installation Select “Install for all users” and “Precompile standard library”. User Guide DS50002885A-page 70 © 2019 Microchip Technology Inc.
  • Page 71 To check the Environment Variable, press the <Windows key>. Go to System > Advanced system settings. 10. In the Advanced tab, click Environment Variables... and select the Path under “User variables” and “System variables.” 11. Click OK. User Guide DS50002885A-page 71 © 2019 Microchip Technology Inc.
  • Page 72: Python Package Manager

    Open the Start menu and search for 'cmd.' Right-click on 'Command Prompt' and select 'Run as Administrator.' In command prompt, navigate to the directory and run the following command: pip install –r requirements.txt. User Guide DS50002885A-page 72 © 2019 Microchip Technology Inc.
  • Page 73: Appendix B: Mobile Application Configuration

    This is the AWS Cognito Identity pool ID after creating the Cognito Identity pool. • AWS_IOT_POLICY This is the AWS IoT policy name used for the mobile application to access AWS IoT resources. • AWS_IOT_REGION This is the AWS IoT Region. • COGNITO_USER_POOL_ID User Guide DS50002885A-page 73 © 2019 Microchip Technology Inc.
  • Page 74: Ios Application

    • AWSRegion This is the AWS IoT Region. • CognitoIdentityUserPoolId This is the Cognito user pool id after creating the Cognito user pool. • CognitoRegion This is the Cognito region. • CognitoIdentityUserPoolAppClientId User Guide DS50002885A-page 74 © 2019 Microchip Technology Inc.
  • Page 75 This is the “WiFISmartDeviceForAlexaSmartHomeSkill” or “WiFISmartDeviceForAlexaCustomSkill” App client ID configured in the Cognito user pool. • CognitoIdentityUserPoolAppClientSecret This is the ”WiFISmartDeviceForAlexaSmartHomeSkill” or “WiFISmartDeviceForAlexaCustomSkill” App client secret configured in the Cognito user pool. User Guide DS50002885A-page 75 © 2019 Microchip Technology Inc.
  • Page 76: Appendix C: Aws Cloudformation To Setup Cloud

    Once logged in, change your region to the one closest to you by selecting the region menu (for example, US East Virginia). Alexa skills support only the following regions: – Asia Pacific (Tokyo) – EU (Ireland) – US East (N. Virginia) – US West (Oregon) User Guide DS50002885A-page 76 © 2019 Microchip Technology Inc.
  • Page 77 Appendix C: AWS CloudFormation to Setup Cl... Figure 10-1. Selecting the Region Go to https://console.aws.amazon.com/cloudformation and click the Create Stack drop-down. Figure 10-2. Creating a Stack Select “Upload a template to Amazon S3” and choose the \cloud-formation-templates \create_IAM.template.yaml. User Guide DS50002885A-page 77 © 2019 Microchip Technology Inc.
  • Page 78 Click the Next button. Enter “Stack name” as createIAM. Enter “UserPassword” as ZTUser. Click the Next button to continue. Figure 10-4. Stack Name and Parameters Tick the highlighted check box and click the Create button. User Guide DS50002885A-page 78 © 2019 Microchip Technology Inc.
  • Page 79 11. Go to IAM Console https://console.aws.amazon.com/iam/. 12. Select “ZTUser” from the “Users” in the left panel under the User name. Figure 10-7. User Selection 13. Click ZTUser > Security Credentials. Click the Create access key button. User Guide DS50002885A-page 79 © 2019 Microchip Technology Inc.
  • Page 80 Appendix C: AWS CloudFormation to Setup Cl... Figure 10-8. ZTUser Security Credentials 14. “Access key ID” and “Secret access key” are created. Copy the Access key ID and Secret access key for the following configurations. User Guide DS50002885A-page 80 © 2019 Microchip Technology Inc.
  • Page 81: Create Lambda Functions For Alexa

    AWS Secret Access Key [None]: <SECRETACCESSKEY> Default region name [None]: us-east-1 ( <-- Enter the region that you selected ) 10.2 Create Lambda Functions for Alexa Edit the \cloud-formation-templates\ createlambdaforalexa.template.yaml file. User Guide DS50002885A-page 81 © 2019 Microchip Technology Inc.
  • Page 82 --s3-bucket <YOUR BUCKET NAME> -- output-template-file createLambdaForAlexa.package.yaml. Figure 10-12. Console Log Run command: aws cloudformation deploy --template-file createLambdaForAlexa.package.yaml --stack-name createLambdaForAlexa -- capabilities CAPABILITY_NAMED_IAM --profile ZTUser. Figure 10-13. Console Log Go to https://console.aws.amazon.com/cloudformation to find the Stack “createLambdaForAlexa”. User Guide DS50002885A-page 82 © 2019 Microchip Technology Inc.
  • Page 83: Create Amazon Cognito For Alexa

    Add “CallbackURL” of “Wi-Fi Smart Device For Alexa Custom Skill” App Client from 7.2 Microchip Wi-Fi Sensor Board Skill Setup WiFISmartDeviceForAlexaCustomSkillClientSettings: Type: 'Custom::CognitoUserPoolClientSettings' Properties: ServiceToken: !GetAtt CloudFormationCognitoUserPoolClientSettings.Arn UserPoolId: !Ref UserPool UserPoolClientId: !Ref WiFISmartDeviceForAlexaCustomSkillClient SupportedIdentityProviders: - COGNITO CallbackURL: 'https://layla.amazon.com/api/skill/link/M2TDOWMJ3J2LNM,https:// alexa.amazon.co.jp/api/skill/link/M2TDOWMJ3J2LNM,https://pitangui.amazon.com/api/skill/ link/M2TDOWMJ3J2LN' LogoutURL: 'https://www.google.com' User Guide DS50002885A-page 83 © 2019 Microchip Technology Inc.
  • Page 84: Create Aws Iot Policy For Smartphone Application

    This section provides the steps to create AWS IoT policy used for the mobile application to access AWS IoT resources. The policy name is WiFiSmartDeviceAppPolicy by default but it can be changed in the create_iot_policy_mobile_app.template.yaml file. User Guide DS50002885A-page 84 © 2019 Microchip Technology Inc.
  • Page 85: Create Aws Dynamodb Table

    Create AWS DynamoDB Table Perform the following steps for creating AWS DynamoDB table: In the Command Prompt, run command: aws cloudformation package --template-file create_dynamodb.template.yaml --s3-bucket <YOUR BUCKET NAME> --output- template-file create_dynamodb.package.yaml. Figure 10-22. Console Log User Guide DS50002885A-page 85 © 2019 Microchip Technology Inc.
  • Page 86 Figure 10-23. Console Log Go to https://console.aws.amazon.com/cloudformation and find the stack “createDynamoDB”. A DynamoDB Table “SensorBoardAcctTable” is successfully created. Developer can check this in the AWS DynamoDB console. Figure 10-24. Status of createDynamoDB User Guide DS50002885A-page 86 © 2019 Microchip Technology Inc.
  • Page 87: Document Revision History

    ATWINC15x0 Smart Device Kit Document Revision History Document Revision History Revision Date Section Description 05/2019 Document Initial Revision User Guide DS50002885A-page 87 © 2019 Microchip Technology Inc.
  • Page 88: The Microchip Web Site

    Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. User Guide DS50002885A-page 88 © 2019 Microchip Technology Inc.
  • Page 89: Legal Notice

    SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
  • Page 90: Quality Management System Certified By Dnv

    ATWINC15x0 Smart Device Kit © 2019, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. ISBN: 978-1-5224-4498-5 Quality Management System Certified by DNV ISO/TS 16949 Microchip received ISO/TS-16949:2009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California ®...
  • Page 91: Worldwide Sales And Service

    New York, NY Sweden - Stockholm Tel: 631-435-6000 Tel: 46-8-5090-4654 San Jose, CA UK - Wokingham Tel: 408-735-9110 Tel: 44-118-921-5800 Tel: 408-436-4270 Fax: 44-118-921-5820 Canada - Toronto Tel: 905-695-1980 Fax: 905-695-2078 User Guide DS50002885A-page 91 © 2019 Microchip Technology Inc.

Table of Contents