Date post: | 04-Aug-2018 |
Category: |
Documents |
Upload: | nguyennguyet |
View: | 312 times |
Download: | 0 times |
Contents
1 Benefits 3
2 Contents 52.1 Step 0 - Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Step 1 - Send data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 Step 2 - See data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.4 In more detail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Indices and tables 11
i
IoT Platform docs Documentation, Release latest
IoT Platform allows you to connect devices and receive data, integrating all device protocols and connectivity methods,understanding and interpreting relevant information. It isolates data processing and application service layers from thedevice and network complexity, in terms of access, security and network protocols.
Note: Site under construction!
Contents 1
CHAPTER 1
Benefits
Benefits of solutions ‘powered by the IoT Platform’:
• Enhances device data integration & speeds application development.
• With transparent and efficient manage of:
• Devices
• Communications
• Security
• Data generated
• With independence of volume of data and devices managed.
• Allowing interoperability with 3rd parties BBDD, ERPs, CRMs, Big data sources, and other m2m solutions.
• Granting high availability for all the platform.
• FIWARE compliant
3
CHAPTER 2
Contents
2.1 Step 0 - Credentials
Please, request your credentials. You will receive an email containing these fields that are required for the followingsteps:
In order test the API, we really recommend you use the following sample collection for POSTMAN extension forGoogle Chrome, all this guide samples and some additional operations are there.
https://dl.dropboxusercontent.com/u/107902873/ttcloud/FIWARE-IoTStack-GettingStarted.zip
Please, remember to create a POSTMAN environment with your credentials for this POSTMAN collection.
2.2 Step 1 - Send data
Before doing any coding, identify the sensors on your device and decide which data do you want to send to the Cloud.
Sending data is as simple as sending an HTTP POST request using your API key with your measures. Please use “#”and “|” separators to split data and measures.
Please remember that you will need to send as query parameters on the URL your {{apikey}} and your device identi-fier.
Take into account that no device provisioning or data modeling is required in advance to send your device data.Anyway, we recommend to use short magnitude identifiers (like “t”, “p” on the sample) to reduce the message lengthsent from the device.
Your will simply receive an HTTP 200 OK response to confirm the data was properly received at the Cloud.
2.3 Step 2 - See data
Your device data is now stored in the Cloud, and your can see it on the web portal. Please access the web portal withyour Username, Password and Fiware-Service:
http://test.ttcloud.net:8008/#/
Now you have to switch to your subservice {{Fiware-ServicePath}} at right top switch:
5
IoT Platform docs Documentation, Release latest
After that, you will see your device data the Entities list:
2.3.1 Step 3 - Get data
Now your know your data is stored in the Cloud, lets get it via API.
Now you are ready to invoke the API to get your device data. Just do an HTTP GET request like this:
You will get you device data in a json document like this that is FIWARE NGSI compliant:
Please, notice that you will see one attribute per sensor.
2.3.2 Step 4 - Show in a dashboard
JSON documents are fine, but dashboards are better for humans. If you want to create a responsive website to see yourdevice data at the Cloud don’t do it from the scratch, just sign up at:
https://freeboard.io/signup
After this, you will be able to create a dashboard:
Once your are at your new dashboard, create an Orion FIWARE datasource per device.
6 Chapter 2. Contents
IoT Platform docs Documentation, Release latest
On the FIWARE Orion datasource configuration introduce there your credentials and your device type and ID asretrieved on Step 3 from the Cloud API.
Now it’s time to add widgets to your dashboard, representing your device data.
Anyway, you can always clone this sample freeboard and use it as a template for yours:
https://freeboard.io/board/69lZ9V
2.3. Step 2 - See data 7
IoT Platform docs Documentation, Release latest
2.3.3 Step 5 - Send commands
You can send commands to the device in order to trigger any action like turning on a LED or a relay. In order to do so,you need to set your device at the website.
First, create a new device on the “Devices” management tab:
After that, register a new command for the device taking into account:
• Endpoint: if your device has a public IP, we will push the commands
to that URL. Otherwise, the commands can be polled.
• Command value: it must follow these convention
device_id@{{command_name}}|%s
Remember that you can also setup your device via API, you will find an example on the POSTMAN collection.
Once the command is configured, you can send commands to the device just updating the entity attribute associated tothat command, or using the web interface.
On the Entities section, select the entity linked to that device and click on the “Send Command” green button to submitit.
8 Chapter 2. Contents
IoT Platform docs Documentation, Release latest
The commands will be received on the device endpoint if configured on the device setup. Remember that if you leftthat field empty, the commands can be pulled directly from the device:
The command received will be as follows:
2.4 In more detail . . .
Sending data
Devices can provide data using many other protocols like MQTT or COAP, it is also feasible to set different times-tamps, configure customized mappings between physical device and virtual entity, or provision measures via HTTPGET. Read the full detail at:
More info: Device API guide
Data API
Data API is FIWARE NGSI compliant so it provides lots of features: subscriptions, partial updates, bulk entitiesretrieval, regular expression queries, geolocated entities search.
http://es.slideshare.net/fermingalan/fiware-managing-context-information-at-large-scale
More info: Data API guide
Historic Data API
Historic data is accessible using the Short Term historic API.
** RAW data query example **
**Aggregated data (sum/hourly) query example **
Remember that in order to collect historic data, it is necessary to configure the required sub-scription (endpoint: http://test.ttcloud.net:8666/notify).
More info: Historic Data API
** New accounts and subservices **
You can create new users and credentials at the web portal. It is also possible to have different subservices in order tosegment properly your data.
More info: Management API
2.4. In more detail . . . 9
IoT Platform docs Documentation, Release latest
Data visualization tools
Do you need to show your devices on a map? want your data in a Google Sheet? prefer to use Ducksboard for creatingdashboards? Take a look to our set of data visualization tools connectors:
https://github.com/telefonicaid/fiware-dataviz
Getting more API tokens
With your credentials we gave you a token, but you may need more.
To do so, you can login in the Authentication API to get a new token:
You will receive an HTTP 201 Created response with a header called X-Subject-Token, this is your {{user-token}}like this:
Please, be careful pasting your {{user-token}} properly on next steps. This is your API token and it will be valid for3 years.
10 Chapter 2. Contents