SlideShare una empresa de Scribd logo
1 de 60
Developing your first application using FI-WARE 
Fermín Galán Márquez (fermin@tid.es), Miguel Jimenez (mjimenez@fi.upm.es), Carlos Ralli (ralli@tid.es), Juanjo Hierro (jhierro@tid.es) 
Telefónica I+D, Universidad Politécnica de Madrid 
Open APIs for Open Minds
Let’s go into detail… 
1
Architecture 
Wirecloud (javascript runtime) 
2 
NGSI IoT 
Adapter 
IoT Backend Device 
Management 
Browser 
Ticket Management Context Broker 
CEP 
widgets 
Object Storage 
History 
Location 
Wirecloud (server) 
Cosmos
Wirecloud (javascript runtime) 
3 
NGSI IoT 
Adapter 
IoT Backend Device 
Management 
Browser 
Ticket Management Context Broker 
CEP 
widgets 
Object Storage 
History 
Location 
Wirecloud (server) 
Cosmos 
Context Broker
Taking a closer look 
4 
Context Broker 
Context 
Producers 
Context 
Consumers 
subscriptions 
update 
query 
notify 
notify 
update 
update 
1026 
Ticket Management 
History 
1026 
Ticket Management DB 
Wirecloud Wirecloud
The NGSI information model 
“has” “has” 
Issues location TimeInstant 
5 
Meta-data 
• Name 
• Type 
• Value 
Context Element attributes 
• Name 
• Type 
• Value 
Context Element 
• EntityId 
• EntityType 
1 n 1 n 
(We are not fully supporting 
metadata right now) 
Electrical Regulator 
Node Lamps 
Vans 
Technicians 
severity batteryCharge 
illuminance 
presence 
electricPotential 
…and many more (look to app code)
Typical Orion broker utilization steps 
registerContext 
updateContext 
queryContext 
subscribeContext 
Creating new 
context elements 
“Write” context 
elements 
information 
To different ways 
of “reading” 
context elements 
information 
subscribeContext 
Availability 
Getting aware of new 
context elements 
discoverContext 
Availability 
Look for existing 
context elements 
NGSI9 operation (context availability) 
NGSI10 operation (context information)
Context platform available at Campus Party 
notify 
Context 
Broker Echo 
7 
server 
1026 
1028 
notify 
(Only for 
demonstration 
purposes during the 
workshop) 
Global instance at 
orion.lab.fi-ware.eu 
(at FI-LAB cloud) 
Context 
Broker 
LiveDemo testbed 
Backend Device Management 
Context 
Broker 
Context 
Broker 
Context 
… Broker 
notify 
notify 
updateContext 
Dedicated instances at 
http://yourvm:1026 
“FI-WARE Cloud: bringing 
OpenStack to the next level” 
workshop (Wed 10-12am) 
Nodes 
AMMS 
Regulator 
Vans 
Shared!!! 
NGSI enabled 
NSGeSnIs oernsabled 
NSGeSnIs oernsabled 
Sensors
Wirecloud 
Wirecloud (javascript runtime) 
8 
NGSI IoT 
Adapter 
IoT Backend Device 
Management 
Browser 
Ticket Management Context Broker 
CEP 
widgets 
Object Storage 
History 
Location 
Wirecloud (server) 
Cosmos
What is Wirecloud? 
9 
Backend 
service Backend 
service 
Backend 
service 
NGSI API 
Object Storage 
API 
Context 
Broker
Catalogue of widgets and mashups 
 
Widget 
 
.wgt 
Application 
Mashup API 
Local catalogue 
Store API 
widget 
.wgt
What can I do with Wirecloud? 
11
To create my own application mashup… 
 
Widgets and operators: 
• Widgets can be developed with any Web technology (HTML, Flash, SVG…) that supports 
JavaScript. 
• Operators are coded in JavaScript 
 
Both widgets and operators can be easily adapted from existing ones, or created from scratch 
 
Open Widget API 
• JavaScript API 
• Core Widgets Functionality: 
› gain access to external resources (cross-domain problem) 
› wiring 
› preferences 
› … 
12
How to develop a widget? 
 
Setting up the development environment 
• Eclipse, VIM, etc... 
• Creating the directory structure (WGT) 
 
Creating the widget: 
• Create the template of the widget (config.xml) 
• Widget view: an HTML file + CSS 
• Widget app logic: JavaScript (using Widget API) 
 
Testing your widget 
• Uploading the widget to Local Catalogue 
› The WGT file is a ZIP file renamed to .wgt 
• Add widget to a mashup 
› Wiring, preferences, layout… 
13
Widget structure 
 
config.xml 
• definition of the widget (based on WDL) 
 
index.html 
• main view file 
• references JS and CSS resources 
 
/js 
• directory for JavaScript files 
 
/css 
• directory for CSS files 
 
/images 
• directory for images 
 
/doc 
• documentation 
14
Config.xml 
 
The mandatory config.xml file contains the WDL XML template needed to tell Wirecloud what the 
widget looks like. This includes: 
• Widget metadata (non-functional properties) 
• User preferences 
• Widget inputs and outputs (wiring) 
• Link to the actual widget source code 
• Default rendering information 
15
Config.xml example (I) 
<?xml version="1.0" encoding="UTF-8"?> 
<Template xmlns="http://wirecloud.conwet.fi.upm.es/ns/template#"> 
<Catalog.ResourceDescription> 
<Vendor>Company distributing the widget</Vendor> 
<Name>Widget name</Name> 
<Version>0.0.1</Version> 
<DisplayName>Widget Example</DisplayName> 
<Author>mjimenez</Author> 
<Mail>mjimenez@fi.upm.es</Mail> 
<Description>Full widget description to be shown in catalogue</Description> 
<ImageURI>Absolute or relative path to display image</ImageURI> 
<iPhoneImageURI>Path to imate to display on mobile devices</iPhoneImageURI> 
<WikiURI>Path to widget doc</WikiURI> 
</Catalog.ResourceDescription> 
16
Config.xml example (II) 
<Platform.Preferences> 
<Preference name=”pref_name" type="text" description="…" /> 
</Platform.Preferences> 
<Platform.Wiring> 
<OutputEndpoint name="identifier" 
type="text" label="Label to show on wiring" 
description="description" 
friendcode="same as compatible input endpoint friendcode"/> 
<InputEndpoint name="identifier" 
type="text" label="Label to show on wiring" 
description="description" 
friendcode="same as compatible output endpoint friendcode"/> 
</Platform.Wiring> 
<Platform.Link> 
<XHTML href="index.html"/> 
</Platform.Link> 
<Platform.Rendering width="6" height="24"/> 
</Template> 
17
index.html example 
<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<script type="text/javascript" src="js/main.js"></script> 
<link rel="stylesheet" type="text/css" href="css/style.css" /> 
</head> 
<body> 
<!– Create here or create by JavaScript -> 
</body> 
</html> 
18
Using the Open Widget API 
 
Accessing widget preferences 
MashupPlatform.prefs.get("google_key") 
MashupPlatform.prefs.set("color", "red") 
MashupPlatform.prefs.registerCallback(callbackFunction) 
 
Getting user login name 
MashupPlatform.context.get("username"); 
19
Wiring endpoints 
 
Declaration on config.xml 
<Platform.Wiring> 
<InputEndpoint name="my_input_name" type="text" label="my_label" 
description="my_description" friendcode="some_code" /> 
<OutputEndpoint name="my_output_name" type="text" label="label" 
description="description" friendcode="url"/> 
</Platform.Wiring> 
 
Input endpoints 
MashupPlatform.wiring.registerCallback("my_input_name", inputListener); 
 
Output endpoints 
MashupPlatform.wiring.pushEvent("my_output_name", data); 
20
Making a cross-domain HTTP request 
 
Perform the invocation and register asynchronous call-backs: 
MashupPlatform.http.makeRequest(url, { 
method: 'GET', 
onSuccess: function (transport) { 
var response; 
response = JSON.parse(transport.responseText); 
... 
}, 
onFailure: function (transport) { 
onError(); 
} 
}); 
21
Connecting a widget to NGSI 
 
Register NGSI usage on config.xml 
<Requirements> <Feature name="NGSI"/> </Requirements> 
 
Send a notification through NGSI 
var connection = new NGSI.Connection('http://orion.lab.fi-ware.eu'); 
connection.updateAttributes([{ 
entity: { 
id: 'iss8', 
type: 'Issue' 
}, 
attributes:[{ 
name: 'technician', 
contextValue: 'tech1' 
}] 
}], { 
onSuccess: function () { //… }, 
onFailure: function () { //… } 
}); 
22
Connecting a widget to NGSI 
 
Subscribe for notifications on certain entities 
var entityIdList = [ 
{type: 'Van', id: '.*', isPattern: true}, 
{type: 'Technician', id: '.*', isPattern: true} 
]; 
var attributeList = null; var duration = 'PT3H'; var throttling = null; 
var notifyConditions = [{ 
type: 'ONCHANGE', condValues: ['name', 'current_position'] 
}]; 
var options = { 
flat: true, 
onNotify: process_entities, 
onSuccess: function (data) { 
subscriptionId = data.subscriptionId; 
refresh_interval = setInterval(refreshNGSISubscript, 1000*60*60*2);//2 hours 
} 
}; 
connection.createSubscription(entityIdList, attributeList, duration, throttling, 
notifyConditions, options); 
23
Using Object Storage from a widget 
 
Register Object Storage usage on config.xml 
<Requirements> <Feature name="ObjectStorage"/> </Requirements> 
 
Upload a file 
var object_storage = new ObjectStorageAPI(’<Object Storage instance url>'); 
var fileParts = ["<a id="a"><b id="b">hey!</b></a>"]; 
var myBlob = new Blob(fileParts, { "type" : "text/xml" }); 
object_storage.uploadFile('folder_name', myBlob, token, { 
file_name: 'myFile.xml', 
onSuccess: function () { 
alert('File uploaded successfully'); 
}, 
onFailure: function () { 
alert('Something went wrong while uploading the file'); 
} 
}); 
24
Uploading your widget 
 
Compress (zip) the widget contents 
• Rename it as a .wgt file 
 
Upload the WGT file to Local Catalogue through WireCloud web interface 
25
Wiring your widget 
26
Resources 
 
https://mashup.lab.fi-ware.eu 
You can always find the most updated documentation of Wirecloud in: 
• http://conwet.fi.upm.es/wirecloud 
 
User and Programmer Guide: 
• https://forge.fi-ware.eu/plugins/mediawiki/wiki/fiware/index.php/Composition_Editor_- 
_Wirecloud_Mashup_Platform_-_User_and_Programmer_Guide 
 
Installation and Administration Guide: 
• https://forge.fi-ware.eu/plugins/mediawiki/wiki/fiware/index.php/Composition_Editor_- 
_Wirecloud_Mashup_Platform_-_Installation_and_Administration_Guide 
 
Download from Github: 
• Wirecloud source code: https://github.com/Wirecloud/wirecloud 
• Widget's source code of FIWARE's Live Demo mashable application component): 
https://github.com/wirecloud-fiware/live-demo-macs 
 
Stuff for this workshop 
• http://tinyurl.com/fiware-dropbox 
27
Online videos 
 
FIWARE Live Demo: http://www.youtube.com/watch?v=Wh_zPsLUg-8 
 
ENVIROFI Demo: https://www.youtube.com/watch?v=yEXlLQYq7s4 
 
Other videos: 
• http://www.youtube.com/embed/d7_EG42AHJw - Building a mashup from Geowidgets linked to 
geospatial services. 
• http://www.youtube.com/embed/urDGWSnrbtE - Using operators in a mashup to allow widgets 
to send tweets 
• http://www.youtube.com/embed/kW0sXMxgMLI - An example of integration with the marketplace 
and the catalogue GEs 
28
Sensors 
Wirecloud (javascript runtime) 
29 
NGSI IoT 
Adapter 
IoT Backend Device 
Management 
Browser 
Ticket Management Context Broker 
CEP 
widgets 
Object Storage 
History 
Location 
Wirecloud (server) 
Cosmos
FI-WARE IoT Extended Platform Vision 
Plug IoT world to FI-WARE via NGSI notifications.
FI-WARE IoT Functional Architecture (Target)
FI-WARE IoT Challenge Architecture 
CONTEXT 
NGSI9 (Register) 
IDAS 
BROKER sendobservation 
NGSI10 (Observations) 
addobservation 
fizway 
SensorML 
registerdevice 
fizway_switchd 
fizway_register 
z-way server (Razberry HW) 
FIGWAY 
FIZWAY 
Devices 
SensorML
Connecting a basic z-wave pack 
Obs. 
Query 
http://m2m.telefonica.com 
IDAS 
CONTEXT 
BROKER 
Register 
Observations 
NGSI (B) (A) SensorML 
Download the PI image with FIGWAY software at: http://tinyurl.com/figway-img
HOW-TO Get Started - Z-wave basic pack 
0) You need: a RaspberryPI + Razbian card plugged in its GPIO 
1) Include your z-wave devices into your z-wave network 
Complete your sensor details in our “IoT Challenge HUB doc” 
https://docs.google.com/spreadsheet/ccc?key=0ArcymbqnpOfkdGNYUkpaTF9qRVhkOTFIYW14SkxaZ1E#gid=0 
34 
2) Edit "fizway_resgister” & "fizway" scripts 
Update the Device_ID number of your sensors. 
3) Edit the file SensorML/Register_SWITCH 
Update the line containing the callback URL: 
"<swe:value>http://1.0.0.1:9999</swe:value>” 
-> Instead of 1.0.0.1 put the RaspberryPI public IP address 
-> Instead of 9999 set the port the switch daemon will be listening (normally, 7777) 
4) Check & Edit -if necessary- the figway "Config" file. 
Normally, modifications aren't needed so you can skip (4). 
A Config.example file is provided and comments should make this task really easy. 
5) Register all your working sensors by executing 
>./fizway_register 
6) Launch the script to interconnect your sensors to FI-WARE IoT Backend: 
>./fizway &
0) Mount RaspberryPI + Razbian 
35
0.2) Flash FIGWAY.img & Get IP address 
36
1) Include devices into a z-wave Network 
37 
EXCLUDE 
- Razberry exclusion mode 
- Press 4IN1 inclusion button 
INCLUDE 
- Razberry inclusion mode 
- Press 4IN1 Inclusion button 
CONFIGURATION 
- Select profile Aeon multisensor 1.18 
- Press 4IN1 inclusion button 3 times 
- Configure to send Group1 all obs (720s)
1) Include devices into a z-wave Network 
EXCLUDE 
- Razberry exclusion mode 
- Press KEYFOB 4 buttons 5sec (led slow blink) 
- Press button “1”, (try twice if it doesn’t work) 
INCLUDE 
- Razberry inclusion mode 
- Press KEYFOB 4 buttons 5sec (led slow blink) 
- Press button “1” 
CONFIGURATION 
- Configure remote KeyFob 
To apply config: WAKE-UP Device 
Press KEYFOB 4 buttons 5sec 
- Press button “2” (Try twice) 
Buttons in pair mode(1-3, 2-4): 
-> SEPARATELY 
Groups to send: 
-> SWITCH ON/OFF ONLY (SEND BASIC SET)
1) Include devices into a z-wave Network 
39 
EXCLUDE 
- Razberry exclude mode 
- Switch ON 
- Press ON/OFF 3 times between 1,5sec 
INCLUDE 
- Razberry inclusion mode 
- Switch ON 
- Press ON/OFF 3 times between 1,5sec 
NO CONFIG is needed. 
ALL DEVICES INCLUDED. 
DEVICES IDs SHOWN: 
2 (4IN1), 3 (KEYFOB) , 4 (SWITCH)
1) Include devices into a z-wave Network 
40 
CONFIGURATION 
- Select Zwave Description Record: 
Wintop iLED 
EXCLUDE 
- Razberry exclude mode 
- Switch ON (use a screw-driver) 
- Press ON 3 times between 1,5sec 
INCLUDE 
- Razberry exclude mode 
- Switch ON (use a screw-driver) 
- Press ON 3 times between 1,5sec
1) Include devices into a z-wave Network 
Provide your sensors to all: “IoT Challenge HUB doc” 
https://docs.google.com/spreadsheet/ccc?key=0ArcymbqnpOfkdGNYUkpaTF9qRVhkOTFIYW14SkxaZ1E#gid=0 
41 
SHARE SENSORs IS A MUST 
SHARE SWITCHES IS OPTIONAL
2) Edit "fizway_resgister” & "fizway" scripts 
Update correct IDs of your z-wave network (only for Devices you have) 
Actuators ports should be: 7777, 7778, etc. 
-> Update scripts “fizway_resgister” and “fizway”. 
42
3) Configure the SWITCH to receive commands 
Set the IPv4 Address of your Raspberry PI. Port is SWITCH one (7777). 
43
4) Check & Edit the figway "Config" file 
Pre-configured for IoT Challenge. No modifications are needed. 
44
5) Register all working devices in the Backend 
Launch de script “./fizway_resgister” 
For every device you’ll see a similar output as shown above. 
If it works, your devices are correctly register in the IDAS Backend. 
If it fails, increasing DEBUG level in the “Config” file helps a lot. 
45
6) Launch fizway script 
Launch de script “./fizway &” 
You may redirect the output to a log file if you’ close the window: 
“./fizway >> ./fizway_log &” 
You’ll see: 
- Devices you are listening to and their Device Number (z-wave network ID). 
- Daemons listening for Actuators commands coming from the Backend. 
46
Building your Fi-WARE IoT Apps 
1) IDAS ADMIN API – Check Services, Subscriptions & Details 
47 
2) IDAS ADMIN API – Check Devices & Details 
3) IDAS ADMIN API – Send a command to a z-wave Switch 
4) IDAS ADMIN API - Subscribe your App to Devices Notifications 
5) IDAS (or Global Context Broker) NGSI API – Get last observations of a device 
6) WIRECLOUD API - Connect a Wirecloud widget
Building your Fi-WARE IoT Apps 
1) IDAS ADMIN API – Check Services, Subscriptions to Service & Service Details 
48
Building your Fi-WARE IoT Apps 
2) IDAS ADMIN API – Check Devices & Device Details 
49
Building your Fi-WARE IoT Apps 
3) IDAS ADMIN API – Send a command to a z-wave Switch 
50 
COMMANDs TO SWITCHES/DIMMERS 
Follow “sendcommand” example. 
Send: “FIZCOMMAND N” 
N: 0-255. 0 = off, 255 = on
Building your Fi-WARE IoT Apps 
4) IDAS ADMIN API – Send a command to a z-wave Switch 
51
Building your Fi-WARE IoT Apps 
5) IDAS NGSI API – Get last observations of a device 
52
Building your Fi-WARE IoT Apps 
6) WIRECLOUD API - Connect a Wirecloud widget 
53
ANNEX: where to find more docs 
54 
- IDAS APIs 
http://www.fi-ware.eu 
- z-way server: 
http://en.z-wave.me/docs/zway_manual_en.pdf 
- Aeon 4IN1 Manual 
http://www.smarthus.info/support/manuals/zw_sikkerhet/aeotec_multisensor_tech.pdf 
- Zwave.me KeyFob 
https://www.uk-automation.co.uk/pdf/zwavemekeyfob.pdf 
- Everspring Switch/Dimmer 
http://doc.eedomus.com/files/EVR_AN158%20MANUEL%20US.pdf 
- Fibaro RGB SWITCH 
http://www.fibaro.com/manuals/en/FGRGBWM-441-RGBW-Controller/FGRGBWM-441-RGBW-Controller- 
en-2.1-2.3.pdf
Object Storage 
Wirecloud (javascript runtime) 
• More info at “FI-WARE Cloud: bringing OpenStack to the next 
level” workshop (Wed 10-12am) 
55 
NGSI IoT 
Adapter 
IoT Backend Device 
Management 
Browser 
Ticket Management Context Broker 
CEP 
widgets 
Object Storage 
History 
Location 
Wirecloud (server) 
Cosmos 
• Contact Person: John Kennedy 
<john.m.kennedy at intel dot com >
Cosmos 
Wirecloud (javascript runtime) 
56 
NGSI IoT Adapter 
IoT Backend Device 
Management 
Browser 
Ticket Management Context Broker 
CEP 
widgets 
Object Storage 
History 
Location 
Wirecloud (server) 
Cosmos 
• Have a look to http://tinyurl.com/c0sm0s 
• Contact Person: Francisco Romero 
<frb at tid dot es>
Extending Live Demo 
Wirecloud (javascript runtime) 
https://github.com/wirecloud-fiware/live-demo-macs 
https://github.com/wirecloud-fiware/historymod 
57 
NGSI IoT 
Adapter 
IoT Backend Device 
Management 
Browser 
Ticket Management Context Broker 
CEP 
widgets 
Object Storage 
History 
Location 
Wirecloud (server) 
Cosmos 
https://github.com/telefonicaid/fiware-livedemoapp
Useful additional references 
 
Workshop Homepage http://tinyurl.com/fiware-cp-ws1 
• Long URL: http://www.fi-ware.eu/campus-party-europedeveloping-your-first-application- 
workshop 
 
The FI-WARE Catalogue http://catalogue.fi-ware.eu 
• With information about FI-WARE GEis, e.g. Orion Context Broker, Wirecloud, 
etc. 
 
Dropbox for Workshop stuff: http://tinyurl.com/fiware-dropbox 
 
Dropbox for Raspberry Pi image: http://tinyurl.com/figway-img 
• Use the following as backup in case of problems: http://130.206.82.17 
58
Thanks ! 
 
http://fi-ppp.eu 
 
http://fi-ware.eu 
 
Follow @Fiware on Twitter ! 
59

Más contenido relacionado

La actualidad más candente

Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
Fermin Galan
 

La actualidad más candente (20)

Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
 
FIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 MinutesFIWARE Primer - Learn FIWARE in 60 Minutes
FIWARE Primer - Learn FIWARE in 60 Minutes
 
Context Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basicsContext Information Management in IoT enabled smart systems - the basics
Context Information Management in IoT enabled smart systems - the basics
 
FIWARE IoT Proposal & Community
FIWARE IoT Proposal & CommunityFIWARE IoT Proposal & Community
FIWARE IoT Proposal & Community
 
Fiware io t_ul20_cpbr8
Fiware io t_ul20_cpbr8Fiware io t_ul20_cpbr8
Fiware io t_ul20_cpbr8
 
FIWARE Developers Week_IoT Agents with Thinking Things and OMA lightweight M...
 FIWARE Developers Week_IoT Agents with Thinking Things and OMA lightweight M... FIWARE Developers Week_IoT Agents with Thinking Things and OMA lightweight M...
FIWARE Developers Week_IoT Agents with Thinking Things and OMA lightweight M...
 
IoT-Broker Developers Week
IoT-Broker Developers WeekIoT-Broker Developers Week
IoT-Broker Developers Week
 
A Complete IoT Backend Infrastructure in FIWARE
A Complete IoT Backend Infrastructure in FIWAREA Complete IoT Backend Infrastructure in FIWARE
A Complete IoT Backend Infrastructure in FIWARE
 
FI-WARE Basic Guide
FI-WARE Basic GuideFI-WARE Basic Guide
FI-WARE Basic Guide
 
FIWARE Developers Week_IoT basic exercises
FIWARE Developers Week_IoT basic exercisesFIWARE Developers Week_IoT basic exercises
FIWARE Developers Week_IoT basic exercises
 
Fiware Developers Week IoT Agents (Advanced)
Fiware Developers Week IoT Agents (Advanced)Fiware Developers Week IoT Agents (Advanced)
Fiware Developers Week IoT Agents (Advanced)
 
FIWARE Developers Week_BootcampWeBUI_presentation2
FIWARE Developers Week_BootcampWeBUI_presentation2FIWARE Developers Week_BootcampWeBUI_presentation2
FIWARE Developers Week_BootcampWeBUI_presentation2
 
IoT Agents (Introduction)
IoT Agents (Introduction)IoT Agents (Introduction)
IoT Agents (Introduction)
 
FIWARE IoT Introduction 1
FIWARE IoT Introduction 1FIWARE IoT Introduction 1
FIWARE IoT Introduction 1
 
Fiware, the future internet
Fiware, the future internetFiware, the future internet
Fiware, the future internet
 
Fiware, the future internet
Fiware, the future internetFiware, the future internet
Fiware, the future internet
 
Developing an IoT System FIWARE Based from the Scratch
Developing an IoT System FIWARE Based from the ScratchDeveloping an IoT System FIWARE Based from the Scratch
Developing an IoT System FIWARE Based from the Scratch
 
Fiware IoT Proposal & Community
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community
 
FIWARE at LeWeb - Agenda
FIWARE at LeWeb - AgendaFIWARE at LeWeb - Agenda
FIWARE at LeWeb - Agenda
 
Io t basic-exercises
Io t basic-exercisesIo t basic-exercises
Io t basic-exercises
 

Similar a Developing your first application using FIWARE

Nuxeo - OpenSocial
Nuxeo - OpenSocialNuxeo - OpenSocial
Nuxeo - OpenSocial
Thomas Roger
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
Patrick Lauke
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
Wei Ru
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
Manish Pandit
 

Similar a Developing your first application using FIWARE (20)

Nuxeo - OpenSocial
Nuxeo - OpenSocialNuxeo - OpenSocial
Nuxeo - OpenSocial
 
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
HTML5 (and friends) - History, overview and current status - jsDay Verona 11....
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
Building the an End-to-End ASP.NET MVC 4, Entity Framework, HTML5, jQuery app...
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices
(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices
(MBL303) Build Mobile Apps for IoT Devices and IoT Apps for Devices
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
AtlasCamp 2014: 10 Things a Front End Developer Should Know About ConnectAtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
 
Vert.x devoxx london 2013
Vert.x devoxx london 2013Vert.x devoxx london 2013
Vert.x devoxx london 2013
 
Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Dojo - from web page to web apps
Dojo - from web page to web appsDojo - from web page to web apps
Dojo - from web page to web apps
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
HTML5 on Mobile
HTML5 on MobileHTML5 on Mobile
HTML5 on Mobile
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Event-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 EngineEvent-driven IO server-side JavaScript environment based on V8 Engine
Event-driven IO server-side JavaScript environment based on V8 Engine
 
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at NetflixOSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
OSCON 2014 - API Ecosystem with Scala, Scalatra, and Swagger at Netflix
 

Más de FIWARE

Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxCameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
FIWARE
 
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxBoris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
FIWARE
 
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
FIWARE
 
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfAbdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
FIWARE
 
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FIWARE
 

Más de FIWARE (20)

Behm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptxBehm_Herne_NeMo_akt.pptx
Behm_Herne_NeMo_akt.pptx
 
Katharina Hogrebe Herne Digital Days.pdf
 Katharina Hogrebe Herne Digital Days.pdf Katharina Hogrebe Herne Digital Days.pdf
Katharina Hogrebe Herne Digital Days.pdf
 
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptxChristoph Mertens_IDSA_Introduction to Data Spaces.pptx
Christoph Mertens_IDSA_Introduction to Data Spaces.pptx
 
Behm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptxBehm_Herne_NeMo.pptx
Behm_Herne_NeMo.pptx
 
Evangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptxEvangelists + iHubs Promo Slides.pptx
Evangelists + iHubs Promo Slides.pptx
 
Lukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptxLukas Künzel Smart City Operating System.pptx
Lukas Künzel Smart City Operating System.pptx
 
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptxPierre Golz Der Transformationsprozess im Konzern Stadt.pptx
Pierre Golz Der Transformationsprozess im Konzern Stadt.pptx
 
Dennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptxDennis Wendland_The i4Trust Collaboration Programme.pptx
Dennis Wendland_The i4Trust Collaboration Programme.pptx
 
Ulrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptxUlrich Ahle_FIWARE.pptx
Ulrich Ahle_FIWARE.pptx
 
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptxAleksandar Vrglevski _FIWARE DACH_OSIH.pptx
Aleksandar Vrglevski _FIWARE DACH_OSIH.pptx
 
Water Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdfWater Quality - Lukas Kuenzel.pdf
Water Quality - Lukas Kuenzel.pdf
 
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptxCameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
Cameron Brooks_FGS23_FIWARE Summit_Keynote_Cameron.pptx
 
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptxFiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
FiWareSummit.msGIS-Data-to-Value.2023.06.12.pptx
 
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptxBoris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
Boris Otto_FGS2023_Opening- EU Innovations from Data_PUB_V1_BOt.pptx
 
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
Bjoern de Vidts_FGS23_Opening_athumi - bjord de vidts - personal data spaces....
 
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdfAbdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
Abdulrahman Ibrahim_FGS23 Opening - Abdulrahman Ibrahim.pdf
 
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdfFGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
FGS2023_Opening_Red Hat Keynote Andrea Battaglia.pdf
 
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptxHTAG_Skalierung_Plattform_lokal_final_versand.pptx
HTAG_Skalierung_Plattform_lokal_final_versand.pptx
 
WE_LoRaWAN _ IoT.pptx
WE_LoRaWAN  _ IoT.pptxWE_LoRaWAN  _ IoT.pptx
WE_LoRaWAN _ IoT.pptx
 
EU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptxEU Opp_Clara Pezuela - German chapter.pptx
EU Opp_Clara Pezuela - German chapter.pptx
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

Developing your first application using FIWARE

  • 1. Developing your first application using FI-WARE Fermín Galán Márquez (fermin@tid.es), Miguel Jimenez (mjimenez@fi.upm.es), Carlos Ralli (ralli@tid.es), Juanjo Hierro (jhierro@tid.es) Telefónica I+D, Universidad Politécnica de Madrid Open APIs for Open Minds
  • 2. Let’s go into detail… 1
  • 3. Architecture Wirecloud (javascript runtime) 2 NGSI IoT Adapter IoT Backend Device Management Browser Ticket Management Context Broker CEP widgets Object Storage History Location Wirecloud (server) Cosmos
  • 4. Wirecloud (javascript runtime) 3 NGSI IoT Adapter IoT Backend Device Management Browser Ticket Management Context Broker CEP widgets Object Storage History Location Wirecloud (server) Cosmos Context Broker
  • 5. Taking a closer look 4 Context Broker Context Producers Context Consumers subscriptions update query notify notify update update 1026 Ticket Management History 1026 Ticket Management DB Wirecloud Wirecloud
  • 6. The NGSI information model “has” “has” Issues location TimeInstant 5 Meta-data • Name • Type • Value Context Element attributes • Name • Type • Value Context Element • EntityId • EntityType 1 n 1 n (We are not fully supporting metadata right now) Electrical Regulator Node Lamps Vans Technicians severity batteryCharge illuminance presence electricPotential …and many more (look to app code)
  • 7. Typical Orion broker utilization steps registerContext updateContext queryContext subscribeContext Creating new context elements “Write” context elements information To different ways of “reading” context elements information subscribeContext Availability Getting aware of new context elements discoverContext Availability Look for existing context elements NGSI9 operation (context availability) NGSI10 operation (context information)
  • 8. Context platform available at Campus Party notify Context Broker Echo 7 server 1026 1028 notify (Only for demonstration purposes during the workshop) Global instance at orion.lab.fi-ware.eu (at FI-LAB cloud) Context Broker LiveDemo testbed Backend Device Management Context Broker Context Broker Context … Broker notify notify updateContext Dedicated instances at http://yourvm:1026 “FI-WARE Cloud: bringing OpenStack to the next level” workshop (Wed 10-12am) Nodes AMMS Regulator Vans Shared!!! NGSI enabled NSGeSnIs oernsabled NSGeSnIs oernsabled Sensors
  • 9. Wirecloud Wirecloud (javascript runtime) 8 NGSI IoT Adapter IoT Backend Device Management Browser Ticket Management Context Broker CEP widgets Object Storage History Location Wirecloud (server) Cosmos
  • 10. What is Wirecloud? 9 Backend service Backend service Backend service NGSI API Object Storage API Context Broker
  • 11. Catalogue of widgets and mashups  Widget  .wgt Application Mashup API Local catalogue Store API widget .wgt
  • 12. What can I do with Wirecloud? 11
  • 13. To create my own application mashup…  Widgets and operators: • Widgets can be developed with any Web technology (HTML, Flash, SVG…) that supports JavaScript. • Operators are coded in JavaScript  Both widgets and operators can be easily adapted from existing ones, or created from scratch  Open Widget API • JavaScript API • Core Widgets Functionality: › gain access to external resources (cross-domain problem) › wiring › preferences › … 12
  • 14. How to develop a widget?  Setting up the development environment • Eclipse, VIM, etc... • Creating the directory structure (WGT)  Creating the widget: • Create the template of the widget (config.xml) • Widget view: an HTML file + CSS • Widget app logic: JavaScript (using Widget API)  Testing your widget • Uploading the widget to Local Catalogue › The WGT file is a ZIP file renamed to .wgt • Add widget to a mashup › Wiring, preferences, layout… 13
  • 15. Widget structure  config.xml • definition of the widget (based on WDL)  index.html • main view file • references JS and CSS resources  /js • directory for JavaScript files  /css • directory for CSS files  /images • directory for images  /doc • documentation 14
  • 16. Config.xml  The mandatory config.xml file contains the WDL XML template needed to tell Wirecloud what the widget looks like. This includes: • Widget metadata (non-functional properties) • User preferences • Widget inputs and outputs (wiring) • Link to the actual widget source code • Default rendering information 15
  • 17. Config.xml example (I) <?xml version="1.0" encoding="UTF-8"?> <Template xmlns="http://wirecloud.conwet.fi.upm.es/ns/template#"> <Catalog.ResourceDescription> <Vendor>Company distributing the widget</Vendor> <Name>Widget name</Name> <Version>0.0.1</Version> <DisplayName>Widget Example</DisplayName> <Author>mjimenez</Author> <Mail>mjimenez@fi.upm.es</Mail> <Description>Full widget description to be shown in catalogue</Description> <ImageURI>Absolute or relative path to display image</ImageURI> <iPhoneImageURI>Path to imate to display on mobile devices</iPhoneImageURI> <WikiURI>Path to widget doc</WikiURI> </Catalog.ResourceDescription> 16
  • 18. Config.xml example (II) <Platform.Preferences> <Preference name=”pref_name" type="text" description="…" /> </Platform.Preferences> <Platform.Wiring> <OutputEndpoint name="identifier" type="text" label="Label to show on wiring" description="description" friendcode="same as compatible input endpoint friendcode"/> <InputEndpoint name="identifier" type="text" label="Label to show on wiring" description="description" friendcode="same as compatible output endpoint friendcode"/> </Platform.Wiring> <Platform.Link> <XHTML href="index.html"/> </Platform.Link> <Platform.Rendering width="6" height="24"/> </Template> 17
  • 19. index.html example <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="js/main.js"></script> <link rel="stylesheet" type="text/css" href="css/style.css" /> </head> <body> <!– Create here or create by JavaScript -> </body> </html> 18
  • 20. Using the Open Widget API  Accessing widget preferences MashupPlatform.prefs.get("google_key") MashupPlatform.prefs.set("color", "red") MashupPlatform.prefs.registerCallback(callbackFunction)  Getting user login name MashupPlatform.context.get("username"); 19
  • 21. Wiring endpoints  Declaration on config.xml <Platform.Wiring> <InputEndpoint name="my_input_name" type="text" label="my_label" description="my_description" friendcode="some_code" /> <OutputEndpoint name="my_output_name" type="text" label="label" description="description" friendcode="url"/> </Platform.Wiring>  Input endpoints MashupPlatform.wiring.registerCallback("my_input_name", inputListener);  Output endpoints MashupPlatform.wiring.pushEvent("my_output_name", data); 20
  • 22. Making a cross-domain HTTP request  Perform the invocation and register asynchronous call-backs: MashupPlatform.http.makeRequest(url, { method: 'GET', onSuccess: function (transport) { var response; response = JSON.parse(transport.responseText); ... }, onFailure: function (transport) { onError(); } }); 21
  • 23. Connecting a widget to NGSI  Register NGSI usage on config.xml <Requirements> <Feature name="NGSI"/> </Requirements>  Send a notification through NGSI var connection = new NGSI.Connection('http://orion.lab.fi-ware.eu'); connection.updateAttributes([{ entity: { id: 'iss8', type: 'Issue' }, attributes:[{ name: 'technician', contextValue: 'tech1' }] }], { onSuccess: function () { //… }, onFailure: function () { //… } }); 22
  • 24. Connecting a widget to NGSI  Subscribe for notifications on certain entities var entityIdList = [ {type: 'Van', id: '.*', isPattern: true}, {type: 'Technician', id: '.*', isPattern: true} ]; var attributeList = null; var duration = 'PT3H'; var throttling = null; var notifyConditions = [{ type: 'ONCHANGE', condValues: ['name', 'current_position'] }]; var options = { flat: true, onNotify: process_entities, onSuccess: function (data) { subscriptionId = data.subscriptionId; refresh_interval = setInterval(refreshNGSISubscript, 1000*60*60*2);//2 hours } }; connection.createSubscription(entityIdList, attributeList, duration, throttling, notifyConditions, options); 23
  • 25. Using Object Storage from a widget  Register Object Storage usage on config.xml <Requirements> <Feature name="ObjectStorage"/> </Requirements>  Upload a file var object_storage = new ObjectStorageAPI(’<Object Storage instance url>'); var fileParts = ["<a id="a"><b id="b">hey!</b></a>"]; var myBlob = new Blob(fileParts, { "type" : "text/xml" }); object_storage.uploadFile('folder_name', myBlob, token, { file_name: 'myFile.xml', onSuccess: function () { alert('File uploaded successfully'); }, onFailure: function () { alert('Something went wrong while uploading the file'); } }); 24
  • 26. Uploading your widget  Compress (zip) the widget contents • Rename it as a .wgt file  Upload the WGT file to Local Catalogue through WireCloud web interface 25
  • 28. Resources  https://mashup.lab.fi-ware.eu You can always find the most updated documentation of Wirecloud in: • http://conwet.fi.upm.es/wirecloud  User and Programmer Guide: • https://forge.fi-ware.eu/plugins/mediawiki/wiki/fiware/index.php/Composition_Editor_- _Wirecloud_Mashup_Platform_-_User_and_Programmer_Guide  Installation and Administration Guide: • https://forge.fi-ware.eu/plugins/mediawiki/wiki/fiware/index.php/Composition_Editor_- _Wirecloud_Mashup_Platform_-_Installation_and_Administration_Guide  Download from Github: • Wirecloud source code: https://github.com/Wirecloud/wirecloud • Widget's source code of FIWARE's Live Demo mashable application component): https://github.com/wirecloud-fiware/live-demo-macs  Stuff for this workshop • http://tinyurl.com/fiware-dropbox 27
  • 29. Online videos  FIWARE Live Demo: http://www.youtube.com/watch?v=Wh_zPsLUg-8  ENVIROFI Demo: https://www.youtube.com/watch?v=yEXlLQYq7s4  Other videos: • http://www.youtube.com/embed/d7_EG42AHJw - Building a mashup from Geowidgets linked to geospatial services. • http://www.youtube.com/embed/urDGWSnrbtE - Using operators in a mashup to allow widgets to send tweets • http://www.youtube.com/embed/kW0sXMxgMLI - An example of integration with the marketplace and the catalogue GEs 28
  • 30. Sensors Wirecloud (javascript runtime) 29 NGSI IoT Adapter IoT Backend Device Management Browser Ticket Management Context Broker CEP widgets Object Storage History Location Wirecloud (server) Cosmos
  • 31. FI-WARE IoT Extended Platform Vision Plug IoT world to FI-WARE via NGSI notifications.
  • 32. FI-WARE IoT Functional Architecture (Target)
  • 33. FI-WARE IoT Challenge Architecture CONTEXT NGSI9 (Register) IDAS BROKER sendobservation NGSI10 (Observations) addobservation fizway SensorML registerdevice fizway_switchd fizway_register z-way server (Razberry HW) FIGWAY FIZWAY Devices SensorML
  • 34. Connecting a basic z-wave pack Obs. Query http://m2m.telefonica.com IDAS CONTEXT BROKER Register Observations NGSI (B) (A) SensorML Download the PI image with FIGWAY software at: http://tinyurl.com/figway-img
  • 35. HOW-TO Get Started - Z-wave basic pack 0) You need: a RaspberryPI + Razbian card plugged in its GPIO 1) Include your z-wave devices into your z-wave network Complete your sensor details in our “IoT Challenge HUB doc” https://docs.google.com/spreadsheet/ccc?key=0ArcymbqnpOfkdGNYUkpaTF9qRVhkOTFIYW14SkxaZ1E#gid=0 34 2) Edit "fizway_resgister” & "fizway" scripts Update the Device_ID number of your sensors. 3) Edit the file SensorML/Register_SWITCH Update the line containing the callback URL: "<swe:value>http://1.0.0.1:9999</swe:value>” -> Instead of 1.0.0.1 put the RaspberryPI public IP address -> Instead of 9999 set the port the switch daemon will be listening (normally, 7777) 4) Check & Edit -if necessary- the figway "Config" file. Normally, modifications aren't needed so you can skip (4). A Config.example file is provided and comments should make this task really easy. 5) Register all your working sensors by executing >./fizway_register 6) Launch the script to interconnect your sensors to FI-WARE IoT Backend: >./fizway &
  • 36. 0) Mount RaspberryPI + Razbian 35
  • 37. 0.2) Flash FIGWAY.img & Get IP address 36
  • 38. 1) Include devices into a z-wave Network 37 EXCLUDE - Razberry exclusion mode - Press 4IN1 inclusion button INCLUDE - Razberry inclusion mode - Press 4IN1 Inclusion button CONFIGURATION - Select profile Aeon multisensor 1.18 - Press 4IN1 inclusion button 3 times - Configure to send Group1 all obs (720s)
  • 39. 1) Include devices into a z-wave Network EXCLUDE - Razberry exclusion mode - Press KEYFOB 4 buttons 5sec (led slow blink) - Press button “1”, (try twice if it doesn’t work) INCLUDE - Razberry inclusion mode - Press KEYFOB 4 buttons 5sec (led slow blink) - Press button “1” CONFIGURATION - Configure remote KeyFob To apply config: WAKE-UP Device Press KEYFOB 4 buttons 5sec - Press button “2” (Try twice) Buttons in pair mode(1-3, 2-4): -> SEPARATELY Groups to send: -> SWITCH ON/OFF ONLY (SEND BASIC SET)
  • 40. 1) Include devices into a z-wave Network 39 EXCLUDE - Razberry exclude mode - Switch ON - Press ON/OFF 3 times between 1,5sec INCLUDE - Razberry inclusion mode - Switch ON - Press ON/OFF 3 times between 1,5sec NO CONFIG is needed. ALL DEVICES INCLUDED. DEVICES IDs SHOWN: 2 (4IN1), 3 (KEYFOB) , 4 (SWITCH)
  • 41. 1) Include devices into a z-wave Network 40 CONFIGURATION - Select Zwave Description Record: Wintop iLED EXCLUDE - Razberry exclude mode - Switch ON (use a screw-driver) - Press ON 3 times between 1,5sec INCLUDE - Razberry exclude mode - Switch ON (use a screw-driver) - Press ON 3 times between 1,5sec
  • 42. 1) Include devices into a z-wave Network Provide your sensors to all: “IoT Challenge HUB doc” https://docs.google.com/spreadsheet/ccc?key=0ArcymbqnpOfkdGNYUkpaTF9qRVhkOTFIYW14SkxaZ1E#gid=0 41 SHARE SENSORs IS A MUST SHARE SWITCHES IS OPTIONAL
  • 43. 2) Edit "fizway_resgister” & "fizway" scripts Update correct IDs of your z-wave network (only for Devices you have) Actuators ports should be: 7777, 7778, etc. -> Update scripts “fizway_resgister” and “fizway”. 42
  • 44. 3) Configure the SWITCH to receive commands Set the IPv4 Address of your Raspberry PI. Port is SWITCH one (7777). 43
  • 45. 4) Check & Edit the figway "Config" file Pre-configured for IoT Challenge. No modifications are needed. 44
  • 46. 5) Register all working devices in the Backend Launch de script “./fizway_resgister” For every device you’ll see a similar output as shown above. If it works, your devices are correctly register in the IDAS Backend. If it fails, increasing DEBUG level in the “Config” file helps a lot. 45
  • 47. 6) Launch fizway script Launch de script “./fizway &” You may redirect the output to a log file if you’ close the window: “./fizway >> ./fizway_log &” You’ll see: - Devices you are listening to and their Device Number (z-wave network ID). - Daemons listening for Actuators commands coming from the Backend. 46
  • 48. Building your Fi-WARE IoT Apps 1) IDAS ADMIN API – Check Services, Subscriptions & Details 47 2) IDAS ADMIN API – Check Devices & Details 3) IDAS ADMIN API – Send a command to a z-wave Switch 4) IDAS ADMIN API - Subscribe your App to Devices Notifications 5) IDAS (or Global Context Broker) NGSI API – Get last observations of a device 6) WIRECLOUD API - Connect a Wirecloud widget
  • 49. Building your Fi-WARE IoT Apps 1) IDAS ADMIN API – Check Services, Subscriptions to Service & Service Details 48
  • 50. Building your Fi-WARE IoT Apps 2) IDAS ADMIN API – Check Devices & Device Details 49
  • 51. Building your Fi-WARE IoT Apps 3) IDAS ADMIN API – Send a command to a z-wave Switch 50 COMMANDs TO SWITCHES/DIMMERS Follow “sendcommand” example. Send: “FIZCOMMAND N” N: 0-255. 0 = off, 255 = on
  • 52. Building your Fi-WARE IoT Apps 4) IDAS ADMIN API – Send a command to a z-wave Switch 51
  • 53. Building your Fi-WARE IoT Apps 5) IDAS NGSI API – Get last observations of a device 52
  • 54. Building your Fi-WARE IoT Apps 6) WIRECLOUD API - Connect a Wirecloud widget 53
  • 55. ANNEX: where to find more docs 54 - IDAS APIs http://www.fi-ware.eu - z-way server: http://en.z-wave.me/docs/zway_manual_en.pdf - Aeon 4IN1 Manual http://www.smarthus.info/support/manuals/zw_sikkerhet/aeotec_multisensor_tech.pdf - Zwave.me KeyFob https://www.uk-automation.co.uk/pdf/zwavemekeyfob.pdf - Everspring Switch/Dimmer http://doc.eedomus.com/files/EVR_AN158%20MANUEL%20US.pdf - Fibaro RGB SWITCH http://www.fibaro.com/manuals/en/FGRGBWM-441-RGBW-Controller/FGRGBWM-441-RGBW-Controller- en-2.1-2.3.pdf
  • 56. Object Storage Wirecloud (javascript runtime) • More info at “FI-WARE Cloud: bringing OpenStack to the next level” workshop (Wed 10-12am) 55 NGSI IoT Adapter IoT Backend Device Management Browser Ticket Management Context Broker CEP widgets Object Storage History Location Wirecloud (server) Cosmos • Contact Person: John Kennedy <john.m.kennedy at intel dot com >
  • 57. Cosmos Wirecloud (javascript runtime) 56 NGSI IoT Adapter IoT Backend Device Management Browser Ticket Management Context Broker CEP widgets Object Storage History Location Wirecloud (server) Cosmos • Have a look to http://tinyurl.com/c0sm0s • Contact Person: Francisco Romero <frb at tid dot es>
  • 58. Extending Live Demo Wirecloud (javascript runtime) https://github.com/wirecloud-fiware/live-demo-macs https://github.com/wirecloud-fiware/historymod 57 NGSI IoT Adapter IoT Backend Device Management Browser Ticket Management Context Broker CEP widgets Object Storage History Location Wirecloud (server) Cosmos https://github.com/telefonicaid/fiware-livedemoapp
  • 59. Useful additional references  Workshop Homepage http://tinyurl.com/fiware-cp-ws1 • Long URL: http://www.fi-ware.eu/campus-party-europedeveloping-your-first-application- workshop  The FI-WARE Catalogue http://catalogue.fi-ware.eu • With information about FI-WARE GEis, e.g. Orion Context Broker, Wirecloud, etc.  Dropbox for Workshop stuff: http://tinyurl.com/fiware-dropbox  Dropbox for Raspberry Pi image: http://tinyurl.com/figway-img • Use the following as backup in case of problems: http://130.206.82.17 58
  • 60. Thanks !  http://fi-ppp.eu  http://fi-ware.eu  Follow @Fiware on Twitter ! 59

Notas del editor

  1. Ticket Management = event2issue and location2cb
  2. Ticket Management = event2issue and location2cb
  3. Orion Context Broker is an implementation of a context information broker with persistent storage It implements OMA NGSI9/10 specification NGSI9 is about context information availability (i.e. sources of context information) management NGSI10 is about context information itself
  4. Ticket Management = event2issue and location2cb
  5. Ticket Management = event2issue and location2cb
  6. Ticket Management = event2issue and location2cb
  7. URL long names: http://wiki.fi-ware.eu/Cosmos_information_for_the_Campus_Party_Europe_in_London_2013
  8. Ticket Management = event2issue y location2cb
  9. Long URLs: https://gist.github.com/fgalan/6422169 https://www.dropbox.com/sh/iszgi1507jqimok/3ij6bOLD7U http://www.fi-ware.eu/campus-party-europedeveloping-your-first-application-workshop/