Difference between revisions of "Mbed/mbed Device Connector"
(mbed connector nodered) |
(mbed connector nodered nodes) |
||
Line 56: | Line 56: | ||
[[File:mbed_connector_nodered.png|800px]] | [[File:mbed_connector_nodered.png|800px]] | ||
+ | |||
+ | |||
+ | Nodes in this flow: | ||
+ | * '''Authorization''' : Include authentication information in http request header in order to access your device. Refer to ... for valid authentication access key. | ||
+ | * '''http request humidity''' : | ||
+ | * '''http request result''' : | ||
+ | * '''result parsing''' : |
Revision as of 03:57, 20 July 2016
Contents
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.
Security credentials
Click Security credentials under My Devices, then click GET MY DEVICE SECURITY CREDENTIALS.
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.
API Console
After connecting mbed device to mbed Device Connector, confirm it by checking Connected Devices under My Devices.
Then go to API Console under Device Connector. API Console lets you simulate your application requests against mbed Device Connector REST API.
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.
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.
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.
Nodes in this flow:
- Authorization : Include authentication information in http request header in order to access your device. Refer to ... for valid authentication access key.
- http request humidity :
- http request result :
- result parsing :