SlideShare a Scribd company logo
Tutorial showing how to publish your
own IoT services/data using the
O-MI/O-DF reference implementation
1
© bIoTope Consortium 2
Tutorial showing how to publish your own IoT services/
data using the O-MI/O-DF reference implementation
Internal Agent External Agents
Node-Red Shell scripts …
Available
Tutorials
Scala
(see GitHub)
Java
(see GitHub)
https://github.com/AaltoAsia/O-MI
Tutorial: How to build an external agent with Node-red
for publishing (Create) &
Updating (Update) the state of a Philips Hue Light using
the O-MI reference implementation (via SHELL scripts)
3
bIoTope 4
Prerequisites
1 computer Windows ou Linux/MAC with the following tools installed or
directory downloaded:
• the O-MI reference implementation: https://github.com/AaltoAsia/O-MI
✦ direct URL: https://github.com/AaltoAsia/O-MI/releases/tag/0.6.4 (choose “o-mi-node-0.6.4.zip”)
=> Note: Java 1.8 is required.
• Shell scripts: https://github.com/jrobert-github/O-MI_Shell_Agent
• JSON parser library JQ: https://stedolan.github.io/jq/download/
Build the O-DF Service Tree related to the Philips
Hue light using the
O-MI reference implementation (via SHELL scripts)
5
Build the O-DF Service Tree related to the Philips Hue light using the
O-MI reference implementation (via SHELL scripts)
6
1. Start your O-MI node
To start the O-MI ref. implem., run the corresponding startup script from the bin directory for your OS:
• Windows: double-click on the file o-mi-node.bat in the bin/ directory
• Unix and Mac: open a terminal, and run the file o-mi-node in the bin/ directory (Might be needed to add
the Write access to the directory: chmod +x)
Exemple for Mac
7
2. Launch the reference implementation in your favorite browser at the following
URL: http://localhost:8080/html/webclient/index.html
Build the O-DF Service Tree related to the Philips Hue light using the
O-MI reference implementation (via SHELL scripts)
8
the postal address of the Object named “JeremysHouse”
the Object related to the Smart Light (Philips Hue Light in our case)
the state of the light’s brightness (Philips Hue Light’s property)
value: "Specify the brightness of the light” (for human understanding)
Two Metadata: range of accepted Values & additional Documentation
the state of the light (on or off)
value: "Switch on/off the light"
3. Add the O-DF structure related to the Philips Hue light
The following O-DF structure will be created — using — by following the guidelines given in the
next slides:
Build the O-DF Service Tree related to the Philips Hue light using the
O-MI reference implementation (via SHELL scripts)
9
Postal address value
Light’s brightness state
"Specify the brightness…
Range of Values &
Documentation
Light state (on or off)
"Switch on/off the light"
=
3. Add the O-DF structure related to the Philips Hue light
A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree
(right picture) and the Shell script (left picture) should be straightforward
Build the O-DF Service Tree related to the Philips Hue light using the
O-MI reference implementation (via SHELL scripts)
Every time you’ll see a red dashed
frame, it means that you need to adapt
the code depending on your application
and the underlying infrastructure
(technologies, network configuration…)
10
Postal address value
Light’s brightness state
"Specify the brightness…
Range of Values &
Documentation
Light state (on or off)
"Switch on/off the light"
=
3. Add the O-DF structure related to the Philips Hue light
A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree
(right picture) and the Shell script (left picture) should be straightforward
Build the O-DF Service Tree related to the Philips Hue light using the
O-MI reference implementation (via SHELL scripts)
11
3. Add the O-DF structure related to the Philips Hue light
A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree
(right picture) and the Shell script (left picture) should be straightforward
B. Edit the file: define_omi.sh to configure the O-MI node that you’re going to update with your “service list/tree”
NOTE:
In this demo, everything is done locally. If you
want to use the O-MI write request on remote
O-MI reference implementations, you will need
to specify/add the write access rights to a
configuration file in the O-MI reference
implementation (See Appendix A).
Build the O-DF Service Tree related to the Philips Hue light using the
O-MI reference implementation (via SHELL scripts)
12
3. Add the O-DF structure related to the Philips Hue light
A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree
(right picture) and the Shell script (left picture) should be straightforward
B. Edit the file: define_omi.sh to configure the O-MI node that you’re going to update with your “service list/tree”
C. Inside the “bin” directory, execute the following script: ./create_odf.sh
• If you go to your O-MI ref. implem. webpage and click on “Read All” again, you should now see the“service list/
tree” (cf. below screenshot)
Build the O-DF Service Tree related to the Philips Hue light using the
O-MI reference implementation (via SHELL scripts)
Creation of the “External agent”
for updating and listening the
state of the smart light
13
Creation of the “External agent” for updating
and listening the state of the smart light
14
1. Write/Update the OMI node (i.e., InfoItem) with the current state of the light
Hue API
O-MI/O-DF
15
1. Write/Update the OMI node (i.e., InfoItem) with the current state of the light
A. Inside the “agent” directory, edit the file: define_values.sh as below (technology-/platform-dependent);
Creation of the “External agent” for updating
and listening the state of the smart light
Note:
This file defines how to access the Philips Hug Light’s API to retrieve the
real-time light values (brightness, on…) => the two data items being
retrieved — API’s output being a JSON — are “state.on” and “state.bri”.
Then, we update with the retrieved values the “SmartLight_values” variable
(i.e. InfoItems named “On” and “Brightness” in our Service tree).
Hue API
16
Hue API
O-MI/O-DF
Creation of the “External agent” for updating
and listening the state of the smart light
1. Write/Update the OMI node (i.e., InfoItem) with the current state of the light
A. Inside the “agent” directory, edit the file: define_values.sh as below (technology-/platform-dependent);
B. Inside the “bin” directory, the following script: ./update_ref_implem.sh can
• Without argument/parameter:
✦ Every time you execute the command, the O-MI ref. implem., or the corresponding InfoItems to be more precise
(“Brightness” & “ON”), will be updated with the real-time light values;
✦ (UNIX only): you can add the following line to the “crontab” file, which in this specific case will update the values
every 10min.
- */10 * * * * /<File_Path>/update_ref_implem.sh> /dev/null
• With argument/parameter:
✦ If you execute the following command, the O-MI ref. implem., or the corresponding InfoItems to be more precise
(“Brightness” & “ON”), will be updated based on the requested period, which is specified as input parameter/
argument (in second; 50s in the below example);
- ./update_ref_implem.sh 50
Every time the state of the Philips Hue Light is “crawled/checked”, the O-MI
ref. implem., or the corresponding InfoItems to be more precise (named
“Brightness” & “ON” in our O-DF Service Tree), will be updated accordingly!
2. "Listen" if any change occurs on the OMI ref. implem. so as to propagate it up
to the Smart Hue light
17
O-MI/O-DF
Hue API
Sylvain sends an O-MI Write request to
turn Smart bulb OFF!
NOTE: Sylvain is not aware of and
doesn’t have to care about what Smart
Bulb technology Jérémy is using as
backend platform (the Write message
will remain the same!!)
External actor
(Sylvain)
Our Node-Red agent will update the
state as requested (if Sylvain has the
sufficient access rights)
Creation of the “External agent” for updating
and listening the state of the smart light
Jérémy’sIoTenvironment
18
Creation of the “External agent” for updating
and listening the state of the smart light
1. "Listen" the modification of the OMI node to modify the state of the light
A. Inside the “bin” directory, the following script: ./update_device can
• Without argument/parameter:
✦ Every time you execute the command, the device (smart light), or the corresponding properties to be more precise
(“bri” & “on”), will be updated with the value specified inside the O-MI Read response;
• With argument/parameter:
✦ If you execute the following command, the device (smart light), or the corresponding InfoItems to be more precise
(“bri” & “on”), will be updated based on the requested period, which is specified as input parameter/argument;
- ./update_device.sh 50
Creation of the “External agent” for updating
and listening the state of the smart light
O-MI/O-DF
Jérémy’sIoTenvironment
To note: Ideally, the “event-based” subscription mechanism supported by O-MI should be used so as to listen and update the device’s values when
a change occurs (i.e., we would only need to perform the command: ./update_device).
19
Creation of the “External agent” for updating
and listening the state of the smart light
Creation of the “External agent” for updating
and listening the state of the smart light
Hue API
O-MI/O-DF
Jérémy’sIoTenvironment
To note: Ideally, the “event-based” subscription mechanism supported by O-MI should be used so as to listen and update the device’s values when
a change occurs (i.e., we would only need to perform the command: ./update_device).
1. "Listen" the modification of the OMI node to modify the state of the light
A. Inside the “bin” directory, the following script: ./update_device can
• Without argument/parameter:
✦ Every time you execute the command, the device (smart light), or the corresponding properties to be more precise
(“bri” & “on”), will be updated with the value specified inside the O-MI Read response;
• With argument/parameter:
✦ If you execute the following command, the device (smart light), or the corresponding InfoItems to be more precise
(“bri” & “on”), will be updated based on the requested period, which is specified as input parameter/argument;
- ./update_device.sh 50
20
Standardised Service Description & Messaging Interfaces (O-MI/O-DF)
Smart City
●
●✇
●
●●
●✇
●
●
●●●
A Bottle
Bank
●● ●●
Shopping Center
✈ ❍
●
School
●
SchoolBus
●
●
Manufacturer
●✇
●
●
●✇
●
●
●✇
●
●
✙
✚
●●
●●
H
●●●
A
Landfill site
Information-as-a-
Service
O
-M
Inode
URL
1
bIoTope Service Marketplace: IoTBnB
$
http://85.171.192.185
Join the bIoTope ecosystem
and Share amazing services &
IoT data with our members
© bIoTope Consortium 21
BIOTOPE H2020 R&I
GRANT: N° 688203
Tutorial created by:
• Dr. Jérémy ROBERT
• Dr. Sylvain KUBLER
© bIoTope Consortium 22
APPENDIX A
23
1. To be written
A. To be written
24
Specify/add the write access rights to a configuration
file in the O-MI reference implementation

More Related Content

Similar to How to publish IoT data/services from your own IoT environment (Scriptshell)

Introduction to OBIEE 11g
Introduction to OBIEE 11gIntroduction to OBIEE 11g
Introduction to OBIEE 11g
iWare Logic Technologies Pvt. Ltd.
 
Integration of-click-install-apps
Integration of-click-install-appsIntegration of-click-install-apps
Integration of-click-install-apps
Swarup Hait
 
Fi dev fs_83_gl mass upload
Fi dev fs_83_gl mass uploadFi dev fs_83_gl mass upload
Fi dev fs_83_gl mass upload
ANILKUMARPULIPATI1
 
News web application
News web applicationNews web application
News web application
PrateekSingh467
 
Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5
Elad Elrom
 
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
James Gallagher
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
Nerd Tzanetopoulos
 
Ecad final
Ecad finalEcad final
Ecad final
Srinivas Sri
 
Automatic documantation with mule
Automatic documantation with muleAutomatic documantation with mule
Automatic documantation with mule
Sunil Komarapu
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
Hasan Syed
 
Mule
MuleMule
Mule
irfan1008
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
uzzal basak
 
Crud operations using aws dynamo db with flask ap is and boto3
Crud operations using aws dynamo db with flask ap is and boto3Crud operations using aws dynamo db with flask ap is and boto3
Crud operations using aws dynamo db with flask ap is and boto3
Katy Slemon
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
Nelson Kopliku
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
Anirban Sen Chowdhary
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
Mohammed246
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
Khasim Saheb
 
Documantation with mule
Documantation with mule Documantation with mule
Documantation with mule
Praneethchampion
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
mdfkhan625
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
AbdulImrankhan7
 

Similar to How to publish IoT data/services from your own IoT environment (Scriptshell) (20)

Introduction to OBIEE 11g
Introduction to OBIEE 11gIntroduction to OBIEE 11g
Introduction to OBIEE 11g
 
Integration of-click-install-apps
Integration of-click-install-appsIntegration of-click-install-apps
Integration of-click-install-apps
 
Fi dev fs_83_gl mass upload
Fi dev fs_83_gl mass uploadFi dev fs_83_gl mass upload
Fi dev fs_83_gl mass upload
 
News web application
News web applicationNews web application
News web application
 
Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5Getting Started with Adobe AIR 1.5
Getting Started with Adobe AIR 1.5
 
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
IBM Connections Activity Stream 3rd Party Integration - Social Connect VI - P...
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
Ecad final
Ecad finalEcad final
Ecad final
 
Automatic documantation with mule
Automatic documantation with muleAutomatic documantation with mule
Automatic documantation with mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Mule
MuleMule
Mule
 
Oracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11gOracle business intelligence enterprise edition 11g
Oracle business intelligence enterprise edition 11g
 
Crud operations using aws dynamo db with flask ap is and boto3
Crud operations using aws dynamo db with flask ap is and boto3Crud operations using aws dynamo db with flask ap is and boto3
Crud operations using aws dynamo db with flask ap is and boto3
 
High quality ap is with api platform
High quality ap is with api platformHigh quality ap is with api platform
High quality ap is with api platform
 
Automatic documentation with mule
Automatic documentation with mule Automatic documentation with mule
Automatic documentation with mule
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
Documantation with mule
Documantation with mule Documantation with mule
Documantation with mule
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 
Automatic documantation with mule
Automatic documantation with mule Automatic documantation with mule
Automatic documantation with mule
 

Recently uploaded

Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
ysasp1
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
cuobya
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
bseovas
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
zyfovom
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 

Recently uploaded (20)

Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
成绩单ps(UST毕业证)圣托马斯大学毕业证成绩单快速办理
 
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
可查真实(Monash毕业证)西澳大学毕业证成绩单退学买
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
留学学历(UoA毕业证)奥克兰大学毕业证成绩单官方原版办理
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
学位认证网(DU毕业证)迪肯大学毕业证成绩单一比一原版制作
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 

How to publish IoT data/services from your own IoT environment (Scriptshell)

  • 1. Tutorial showing how to publish your own IoT services/data using the O-MI/O-DF reference implementation 1
  • 2. © bIoTope Consortium 2 Tutorial showing how to publish your own IoT services/ data using the O-MI/O-DF reference implementation Internal Agent External Agents Node-Red Shell scripts … Available Tutorials Scala (see GitHub) Java (see GitHub) https://github.com/AaltoAsia/O-MI
  • 3. Tutorial: How to build an external agent with Node-red for publishing (Create) & Updating (Update) the state of a Philips Hue Light using the O-MI reference implementation (via SHELL scripts) 3
  • 4. bIoTope 4 Prerequisites 1 computer Windows ou Linux/MAC with the following tools installed or directory downloaded: • the O-MI reference implementation: https://github.com/AaltoAsia/O-MI ✦ direct URL: https://github.com/AaltoAsia/O-MI/releases/tag/0.6.4 (choose “o-mi-node-0.6.4.zip”) => Note: Java 1.8 is required. • Shell scripts: https://github.com/jrobert-github/O-MI_Shell_Agent • JSON parser library JQ: https://stedolan.github.io/jq/download/
  • 5. Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts) 5
  • 6. Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts) 6 1. Start your O-MI node To start the O-MI ref. implem., run the corresponding startup script from the bin directory for your OS: • Windows: double-click on the file o-mi-node.bat in the bin/ directory • Unix and Mac: open a terminal, and run the file o-mi-node in the bin/ directory (Might be needed to add the Write access to the directory: chmod +x) Exemple for Mac
  • 7. 7 2. Launch the reference implementation in your favorite browser at the following URL: http://localhost:8080/html/webclient/index.html Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts)
  • 8. 8 the postal address of the Object named “JeremysHouse” the Object related to the Smart Light (Philips Hue Light in our case) the state of the light’s brightness (Philips Hue Light’s property) value: "Specify the brightness of the light” (for human understanding) Two Metadata: range of accepted Values & additional Documentation the state of the light (on or off) value: "Switch on/off the light" 3. Add the O-DF structure related to the Philips Hue light The following O-DF structure will be created — using — by following the guidelines given in the next slides: Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts)
  • 9. 9 Postal address value Light’s brightness state "Specify the brightness… Range of Values & Documentation Light state (on or off) "Switch on/off the light" = 3. Add the O-DF structure related to the Philips Hue light A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree (right picture) and the Shell script (left picture) should be straightforward Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts) Every time you’ll see a red dashed frame, it means that you need to adapt the code depending on your application and the underlying infrastructure (technologies, network configuration…)
  • 10. 10 Postal address value Light’s brightness state "Specify the brightness… Range of Values & Documentation Light state (on or off) "Switch on/off the light" = 3. Add the O-DF structure related to the Philips Hue light A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree (right picture) and the Shell script (left picture) should be straightforward Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts)
  • 11. 11 3. Add the O-DF structure related to the Philips Hue light A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree (right picture) and the Shell script (left picture) should be straightforward B. Edit the file: define_omi.sh to configure the O-MI node that you’re going to update with your “service list/tree” NOTE: In this demo, everything is done locally. If you want to use the O-MI write request on remote O-MI reference implementations, you will need to specify/add the write access rights to a configuration file in the O-MI reference implementation (See Appendix A). Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts)
  • 12. 12 3. Add the O-DF structure related to the Philips Hue light A. Inside the “agent” directory, edit the file: define_odf.sh as follows; Understanding the matching between the O-DF tree (right picture) and the Shell script (left picture) should be straightforward B. Edit the file: define_omi.sh to configure the O-MI node that you’re going to update with your “service list/tree” C. Inside the “bin” directory, execute the following script: ./create_odf.sh • If you go to your O-MI ref. implem. webpage and click on “Read All” again, you should now see the“service list/ tree” (cf. below screenshot) Build the O-DF Service Tree related to the Philips Hue light using the O-MI reference implementation (via SHELL scripts)
  • 13. Creation of the “External agent” for updating and listening the state of the smart light 13
  • 14. Creation of the “External agent” for updating and listening the state of the smart light 14 1. Write/Update the OMI node (i.e., InfoItem) with the current state of the light Hue API O-MI/O-DF
  • 15. 15 1. Write/Update the OMI node (i.e., InfoItem) with the current state of the light A. Inside the “agent” directory, edit the file: define_values.sh as below (technology-/platform-dependent); Creation of the “External agent” for updating and listening the state of the smart light Note: This file defines how to access the Philips Hug Light’s API to retrieve the real-time light values (brightness, on…) => the two data items being retrieved — API’s output being a JSON — are “state.on” and “state.bri”. Then, we update with the retrieved values the “SmartLight_values” variable (i.e. InfoItems named “On” and “Brightness” in our Service tree). Hue API
  • 16. 16 Hue API O-MI/O-DF Creation of the “External agent” for updating and listening the state of the smart light 1. Write/Update the OMI node (i.e., InfoItem) with the current state of the light A. Inside the “agent” directory, edit the file: define_values.sh as below (technology-/platform-dependent); B. Inside the “bin” directory, the following script: ./update_ref_implem.sh can • Without argument/parameter: ✦ Every time you execute the command, the O-MI ref. implem., or the corresponding InfoItems to be more precise (“Brightness” & “ON”), will be updated with the real-time light values; ✦ (UNIX only): you can add the following line to the “crontab” file, which in this specific case will update the values every 10min. - */10 * * * * /<File_Path>/update_ref_implem.sh> /dev/null • With argument/parameter: ✦ If you execute the following command, the O-MI ref. implem., or the corresponding InfoItems to be more precise (“Brightness” & “ON”), will be updated based on the requested period, which is specified as input parameter/ argument (in second; 50s in the below example); - ./update_ref_implem.sh 50 Every time the state of the Philips Hue Light is “crawled/checked”, the O-MI ref. implem., or the corresponding InfoItems to be more precise (named “Brightness” & “ON” in our O-DF Service Tree), will be updated accordingly!
  • 17. 2. "Listen" if any change occurs on the OMI ref. implem. so as to propagate it up to the Smart Hue light 17 O-MI/O-DF Hue API Sylvain sends an O-MI Write request to turn Smart bulb OFF! NOTE: Sylvain is not aware of and doesn’t have to care about what Smart Bulb technology Jérémy is using as backend platform (the Write message will remain the same!!) External actor (Sylvain) Our Node-Red agent will update the state as requested (if Sylvain has the sufficient access rights) Creation of the “External agent” for updating and listening the state of the smart light Jérémy’sIoTenvironment
  • 18. 18 Creation of the “External agent” for updating and listening the state of the smart light 1. "Listen" the modification of the OMI node to modify the state of the light A. Inside the “bin” directory, the following script: ./update_device can • Without argument/parameter: ✦ Every time you execute the command, the device (smart light), or the corresponding properties to be more precise (“bri” & “on”), will be updated with the value specified inside the O-MI Read response; • With argument/parameter: ✦ If you execute the following command, the device (smart light), or the corresponding InfoItems to be more precise (“bri” & “on”), will be updated based on the requested period, which is specified as input parameter/argument; - ./update_device.sh 50 Creation of the “External agent” for updating and listening the state of the smart light O-MI/O-DF Jérémy’sIoTenvironment To note: Ideally, the “event-based” subscription mechanism supported by O-MI should be used so as to listen and update the device’s values when a change occurs (i.e., we would only need to perform the command: ./update_device).
  • 19. 19 Creation of the “External agent” for updating and listening the state of the smart light Creation of the “External agent” for updating and listening the state of the smart light Hue API O-MI/O-DF Jérémy’sIoTenvironment To note: Ideally, the “event-based” subscription mechanism supported by O-MI should be used so as to listen and update the device’s values when a change occurs (i.e., we would only need to perform the command: ./update_device). 1. "Listen" the modification of the OMI node to modify the state of the light A. Inside the “bin” directory, the following script: ./update_device can • Without argument/parameter: ✦ Every time you execute the command, the device (smart light), or the corresponding properties to be more precise (“bri” & “on”), will be updated with the value specified inside the O-MI Read response; • With argument/parameter: ✦ If you execute the following command, the device (smart light), or the corresponding InfoItems to be more precise (“bri” & “on”), will be updated based on the requested period, which is specified as input parameter/argument; - ./update_device.sh 50
  • 20. 20 Standardised Service Description & Messaging Interfaces (O-MI/O-DF) Smart City ● ●✇ ● ●● ●✇ ● ● ●●● A Bottle Bank ●● ●● Shopping Center ✈ ❍ ● School ● SchoolBus ● ● Manufacturer ●✇ ● ● ●✇ ● ● ●✇ ● ● ✙ ✚ ●● ●● H ●●● A Landfill site Information-as-a- Service O -M Inode URL 1 bIoTope Service Marketplace: IoTBnB $ http://85.171.192.185 Join the bIoTope ecosystem and Share amazing services & IoT data with our members
  • 21. © bIoTope Consortium 21 BIOTOPE H2020 R&I GRANT: N° 688203 Tutorial created by: • Dr. Jérémy ROBERT • Dr. Sylvain KUBLER
  • 24. 1. To be written A. To be written 24 Specify/add the write access rights to a configuration file in the O-MI reference implementation