me910c1 azure iot plug and play application note · me910c1 azure iot plug and play application...
TRANSCRIPT
1. INTRODUCTION
Scope
This document describes how to use ME910C1WW IoT wireless module as an Azure IoT plug and play device. Azure Plug and Play(PnP) simplifies IoT by allowing solution developers to integrate IoT devices without writing any device code. Using Plug and Play, device manufacturers will provide a device dapability model(DCM) of their device to cloud developers to be integrated quickly into IoT Central or any solution built on the Azure IoT platform. The ME910C1 model uses its own device capability model to demonstrate its properties and interface capabilities.
Overview
The following are the features implemented.
1 Azure IoT plug and play device. 2 Telemetry data for signal strength info. 3 Cloud to device messages i.e LED turn on/off, diagnostic Ping. 4 Azure device connection configuration resides on a “.CFG” file on
m2mb Module File System.
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 2 of 16 2020-05-08
2. GETTING STARTED
Prerequisites
1. ME910C1 IoT wireless module
2. Azure Account
3. Azure IoT Hub Instance
4. Azure IoT Hub Device Provisioning Service
5. Cellular Network connectivity
6. Get latest application code for Azure PnP
7. Azure IoT device explorer
8. Telit TATC console or Tera Term Application
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 3 of 16 2020-05-08
3. PREPARE THE ME910C1 EVALUATION BOARD
Hardware setup
The following picture represents ME910C1-WW IoT wireless module used for plug and play application, on top of the EVK2 Common Evaluation board.
Make sure you order both the Telit EVK2 evaluation board, plus the ME910C1-WW module interface. Contact our sales representative to see if you qualify for a free kit here: https://contact.telit.com/nbiot
For further information please visit:
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 4 of 16 2020-05-08
- https://www.telit.com/m2m-iot-products/cellular-modules/standard-industrial-grade/xe910-family/#ME910C1-downloads and download the Quick start guide and the Linux USB Drivers user guide
- https://www.telit.com/developer-zone/iot-app-zone/iot-app-zone-developer-resources/ and browse the AppZone C m2mb User Guide
Figure 1: ME910C1 IoT wireless module.
Software setup
3.2.1. Set up the module
As a prerequisite you need LTE-M or 2G connectivity to establish a connection to Azure IoT services.
For further information on how to setup a connection please visit https://www.telit.com/m2m-iot-products/cellular-modules/standard-industrial-grade/xe910-family/#ME910C1-downloads and download the Quick start guide and the Linux USB Drivers user guide.
The Quick start guide, section 4 will give you information on how to setup the connectivity.
The Linux USB Driver user guide will explain how to connect the module and how to flash it with the latest Telit base firmware
3.2.2. Download and install the binary
Note:- It is assumed that ME910 base firmware is preprogrammed and is compatible with the module application. For further info, please check the binary package readme file.
Follow the step by step procedure to load the application:
1 Download the application binary (link in the prerequisites) 2 Use the file browser, go to the folder where the binary/image file is located
and right click on the bin file and verify the memory size, as seen in the following figure:
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 5 of 16 2020-05-08
3 Check the device manager for the port connection, as seen in the following figure:
4 Open TATC tool (in the Telit download Zone) and connect to the USB of the module and go to the tab M2M_AppZone as shown below:
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 6 of 16 2020-05-08
Alternatively open a Tera Term session and connect to the COM port you identified
5 Issue the AT command AT#M2MCHDIR=”MOD”. This will move the MOD
directory of the file system.
6 Issue AT#M2MWRITE=<file name>, <size>, <permission>
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 7 of 16 2020-05-08
7 After executing AT#M2MWRITE command, a >>> prompt will be displayed:
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 8 of 16 2020-05-08
8 Click the transfer button indicated in red and select the application to download. Click Open button and the transfer will start.
9 The transfer pop-up will appear
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 9 of 16 2020-05-08
10 After the download is finished, the application must be set to start at the next start-up.
11 issue AT#M2MRUN=2, <filename>, in the example is
AT#M2MRUN=2,m2mapz.bin:
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 10 of 16 2020-05-08
4. INTEGRATION WITH IOT CENTRAL
Setup
Make sure you have an IoT Central Application configured
Go to https://apps.azureiotcentral.com/myapps and select the newly created IoT Central application
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 11 of 16 2020-05-08
Create a device template based on IoT Plug and Play
Now select Device templates and “use a preconfigured device template”. Browse for ME910C1 device and select it.
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 12 of 16 2020-05-08
Create a new device for enrollment
Go to Devices and create a new device based on the ME910C1 device template.
Click on the device and go to “connect”
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 13 of 16 2020-05-08
Edit, or take note of: - ID Scope - Device ID - Primary Key (ensure that connect method is Shared Access Signature)
Prepare your configuration file
The configuration file is a text file which contains the following information:
#M2M context info
pdp_context_cid=1
pdp_profile_name=YOUR_PDP_PROFILE_NAME
pdp_apn_name=YOUR_IOT_APN
#Azure PnP connection parameters
security_key=YOUR_AZURE_KEY
registration_id=YOUR_AZURE_DEVICE_ID
scope_id=YOUR_AZURE_SCOPE_ID
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 14 of 16 2020-05-08
Following is the description of the above confguration:
Configuration ID Description
pdp_context_cid (PDP Context Identifier) numeric parameter which specifies a PDP context definition
pdp_profile_name Profile Name for specific context identifier
pdp_apn_name APN Name for specific context identifier
security_key Symmetric key (used enrollment on the Device Provisioning Service)
registration_id The registration device ID is used to uniquely identify a device in the Device Provisioning Service.
scope_id The ID scope is assigned to a Device Provisioning Service
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 15 of 16 2020-05-08
Upload the configuration and start the application
Edit the configuration file on your PC and call it ms_az_pnp.cfg.
Upload the configuration file into /mod/ folder as specified in §3.2.2
Enable the connection and restart
Activate the PDP connection on CID 1 (Azure always uses Context-ID 1 ).
Caution or Warning – Make sure that the MS Windows(R) Operating System is not managing the cellular connectivity.
To avoid the above warning, while performing cellular connection ensure below selections:
On the open Terminal session (see §3.2.2) issue the command
AT#REBOOT
After the boot sequence completes, the device is ready to connect to Azure IoT services.
Perform analytics on IoT Central application
The device will start sending telemetry data, and it is possible to analyze it
ME910C1 Azure IoT Plug and Play Application Note
Rev 1 Page 16 of 16 2020-05-08
Send commands through IoT Central application
The device can execute commands as specified in the interface.
Following figure presents an example for a diagnostic ping command.