Mbed/mbed Device Connector

From ESS-WIKI
Revision as of 05:15, 20 July 2016 by Marco.lin (talk | contribs) (mbed connector nodered nodes)
Jump to: navigation, search

Introduction

ARM mbed Device Connector provides a service for mbed developer to connect mbed device to mbed cloud. The service makes IoT device messaging, provisioning and updates available to other software, web applications and cloud through easily-integrated REST APIs.

Account and Security Key

Create your account and login. In Dashboard you can see information about your device and security related topics.


Mbed connector dashboard.png


Security credentials

Click Security credentials under My Devices, then click GET MY DEVICE SECURITY CREDENTIALS.


Mbed connector securityCredentials.png


The security credential required for your device to successfully register to mbed connector service is created. Copy and paste all the content to 'security.h' file in your mbed client source tree.


Access keys

Click Access keys under My Applications, then click CREATE NEW ACCESS KEY to create access key for your application in order to connect to mbed Device Connector REST API.


Mbed connector accessKey.png


API Console

After connecting mbed device to mbed Device Connector, confirm it by checking Connected Devices under My Devices.


Mbed connector connectedDevice.png


Then go to API Console under Device Connector. API Console lets you simulate your application requests against mbed Device Connector REST API.


Mbed connector apiConsole.png


For example, you can send a request to GET the data of resources exposed in your device. First, select endpoint (device) and resource-path (see "53b4decc-eb52..." and "/3304/0/5700" in example image below). Then click TEST API. The endpoint and resource-path here are also used as {endpoint-name} and {resource-path} in a REST API call, explained in 4. Get Data from mbed Connector in NodeRED


Mbed connector restRequest.png


Then check the result of your request in Response area. The data of this requested resource, Humidity value (/3304/0/5700), is reported in "payload" field in Base64 format.


Mbed connector restRequestResult.png


Get Data from mbed Connector in NodeRED

API Console is a convenient tool to check your device and resources on it. It helps you easily verify the result of your application sending requests against mbed Device Connector REST API. In real cases you will need to get this data in your software, web applications or cloud through these REST APIs. Below is an example using NodeRED to get this Humidity value.


Mbed connector nodered.png


Nodes in this flow: