important: do not use the k64f with windows...

33
Page 1 Copyright © 2017 Avnet, Inc. AVNET, “Reach Further,” and the AV logo are registered trademarks of Avnet, Inc. All other brands are the property of their respective owners. LIT# 5176-GSG-ATT-IOT_v1 NOTICE OF DISCLAIMER: Avnet is providing this design, code, or information "as is." By providing the design, code, or information as one possible implementation of this feature, application, or standard, Avnet makes no representation that this implementation is free from any claims of infringement. You are responsible for obtaining any rights you may require for your implementation. Avnet expressly disclaims any warranty whatsoever with respect to the adequacy of the implementation, including but not limited to any warranties or representations that this implementation is free from claims of infringement and any implied warranties of merchantability or fitness for a particular purpose. IMPORTANT: DO NOT USE THE K64F WITH WINDOWS8/10 WITH STORAGE SERVICES ENABLED! DISABLE WINDOWSSTORAGE SERVICES ON WINDOWS™ 8/10 BEFORE PLUGGING IN K64F TO A PC!!! Explanation: A bug in older versions of the ARM™ bootloader firmware can cause the K64F board to have corrupted flash and become unusable until a JTAG device is used to reprogram. Clearer instructions are being constructed and will be made available at a future date! Once NXP™ version 0243 (or later) K64F firmwares (BOTH bootloader and DAPLink must be upgraded) are programmed into the K64F, it should be safe to use Windows™ 8/ 10 with or without Storage Services enabled. Workarounds: 1) Do not use Windows8/10 with firmware older than 0243. 2) Disable WindowsStorage Services before plugging in the K64F board. 3) Upgrade the firmware to the latest on the NXPwebsite with Windows7 before using Windows8/10 if you are not able or want to disable windows storage services! AT&T Cellular IoT Kit Getting Started Guide Version 1.4 June 10, 2017

Upload: others

Post on 28-Jan-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

  • Page 1

    Copyright © 2017 Avnet, Inc. AVNET, “Reach Further,” and the AV logo are registered trademarks of Avnet, Inc. All other brands are the property of their respective owners.

    LIT# 5176-GSG-ATT-IOT_v1

    NOTICE OF DISCLAIMER: Avnet is providing this design, code, or information "as is." By providing the design, code, or information as one possible implementation of this feature, application, or standard, Avnet makes no representation that this implementation is free from any claims of infringement. You are responsible for obtaining any rights you may require for your implementation. Avnet expressly disclaims any warranty whatsoever with respect to the adequacy of the implementation, including but not limited to any warranties or representations that this implementation is free from claims of infringement and any implied warranties of merchantability or fitness for a particular purpose.

    IMPORTANT: DO NOT USE THE K64F WITH WINDOWS™ 8/10 WITH STORAGE

    SERVICES ENABLED! DISABLE WINDOWS™ STORAGE SERVICES ON WINDOWS™

    8/10 BEFORE PLUGGING IN K64F TO A PC!!!

    Explanation: A bug in older versions of the ARM™ bootloader firmware can cause the

    K64F board to have corrupted flash and become unusable until a JTAG device is used to

    reprogram. Clearer instructions are being constructed and will be made available at a

    future date!

    Once NXP™ version 0243 (or later) K64F firmwares (BOTH bootloader and DAPLink must

    be upgraded) are programmed into the K64F, it should be safe to use Windows™ 8/10

    with or without Storage Services enabled.

    Workarounds: 1) Do not use Windows™ 8/10 with firmware older than 0243. 2) Disable

    Windows™ Storage Services before plugging in the K64F board. 3) Upgrade the

    firmware to the latest on the NXP™ website with Windows™ 7 before using Windows™

    8/10 if you are not able or want to disable windows storage services!

    AT&T Cellular IoT Kit Getting Started Guide Version 1.4 June 10, 2017

  • Page 2

    Revision History Document Version: Version 1.4

    Document Date: 15 August 2016

    Prior Version History: Version: Date: Comment:

    1.0 2016/08/18 Initial Release

    1.1 2016/08/25 URL corrections

    1.2 2016/11/10 Updated URL correction for OOB demo

    1.3 2016/11/29 Added firmware upgrade topic, point to AT&Ts web-site, point to Avnet ARM mbed website.

    1.4 2017/6/10 Fixed page numbers from re-branding, removed instructions to upgrade firmware for K64F.

    Comments:

  • Page 3

    Contents

    Revision History .......................................................................................................... 2

    Introduction ................................................................................................................. 4

    Kit Contents .......................................................................................................................................... 5

    NXT FRDM-K64F Single Board Computer (SBC) ............................................................................... 6

    WNC-Shield Board ............................................................................................................................... 6

    IoT Kit Software .................................................................................................................................... 7

    Cellular Shield WNC 14A2A Firmware ................................................................................................ 7

    Creating Online Accounts ............................................................................................ 7

    Cloudconnectkits.org Account .............................................................................................................. 7

    Jasper Account for SIM Card ............................................................................................................... 9

    ARM mbed.org Account ..................................................................................................................... 10

    AT&T Flow and M2X Accounts .......................................................................................................... 11

    Flow Account .................................................................................................................. 11

    M2X Account ................................................................................................................... 14

    Connect Flow and M2X ................................................................................................... 14

    Assembling the AT&T IoT Kit Hardware .................................................................... 17

    SBC Firmware .................................................................................................................................... 18

    Importing, Compiling, and Programming AT&T IoT Kit Software .............................. 19

    Compiling ........................................................................................................................................... 19

    Programming ...................................................................................................................................... 22

    Running Example Software ....................................................................................... 23

    Install the COM driver (Windows) ...................................................................................................... 23

    Install/Setup of Terminal Program ...................................................................................................... 24

    Running the IoT Flow and M2X Program ........................................................................................... 24

    Getting Help and Support .......................................................................................... 25

    Appendix A: Extending Shield Card Capabilities with External Sensors ................... 25

    Silicon Labs PMOD Sensor Auxiliary Board ...................................................................................... 26

    Seeedstudio Xadow v2 GPS module ................................................................................................. 26

    FRDM-K64F Software Modifications .................................................................................................. 26

    Appendix B: Charting/Graphing Capabilities ............................................................. 28

    Appendix C: M2X TRIGGERS ................................................................................... 30

    Appendix D: Data Processing in Flow ....................................................................... 32

    Appendix E: Avnet ARM mbed C++ Libraries and Example Programs ..................... 33

  • Page 4

    Introduction This guide provides an overview of the Avnet AT&T Cellular IoT Starter Kit hardware and

    software. The guide includes steps that allow you to quickly begin using the kit. The example

    software lets you take measurements using various sensors and send the values to the AT&T

    M2X/Flow server. Commands, in the form of JSON strings, are sent back to the IoT Starter Kit

    from the cloud and instruct the device to control on-board components such as the user LED.

    The IoT Starter Kit consists of a hardware platform comprised of an NXP FRDM-K64F single-

    board computer (SBC) and an Avnet Arduino-compatible WNC Cellular modem shield mounted

    on top. The WNC modem sends/receives data via cellular data link back to the AT&T M2X/Flow

    website. System data flow is shown below.

    M2X FLOW

    Data to WNC

    Module

    LTE Cat1

    I2C Data From HTS221 Sensor and WNC

    Module

  • Page 5

    Kit Contents The kit contains all the elements needed to implement a complete wireless IoT solution. It

    includes all the components shown and described below:

    – AT&T IoT SIM Starter Pack

    – Quick Start Card

    – Downloadable example designs and tutorials

    – Forum support via: http://cloudconnectkits.org/forum/topic/att-cellular-iot-starter-kit

    Arduino compatible WNC-Shield

    NXP K64F MCU carrier board with

    Arduino™ R3 expansion slot

    2 LTE antennas

    2 USB cables

    AC power adapter to USB DC 5V

    http://cloudconnectkits.org/forum/topic/att-cellular-iot-starter-kit

  • Page 6

    NXT FRDM-K64F Single Board Computer (SBC) The NXP FRDM-K64F SBC is the host development and operational platform (the controller).

    The elements used by the IoT Kit are as follows:

    – MK64FN1M0VLL12 MCU (120 MHz, 1 MB flash memory, 256 KB RAM, USB) which is based on a Cortex M4 ARM processor core

    – RGB LED

    – The OpenSDAv2 debug circuit supporting the CMSIS-DAP Interface to allow programming and monitoring software

    – Serial port interface

    – I2C interface for communicating with off-board sensors

    – UART interface for communicating with the WNC-Shield card

    WNC-Shield Board Avnet has produced an Arduino Shield with a Wistron NeWeb

    Corporation (WNC) M14A2A cellular module. This module

    contains all necessary protocol stack functionality needed to

    establish and maintain a data connection in an LTE network.

    The WNC cellular module is controlled/managed via AT

    commands exchanged using a serial port connection to the

    FRDM-K64F. This is referred by WNC as a Type III interface

    to allow support for the 3GPP defined AT commands plus proprietary AT commands.

    The block diagram for the WNC-Shield is shown below:

  • Page 7

    IoT Kit Software The NXP FRDM-K64F SBC uses the ARM mBed operating software and associated

    development tools. This allows all development to take place in a Web browser (e.g., Firefox,

    Chrome, or Explorer) and removes the need to install tools on your PC. Once installed on the

    Freedom board, the software uses various interfaces such as I2C, GPIOs, and UARTS.

    At power up, the software configures the hardware and initializes the WNC-Shield card which

    can take up to 60 seconds to complete.

    Cellular Shield WNC 14A2A Firmware Before assembling the kit or proceeding to the next steps, please ensure you are using the

    latest WNC 14A2A firmware. Instructions for how to upgrade the firmware can be found on the

    AT&T website:

    https://starterkit.att.com/tutorials/cellular-shield-firmware-upgrade

    Note: Please carefully read all of the instructions before performing the firmware upgrade, there

    are several steps that are not intuitive.

    Creating Online Accounts There are five accounts required to use the IoT Kit:

    1. Cloudconnectkits.org account for kit registration

    2. Jasper account for SIM card registration

    3. ARM Mbed.org account for compiling and modifying the SBC/WNC-Shield software

    4. AT&T Flow account for implementing the sensor data

    5. AT&T M2X account for an end-point device used by Flow. Essentially, this is the location where sensor data is stored to and read from.

    Cloudconnectkits.org Account After obtaining the IoT Kit, it is best to register at www.cloudconnectkits.org to be aware of any

    firmware/software updates as well as other information.

    1. Navigate to www.cloudconnectkits.org .

    2. Press the Sign In/Register button. A drop-down appears from which you can create an account.

    https://starterkit.att.com/tutorials/cellular-shield-firmware-upgradehttp://www.cloudconnectkits.org/http://www.cloudconnectkits.org/

  • Page 8

    3. When asked for the Serial Kit Number, use the WNC Serial Number (S/N) as shown below.

    4. Once registered, you are logged into the site. A confirmation email is sent to the email address you provided. You now have access to several product support pages as shown.

  • Page 9

    From the AT&T Cellular IoT Starter Kit page, you can view much of the kit’s design

    documentation, bill of materials, and other information.

    Jasper Account for SIM Card You have a choice between purchasing a SIM Card or a complete hardware kit. Both choices

    come with a data plan and the connectivity API. You must also obtain a free IoT Developer

    Services account by registering at https://StarterKit.att.com.

    Once registered, the IoT Developer Services account provides 300 MB of data and 300 SMS

    messages.

    https://starterkit.att.com/

  • Page 10

    ARM mbed.org Account The software associated with the IoT Kit is located on mbed.org. If you do not have an account,

    navigate to the mbed website (https://developer.mbed.org/) and follow the instructions to create

    an account.

    https://developer.mbed.org/

  • Page 11

    Once you have an account, you can download and modify the firmware for the kit.

    AT&T Flow and M2X Accounts To begin using the AT&T Flow and M2X accounts, you need to sign up for an AT&T IoT

    Services account. This is done by going to https://m2x.att.com/signup and creating an account.

    Once you are registered, use these same credentials for your Flow account (https://flow.att.com )

    and your M2X account (https://m2x.att.com ). The IoT Kit takes advantage of the fact Flow can

    create the necessary M2X device and streams. To learn how to set up a device manually, go to

    https://m2x.att.com/onboarding.

    Flow Account Flow can be entered by selecting Flow from the AT&T IoT Services account dropdown menu, as

    shown:

    https://m2x.att.com/signup%20andhttps://flow.att.com/https://m2x.att.com/https://m2x.att.com/onboarding

  • Page 12

    Flow is a GUI-based IoT development tool based on NodeJS. It allows for data input and output

    along with user defined rules for up to 100,000 data points per month free of charge. Data flows

    through nodes from left to right when viewing a Flow. To learn more about Flow, see

    https://flow.att.com/start.

    Note: Unlike M2X, Flow times out after a few minutes of inactivity. When this happens, simply

    click the Log In button to log back in. Even when you have a fast connection, Flow is slow to

    respond.

    If you want to learn by creating your own Flow design from scratch, you can follow AT&T’s

    instructions that were created for a recent event at:

    https://att.app.box.com/s/15umqzirkrmgru2yl7utbp8x4jv0bgmg.

    For the IoT Kit, we start by copying a reference design and modifying it. Each Flow design is

    unique in terms of its endpoint addresses and account keys, so you need to edit these unique

    parameters.

    To duplicate an existing project, follow these steps:

    https://flow.att.com/starthttps://att.app.box.com/s/15umqzirkrmgru2yl7utbp8x4jv0bgmg

  • Page 13

    1. On the lower left side of the Flow IDE, click Resources > Projects Library.

    2. In the top middle, under Search Projects, enter Avnet Starter Kit.

    3. Click Avnet Starter Kit dev.

    4. Click the Fork button in the top right to create a copy of the project for your exclusive use.

    5. Hover your curser to the right of the new name and click the pencil to change the name to something unique (e.g., Paul’s Starter Kit Dev). Then click the Fork button.

    6. Once the project is Forked, click the Deploy button.

    This compiles and activates your project. This step takes a minute the first time. Subsequent

    deploy actions will be quicker. Now that the project is built and deployed, modifications to the

  • Page 14

    WNC-Shield software must be made for it to work properly. These changes are detailed in the

    section on Compiling.

    M2X Account M2X is a time-series data store that is free for up to 10 devices. Navigate to https://m2x.att.com

    or access it from within your AT&T IoT Services Account.

    When we connect Flow and M2X projects, we will use Flow to create the necessary devices and

    streams.

    Connect Flow and M2X At this point, it is easiest to have two browser windows open (one for M2X and one for Flow)

    because the M2X master key must be pasted into the Flow Configuration Function.

    1. In M2X, click the Hello power button on the top right and select Account Settings.

    2. Highlight the Master Key and copy it to the clipboard.

    https://m2x.att.com/

  • Page 15

    3. Return to Flow in your other window/tab and find the Configuration function. Notice the graphical design has different tabs for each logical section. The Configuration function is on the Data tab.

    4. Double-click the Configuration function and a window with the JavaScript appears. Paste the key you previously copied into the location of the current M2X-Key field and click the OK button. It may take a while for the script to update.

    5. At the bottom of the canvas (where the configuration bubble is located), click the Endpoints tab where the Base URL field is located. Click the Copy button. The copied information is used to update two fields: base_hostname and base_url.

  • Page 16

    The Base URL is:

    https://run-west.att.io/1e464b19cdcde/774c88d68202/86694923d5bf28a/in/flow.

    The first part, run-west.att.io, is the base_hostname. The base_url is, above, displayed in

    green.

    6. Open the Configuration function and paste the fields where they belong. Click the OK button.

    7. With the configuration updated, a blue dot appears on your function graphic. This indicates it has changed but has not been deployed. Click the Deploy button to resolve this.

    8. Flow automatically creates a Virtual Device in M2X for you. This is a one-time operation that has to be performed. In Flow, go to the Virtual Device tab of the canvas and find the Initialize component in the bottom left. Click once on the solid part to the left of Initialize.

  • Page 17

    9. You can verify the component has been created in the M2X environment by returning to your M2X window and clicking Devices. Your virtual device should appear. If you expand it by clicking the plus sign (+), you will see the different M2X streams that have been created for it.

    Assembling the AT&T IoT Kit Hardware The hardware is delivered as two separate boards. Use the following instructions to connect the

    boards.

  • Page 18

    1. Plug the Avnet Cellular shield onto the Arduino connectors on the FRDM-K64F board.

    2. Plug the supplied AT&T SIM card into the SIM socket (X3) on the shield.

    3. Screw the two antennas to the shield SMAs connectors (X1, X2).

    4. The cellular shield requires 5V power supplied by the included AC/DC power adapter. It is not recommended to use a laptop USB port for this power source due to the limited power capabilities of most USB ports. Plug a microUSB cable into the 5V USB shield power (X5) on the Cellular shield and connect the other end of the cable to the provided AC/DC supply. LED1 illuminates light green.

    5. Plug a microUSB cable into the SDA USB (J26) port on the FRDM-K64F board. Connect the other end of the cable to a USB port on your laptop. The kit should enumerate as a standard MBED USB drive.

    SBC Firmware With the hardware setup, connect to a PC and ensure it enumerates as a drive (Ex: C:\MBED).

    Note: there is no known reason to upgrade the K64F firmware for the purposes of this kit.

    Newer versions of firmware have not been verified to work with the Starter Kit (but they MAY

    work). Upgrade at your own risk and consider that NXP does not appear to keep older versions

    of firmware on their web-site. Instructions for how to upgrade the K64F Freedom Board

    firmware is outlined here:

    https://developer.mbed.org/handbook/Firmware-FRDM-K64F

    https://developer.mbed.org/handbook/Firmware-FRDM-K64F

  • Page 19

    Importing, Compiling, and Programming AT&T IoT Kit Software You are not required to import and compile the IoT Kit software as it can be downloaded and

    loaded into the IoT Kit from http://cloudconnectkits.org/att-quickstart-binary.

    If you download the binary, the IoT Kit will only interact with the example Flow program. To use

    the binary, download it and extract it to a destination folder and jump to the

    Programming section. Otherwise, continue with this section.

    To create your cellular application project to run on the FRDM-K64F board, log into your

    mbed.org account and navigate to

    https://developer.mbed.org/teams/Avnet/code/Avnet_ATT_Cellular_IOT/

    Select the Import this Program button. Your screen should appear as follows:

    After clicking the Import button, the development environment opens and the code for the

    FRDM-K64F board is imported. A dialog box (as shown below) appears. Accept the defaults.

    Note: please use mbed tagged versions of source and libraries to ensure proper behavior, first

    import the tip revisions and then revert your project to a tagged revision. This is accessible from

    the “Revision” button in the compiler interface. After generating revisions, then Right-Click on

    the tag and choose “Revert working copy to this revision”

    Compiling

    http://cloudconnectkits.org/att-quickstart-binaryhttps://developer.mbed.org/teams/Avnet/code/Avnet_ATT_Cellular_IOT/

  • Page 20

    Prior to compiling the software, some modifications must be made to ensure it operates

    properly. These changes are isolated to the config_me.h file located in the

    Avnet_ATT_Cellular_IOT project.

    The parts that require updating in config_me.h are MY_SERVER_URL (1),

    FLOW_BASE_URL (2), and FLOW_DEVICE_NAME (3).

    The correct values for the defines are obtained by clicking the Climate GET cell, opening

    Endpoints, and obtaining the Base URL (shown below).

  • Page 21

    Edit the config_me.h file and update each define with the correct information.

    To obtain the FLOW_DEVICE_NAME, navigate to the M2X page and select the Virtual Starter

    Kit created previously.

  • Page 22

    The details for the Kit are displayed as shown. The FLOW_DEVICE_NAME is listed under

    DEVICE SERIAL.

    After making these modifications to the config_me.h file, click the Save button and the

    Compile button along the top bar. The source files are compiled and the binary programming

    file, Avnet_ATT_Cellular_IOT.bin, is saved to your default Download folder. Depending on the

    browser you are using or the browser’s settings, you may be prompted for a location to save the

    file.

    Other noteworthy fields in config_me.h are:

    – FLOW_INPUT_NAME – The HTTP IN port in the Flow project where you want to send sensor data. In the default Flow image, this input is inside the Climate GET port and is named /climate.

    – SENSOR_UPDATE_INTERVAL_MS – The update period for sending sensor data to Flow. The default for this is 5 seconds.

    Programming Disconnect, and then reconnect the USB cable from your laptop to the FRDM-K64F board to

    force a board power cycle. Once the MBED drive is enumerated, drag and drop the

    Avnet_ATT_Cellular_IOT.bin you just created to the MBED drive. This will program the non-

    volatile Flash memory on the FRDM-K64F board with your application firmware. Programming

    should take about 10 seconds, during which time the FRDM-K64F board green LED should go

    through several flashing sequences.

    Once programming is complete, unplug the USB cables from your laptop and from the AC/DC

    power adapter. Then reconnect the cables, connecting the 5V USB power cable to the power

    adapter first, followed by the SDA USB cable to the laptop.

  • Page 23

    Running Example Software Install the COM driver (Windows) Prior to running the SBC software for the AT&T IoT Kit, you need to install the necessary serial

    port driver to allow Windows to see program output.

    Follow the instructions at: https://developer.mbed.org/handbook/Windows-serial-configuration.

    After the serial drivers have been installed, determine which COM port is being used by opening

    the device manager.

    Once selected, the device manager is displayed and the serial port connected to the WNC-

    Shield is listed under the Ports (COM & LPT).

    https://developer.mbed.org/handbook/Windows-serial-configuration

  • Page 24

    Install/Setup of Terminal Program You need a terminal program to monitor the output from the FRDM-K64F program. The mbed

    site (https://developer.mbed.org/handbook/Terminals) provides instructions for setting up a

    terminal on a Windows, MAC, or Linux computer. With a terminal program installed, configure

    the following parameters:

    – Baud = 115200

    – Stop Bits = 1

    – Parity = None

    – Data bits = 8

    – Flow Control = none

    – COM port set appropriately (in the above screen shot, it is COM19)

    Running the IoT Flow and M2X Program The final step is running the IoT Flow/M2X programs and checking to see if everything works.

    FRDM-K64F Operation: The user LED on the FRDM-K64F board should be RED when the

    wireless connection is first powered on. It turns BLUE when it successfully connects to the

    AT&T network and then either green, magenta or turquoise, depending on the response from

    the Flow project implementation. The data being sent can also be monitored through the

    terminal connection that was previously set up.

    Flow/M2X Operation: To verify messages from the board are arriving in Flow, go to the Flow

    project and click the Debug tab at the bottom of the canvas. Because the board is doing an

    HTTP GET, data currently enters the Flow design through the bottom HTTP IN port. Messages

    with sensor information start appearing. There are debug messages from both the input and

    output debug ports. You can enable/disable these debug messages by clicking the solid part to

    the right of the port.

    https://developer.mbed.org/handbook/Terminals

  • Page 25

    1. Unsolicited messages cannot currently be sent to the board. A response to the HTTP GET message and the subsequent M2X posting, can however be created. On the Flow canvas (Data tab), double-click the Set Board LED function. Examine how the decision for setting the LED color is made.

    2.

    3.

    4. In the mbed project, open main.cpp. Use CTRL+F to find the function parse_JSON. Observe how the JSON response from the board is parsed to extract the LED color setting. This simple example can be modified to send your own JSON messages from the Flow environment and to interpret them on the board side.

    Getting Help and Support To download additional information on the kit, including board schematics, firmware updates,

    etc., visit: www.cloudconnectkits.org/product/att-cellular-iot-starter-kit.

    Appendix A: Extending Shield Card Capabilities with External Sensors By default, the mbed project sends the following sensor data to Flow:

    – Temperature and humidity from the HTS221 device on the Cellular shield

    – Accelerometer X, Y and Z-axis readings from the FXOS8700CQ motion sensor on the FRDM-K64F board

    In addition to the above, other sensor inputs can be provided via the PMOD connector on the

    WNC Shield.

    Here are two examples of I2C sensors:

    http://www.cloudconnectkits.org/product/att-cellular-iot-starter-kit

  • Page 26

    Silicon Labs PMOD Sensor Auxiliary Board This is a sensor module that measures proximity, UV light, ambient visible

    and infrared light using a Si1145 sensor.

    Seeedstudio Xadow v2 GPS module This GPS module has a built-in chip antenna and provides

    standard GPS outputs such as latitude, longitude, altitude and

    speed.

    Please visit www.cloudconnectkits.org for more information and implementation details.

    FRDM-K64F Software Modifications Reporting Frequency: By default, the FRDM-K64F board uploads sensor measurements to

    AT&T’s Flow environment every 5 seconds. You can adjust how often you want to do this by

    editing the SENSOR_UPDAT_INTERVAL_MS value in the config_me.h header file.

    The sensor measurements that are reported can be changed by altering the iSensorsToReport

    parameter.

    The default assignment for this is: iSensorsToReport =

    TEMP_HUMIDITY_ACCELEROMETER;

    With this setting, the board reports readings from the HTS221 temperature & humidity sensor

    and 3-axis accelerometer readings from the FXOS8700CQ motion sensor. These values are

    sent to the HTTP IN /climate port in Flow with field names temp, humidity, accelX, accelY and

    accelZ.

    http://www.cloudconnectkits.org/

  • Page 27

    Temperature is in degrees Fahrenheit. Humidity is a percentage (%). Acceleration is

    measured in G’s (the gravitational constant) and is useful if you want to know the stationary

    position of the board with regards to gravity or its acceleration when in motion.

    As discussed in the document on adding External Sensors to the kit on

    www.cloudconnectkits.org the assignment of this iSensorsToReport variable can be changed

    to report a different set of sensor readings to Flow.

    After any source modifications, recompile the IoT Kit software and reprogram the board. After

    the IoT Kit is powered up and connected to flow, you can view the new data under the Debug

    tab as in the image above.

    http://www.cloudconnectkits.org/

  • Page 28

    Appendix B: Charting/Graphing Capabilities In the M2X screen, click Devices and click Virtual Starter Kit.

    In your device, you will see a number of enabled Streams on the left. Select Acceleration Z-axis.

    If your board is lying flat, with gravity accelerating your board downward at ≈ 1.00 g, you should

    see a graph similar to the one displayed.

    Note: You can select how many values you want to view from the drop-down box below the

    graph.

  • Page 29

    It is also possible to view multiple streams on one chart by clicking Charts > Add Chart. Select

    the streams you want to view and click the Save button.

    Note: With the free account, you can add a maximum of two streams.

    You can create graphs that use streams from different devices. It is also possible to draw a

    graph of Temperature vs. Humidity by clicking Dashboards at the top of the screen and

    selecting different dashboards using customizable widgets that can be embedded elsewhere

    using the URL.

  • Page 30

    Appendix C: M2X TRIGGERS Triggers can be created in M2X devices. In the IoT Kit project, click Devices > Virtual Starter

    Kit > Triggers. Flow automatically creates two triggers for Hot Temp and Cold Temp. Click the

    edit pencil on the right.

    You can modify the trigger conditions. The Callback URL is the endpoint address for the /trigger input in the Flow design.

  • Page 31

    Click the Trigger tab to explore how Flow processes the trigger inputs and uses them for notifications.

  • Page 32

    Appendix D: Data Processing in Flow When data is sent from the WNC-Shield sensors to Flow, it enters via a HTTP-IN GET port.

    From here, it goes through a number of nodes. On the Flow Data canvas, the M2X lead-in

    function is where data enters. Double-click the bubble to open it.

    Scroll to the bottom of the JavaScript content. This is the function that composes the POST

    message for M2X. This function contains the sensor fields that get extracted from the incoming

    payload.

    Note: If attempting to POST to an M2X stream that does not exist, an error is generated.

  • Page 33

    To determine which streams are present, click the Registration part of the Flow canvas as

    shown below.

    This is where the various sensor readings are processed and either sent (PUT) or posted to

    M2X.

    Appendix E: Avnet ARM mbed C++ Libraries and Example Programs

    All v5 mbed compatible libraries and examples may be found here:

    https://developer.mbed.org/teams/Avnet/

    Including:

    WncInterface – An mbed C++ class that can be used in place of mbed’s v5 EthInterface class

    WncControllerLibrary – A C++ class that directly controls the 14A2A, study it to learn AT cmds

    WncControllerK64F – A C++ class that controls the 14A2A from the K64F Freedom Board

    And the original Out of the Box demo with the old controller method can also now be found

    here.

    Also several examples can be found here such as: HTTPClient, M2X, Bluemix, MQTT and TLS

    Client

    Note: Please only use code pulled from release labels! The tip revisions are not guaranteed to

    work!

    https://developer.mbed.org/teams/Avnet/

    Revision HistoryIntroductionKit ContentsNXT FRDM-K64F Single Board Computer (SBC)WNC-Shield BoardIoT Kit SoftwareCellular Shield WNC 14A2A Firmware

    Creating Online AccountsCloudconnectkits.org AccountJasper Account for SIM CardARM mbed.org AccountAT&T Flow and M2X AccountsFlow AccountM2X AccountConnect Flow and M2X

    Assembling the AT&T IoT Kit HardwareSBC Firmware

    Importing, Compiling, and Programming AT&T IoT Kit SoftwareCompilingProgramming

    Running Example SoftwareInstall the COM driver (Windows)Install/Setup of Terminal ProgramRunning the IoT Flow and M2X Program

    Getting Help and SupportAppendix A: Extending Shield Card Capabilities with External SensorsSilicon Labs PMOD Sensor Auxiliary BoardSeeedstudio Xadow v2 GPS moduleFRDM-K64F Software Modifications

    Appendix B: Charting/Graphing CapabilitiesAppendix C: M2X TRIGGERSAppendix D: Data Processing in FlowAppendix E: Avnet ARM mbed C++ Libraries and Example Programs