20
WL865E4-P Azure IoT Plug and Play Application note 80613NT11831A Rev 0 2020-04-09

WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application note

80613NT11831A Rev 0 – 2020-04-09

Page 2: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 2 of 20 2020-04-16

NOTICE

COPYRIGHTS

COMPUTER SOFTWARE COPYRIGHTS

SPECIFICATIONS ARE SUBJECT TO CHANGE WITHOUT NOTICE

While reasonable efforts have been made to assure the accuracy of this document, Telit assumes no liability resulting from any inaccuracies or omissions in this document, or from use of the information obtained herein. The information in this document has been carefully checked and is believed to be reliable. However, no responsibility is assumed for inaccuracies or omissions. Telit reserves the right to make changes to any products described herein and reserves the right to revise this document and to make changes from time to time in content hereof with no obligation to notify any person of revisions or changes. Telit does not assume any liability arising out of the application or use of any product, software, or circuit described herein; neither does it convey license under its patent rights or the rights of others.

It is possible that this publication may contain references to, or information about Telit products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that Telit intends to announce such Telit products, programming, or services in your country.

This instruction manual and the Telit products described in this instruction manual may be, include or describe copyrighted Telit material, such as computer programs stored in semiconductor memories or other media. Laws in the Italy and other countries preserve for Telit and its licensors certain exclusive rights for copyrighted material, including the exclusive right to copy, reproduce in any form, distribute and make derivative works of the copyrighted material. Accordingly, any copyrighted material of Telit and its licensors contained herein or in the Telit products described in this instruction manual may not be copied, reproduced, distributed, merged or modified in any manner without the express written permission of Telit. Furthermore, the purchase of Telit products shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any license under the copyrights, patents or patent applications of Telit, as arises by operation of law in the sale of a product.

The Telit and 3rd Party supplied Software (SW) products described in this instruction manual may include copyrighted Telit and other 3rd Party supplied computer programs stored in semiconductor memories or other media. Laws in the Italy and other countries preserve for Telit and other 3rd Party supplied SW certain exclusive rights for copyrighted computer programs, including the exclusive right to copy or reproduce in any form the copyrighted computer program. Accordingly, any copyrighted Telit or other 3rd Party supplied SW computer programs contained in the Telit products described in this instruction manual may not be copied (reverse engineered) or reproduced in any manner without the express written permission of Telit or the 3rd Party SW supplier. Furthermore, the purchase of Telit products shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any license under the copyrights, patents or patent applications of Telit or other 3rd Party supplied SW, except for the normal non-exclusive, royalty free license to use that arises by operation of law in the sale of a product.

Page 3: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 3 of 20 2020-04-16

USAGE AND DISCLOSURE RESTRICTIONS

I. License Agreements

II. Copyrighted Materials

III. High Risk Materials

IV. Trademarks

V. Third Party Rights

The software described in this document is the property of Telit and its licensors. It is furnished by express license agreement only and may be used only in accordance with the terms of such an agreement.

Software and documentation are copyrighted materials. Making unauthorized copies is prohibited by law. No part of the software or documentation may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computer language, in any form or by any means, without prior written permission of Telit

Components, units, or third-party products used in the product described herein are NOT fault-tolerant and are NOT designed, manufactured, or intended for use as on-line control equipment in the following hazardous environments requiring fail-safe controls: the operation of Nuclear Facilities, Aircraft Navigation or Aircraft Communication Systems, Air Traffic Control, Life Support, or Weapons Systems (High Risk Activities"). Telit and its supplier(s) specifically disclaim any expressed or implied warranty of fitness for such High Risk Activities.

TELIT and the Stylized T Logo are registered in Trademark Office. All other product or service names are the property of their respective owners.

The software may include Third Party Right software. In this case you agree to comply with all terms and conditions imposed on you in respect of such separate software. In addition to Third Party Terms, the disclaimer of warranty and limitation of liability provisions in this License shall apply to the Third Party Right software.

TELIT HEREBY DISCLAIMS ANY AND ALL WARRANTIES EXPRESS OR IMPLIED FROM ANY THIRD PARTIES REGARDING ANY SEPARATE FILES, ANY THIRD PARTY MATERIALS INCLUDED IN THE SOFTWARE, ANY THIRD PARTY MATERIALS FROM WHICH THE SOFTWARE IS DERIVED (COLLECTIVELY “OTHER CODE”), AND THE USE OF ANY OR ALL THE OTHER CODE IN CONNECTION WITH THE SOFTWARE, INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE.

NO THIRD PARTY LICENSORS OF OTHER CODE SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND WHETHER MADE UNDER CONTRACT, TORT OR OTHER LEGAL THEORY, ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE OTHER CODE OR THE EXERCISE OF ANY RIGHTS GRANTED UNDER EITHER OR BOTH THIS LICENSE AND THE LEGAL TERMS APPLICABLE TO ANY SEPARATE FILES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Page 4: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 4 of 20 2020-04-16

APPLICABILITY TABLE

PRODUCTS

WL865E4-P

Note: The features described in the present document are provided by the products equipped with the software versions equal or higher than the versions shown in the table. See also the Document History chapter.

Page 5: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 5 of 20 2020-04-16

CONTENTS

NOTICE 2

COPYRIGHTS ................................................................................................ 2

COMPUTER SOFTWARE COPYRIGHTS ...................................................... 2

USAGE AND DISCLOSURE RESTRICTIONS ............................................... 3

APPLICABILITY TABLE ................................................................................ 4

CONTENTS .................................................................................................... 5

1. INTRODUCTION .......................................................................... 6

Scope ........................................................................................... 6

Overview....................................................................................... 6

2. PREREQUISITES ......................................................................... 7

3. PREPARE THE DEVICE .............................................................. 8

WL865E4-P Evaluation Board hardware setup ............................. 8

Software setup .............................................................................. 8

3.2.1. Download and install the binary .................................................... 8

3.2.2. Prepare your configuration file ...................................................... 8

3.2.3. Upload the configuration and start the application ......................... 9

4. INTEGRATION WITH IOT CENTRAL ........................................ 11

Setup .......................................................................................... 11

5. WL865E4-P PNP DEVICE WITH AZURE IOT EXPLORER ....... 12

6. COMMANDS .............................................................................. 18

DOCUMENT HISTORY ................................................................................ 19

Page 6: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 6 of 20 2020-04-16

1. INTRODUCTION

Scope

This document describes how to use WL865E4P Device as an Azure IoT plug and play device. Azure Plug and Play simplifies IoT by allowing solution developers to integrate devices without writing any device code. Using Plug and Play, device manufacturers will provide a model of their device to cloud developers to be integrated quickly into IoT Central or any solution built on the Azure IoT platform. The WL865E4P model uses its own device capability model to demonstrate its interface capabilities.

Overview

The following are the feature implementation.

1 Azure IoT plug and play device. 2 Implements telemetry data for temperature, pressure, light and humidity sensors. 3 Cloud to device messages i.e LED turn on/turn off/Ping. 4 Dynamic azure configuration loading capability through uart port.

Page 7: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 7 of 20 2020-04-16

2. PREREQUISITES

1. WL865E4-P Evaluation Board 2. Azure Account 3. Azure IoT Hub Instance 4. Azure IoT Hub Device Provisioning Service 5. Wireless Network connectivity (Wi-Fi™) 6. Get latest application code for Azure PnP 7. (Recommended) Tera Term Application

Page 8: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 8 of 20 2020-04-16

3. PREPARE THE DEVICE

WL865E4-P Evaluation Board hardware setup

Following is the diagramatic representation of the WL865E4-P evaluation board used for plug and play application:

Figure 1: WL865E4-P Evaluation Board.

Please visit the following link:

https://www.telit.com/m2m-iot-products/wifi-bluetooth-modules/wi-fi-wl865e4-p/

and download the WL865E4-P EVB User Guide.

Software setup

3.2.1. Download and install the binary

From the WL865E4-P EVB User Guide, please refer to section 4.1 and 4.2 to install the binary (Prerequisite 6 – “Get latest application code for Azure PnP”)

3.2.2. Prepare your configuration file

The configuration file is a json file which contains the following information:

{

"azure_profile": {

"wlan_cfg": {

"ssid": "YOUR_WLAN_SSID",

"pwd": "YOUR_WLAN_KEY"

},

Page 9: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 9 of 20 2020-04-16

"azure_cfg": {

"symm_key": "YOUR_AZURE_KEY",

"device_id": "YOUR_AZURE_DEVICE_ID",

"prov_scope": "YOUR_AZURE_DEVICE_PROVISIONING_SCOPE_ID"

}

}

}

Following is the description of the above confguration:

Configuration ID Description

WLAN SSID Access Point SSID information

WLAN PWD Access Point password

Azure symm_key Symmetric key used for azure dps provisioning

Azure device_id Device registration id used for azure dps provisioning

Azure prov_scope DPS provisioning scope id

3.2.3. Upload the configuration and start the application

1 Open a Tera Term session and connect to the device 2 Take note of the file size in bytes 3 Load the configuration when the device boots up with the following command

LD <filesize> [Data File prompt]

Tera Term prompts you to select the configuration file

Page 10: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 10 of 20 2020-04-16

4 Start the application using ST command:

#ST

Application will start running and providing a log of operations. For further information please check application package (Prerequisite 6 – “Get latest application code for Azure PnP”).

Page 11: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 11 of 20 2020-04-16

4. INTEGRATION WITH IOT CENTRAL

Setup

Please refer to this guide for further information https://github.com/Azure/azure-iot-device-ecosystem/blob/master/get_started/pnp-esp32-azure-kit-c.md

Page 12: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 12 of 20 2020-04-16

5. WL865E4-P PNP DEVICE WITH AZURE IOT EXPLORER

Azure IoT explorer is used to verify the plug and play feature. This tool is used to send commands and monitor the telemetry data from the device.

Following are the steps to use WL865E4-P PNP device with IoT explorer:

1. Update the IoT hub connection string in Azure IoT explorer.

2. Run WL865E4-P PNP device with the DPS information, which connects to the above mentioned IoT hub. User is required to wait for status of the device to show as “Connected”. Usually it takes 60 seconds to connect the azure IoT hub after DPS provisioning.

Page 13: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 13 of 20 2020-04-16

3. Go to Settings and update the azure device capability model-set the company model capability connection string:

4. After getting connected, open the WL865E4-P PNP device and select plug and play component:

5. Open the sensor to view the interface details, properties, commands and telemetry data.

6. Show Interface parameters: a. Properties non-writable: rssi value, ap ssid and heap information.

Page 14: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 14 of 20 2020-04-16

b. Click on Heap information to see the details.

c. Properties: Writable

Only company name is supported which can be updated as shown below.

Page 15: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 15 of 20 2020-04-16

7. Commands

a. LED turn Off command

Click on the send command and verify the LED is turned OFF.

b. LED turn On

Click on the send command and verify the LED is turned ON.

Page 16: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 16 of 20 2020-04-16

Page 17: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 17 of 20 2020-04-16

c. Ping Command

8. Telemetry data

a. WL865E4-P PNP device sends sensor data for light, temperature, pressure and humidity periodically.

b. Run-the sensor capture start to observe the above details.

Page 18: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 18 of 20 2020-04-16

6. COMMANDS

Following are the commands used in Plug and Play application:

Command Description

LD <filesize><data> To load confg.json file,

<filesize>: It is the length of the Azure configuration file in integer format.

<data>: It is the binary file to upload.

RD To read Azure profile configuration.

ST To start the application.

Page 19: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document

WL865E4-P Azure IoT Plug and Play Application Note

80613NT11831A Rev 0 Page 19 of 20 2020-04-16

DOCUMENT HISTORY

Revision Date Changes

0 2020-04-16 First issue

Page 20: WL865E4-P Azure IoT Plug and Play Application Note · WL865E4-P Azure IoT Plug and Play Application Note 80613NT11831A Rev 0 Page 6 of 20 2020-04-16 1. INTRODUCTION Scope This document