element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of Things
  • Technologies
  • More
Internet of Things
Blog Using The Avnet LTE IoT Starter Kit with Microsoft Azure
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Internet of Things to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: james.flynn
  • Date Created: 3 Dec 2018 4:45 PM Date Created
  • Views 1000 views
  • Likes 5 likes
  • Comments 0 comments
Related
Recommended

Using The Avnet LTE IoT Starter Kit with Microsoft Azure

james.flynn
james.flynn
3 Dec 2018

NOTE: In this Blog series, I go over the implementation of an Azure IoT application that is running on the Avnet LTE Starter Kit, running eLinux.  All source is provided/accessible so I hope it will provide you a starting point should you want to modify/extend it for your own use.  It is written in at an advanced C++/C level and utilizes concepts such as singleton classes and class member function referencing/calls. The Microsoft Azure IoT embedded C SDK is utilized for Azure interaction.

 

OverviewImage result for azure images

Having recently connected several devices to Microsoft’s Azure IoT Hub, I wanted to take a standalone device (something that only required a battery to power it) and implement it as a data collection device sending telemetry data to Azure.  I also wanted to be able to send messages from Azure back to the device and have it perform actions based on those messages. With those general requirements in mind, I decided to use the Avnet LTE IoT Starter KitAvnet LTE IoT Starter Kit with an LTE IoT Breakout CarrierLTE IoT Breakout Carrier.

 

imageimage

 

 

The LTE IoT Starter Kit is a small System-On-Module (SOM) that contains:

  • A Wistron NeWeb Corporation (WNC) M18QWG global LTE Cat-4 modem module
  • An ST LIS2DW12 (3-axis accelerometer)
  • An Ambient Light Sensor
  • A Temperature Sensor

 

I added the LTE IoT Breakout Carrier, so I could add additional sensors by adding MikroElektronika Click Boards.  In the example program, I support the Barometer Click  and the Temp&Humidity Click.  I check for these boards during power up and if they are present, modify the messages sent to include their data (or omit it if they are not present).

 

image

image

 

The M18QWG (I refer to as the M18Qx to be inclusive of the M18QWG [global RF support] and the M182FG-1 [North America RF support]) is based on a Qualcomm MDM9207. The MDM9207 is a quad core Cortex-A7; three of the cores are running firmware related to the Modem and its management, and one core is running embedded Linux (eLinux) and is available for user applications. This mode of operation is referred to as Host Mode because the eLinux is running in a standalone mode thus allowing for applications to run without the need for an external processor connected to the device. The eLinux console interacts with a user via ADB using the USB port.  To develop applications, a WNC SDK with  HW link-libraries are provided in a WNC SDK. 

 

To briefly overview the software operation, it sends telemetry messages repeatedly to Azure and monitors for in-coming messages.  When in-coming messages are received, the requested actions are performed.  The default telemetry message is sent every 10 seconds and looks like:

 

{
"ObjectName":"Avnet M18x LTE SOM Azure IoT Client",
 "ObjectType":"SensorData",
  "Version":"1.0",
 "ReportingDevice":"M18QWG/M18Q2FG-1",
 "DeviceICCID":"xxxxxxxxxxxxxxxxxxxxx",
 "DeviceIMEI":"xxxxxxxxxxxxxxx",
  "ADC_value":0.04,
  "last GPS fix":"Mon 2018-10-22 12:17:54",
  "lat":xx.xx,
  "long":xx.xx,
  "Temperature":82.29,
  "Board Moved":0,
  "Board Position":10,
  "Report Period":10,
  "TOD":"Mon 2018-10-22 12:17:55 UTC",
  "Barometer":1020.20,
  "Humidity":62.4
}

 

The first 4 items in this message are constant data (defined at compile time), but the remaining data is all dynamically obtained:

 

  • The ICCID and IMEI is read during startup and saved.  The ICCID is obtained from the SIM card you are using,
  • The IMEI is provided by the M18Qx HW itself (it is unique for each device).
  • The ADC_value is read from the light sensor when the message is sent
  • The ‘last GPS fix’ is the time that the Lat/Long data was obtained
  • The Lat and Long is the GPS Latitude and Longitude that the M18Qx GPS provides. 
  • The Temperature is read from the LIS2DW12 sensor each time a message is sent
  • The ‘Board Moved’ is a simple binary 1/0 that indicates that during the last reporting period, the M18Qx board has (1) or has-not (0) physically moved.
  • The ‘Board Position’ indicates the orientation of the board using the LIS2DW12 sensor.  Possible positions are (Face is the top of the Board containing the M18Qx):

image

  • The Report Period is the interval being used for sending the standard telemetry message in seconds (the default is 10)
  • TOD is the Time Of Day that the message is being sent

 

The last two elements are only sent if the Barometer and/or Temperature&Humidity Clicks are present:

  • If the Barometer Click is present, the barometric pressure (in mb) is sent.
  • If the Temperature&Humidity Click is present, the Humidity (in %) is sent.

 

The messages/commands you can send from Azure to the device are:

 

Message/Command

Description

REPORT-SENSORS

Reply with a list of available sensor

SET-PERIOD x

sets the reporting period for standard telemetry messages to x

GET-DEV-INFO

lists the information about this M18Qx device

GET-LOCATION

sends the current latitude/longitude location

GET-TEMP

sends the current temperature at the boards location

GET-POS

sends the positional information about the board

GET-ENV

sends environmental information about the boards location

LED-ON-MAGENTA

turns the boards LED to Magenta, always on

LED-BLINK-MAGENTA

turns the boards LED to Magenta, blinking

LED-OFF

turns off the boards LED

 

 

The example software application is implemented in both C and C++.  To the greatest extent possible, I wanted to to provide objects that could be easily re-used.  For example, I have used the LIS2DW12 sensor class on several projects by simply providing the I2C interface and interrupt pin definitions.  It has allowed me to all the necessary control functionality for managing the sensor itself--all this without having to re-implement the underlying registers/bits manipulation.  In the end, it helps quickly put a system together without having to re-implement a bunch of stuff multiple times.

 

The series of blogs related to this effort is:

 

Blog #1  Prerequisites (Azure IoT account)

 

Blog #2 - Tools and Software

 

Blog #3 Building The Program

 

Blog #4  SOM Architectural Elements

 

Blog #5  Modem Abstraction Layer (MAL)

 

I hope to provide you some insight into an IoT solution as well as a working example on using Microsoft Azure.   It is easy to read about Technology concepts and principles, but seeing its implementation has always helped me, I hope that it helps you also.

 

Blog #1  Prerequisites (Azure IoT account)

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube