iot discovery tutorial
TRANSCRIPT
Connecting to the IoT
@UniSurreyIoT
Contact email
Tutorial: IoT Discovery
slideshare
UniSurreyIoT
Things connected?
• Data sent to context broker?
• What if you want to expose direct access to you things?
• You need to advertise them
– Register their availability
• Let users/applications know what your thing is about
– And how to reach it
Outline
• About
• NGSI-9
• Deployment
• Register
• Discovery
• Subscribe
• Update subscription
• Notify
3
IoT Discovery
About
• Technically: a service discovery mechanism– for announcing availability of context sources
via service endpoints
– Employs NGSI-9
• Synonyms: directory, registry, repository
• Analogy: “yellow pages”– Info about service provided, and how to
contact, but does not provide data
• IoT Architecture– Implementation of Configuration Manager GE
IoT Discovery
NGSI-9/10
• NGSI-9
– Context source availability
– Register, discover
• NGSI-10
– Context information retrieval
– Query, subscribe
• NGSI-9 is adopted in IoT Discovery
Why NGSI-9?
• Discover what is available
– Before querying for data
– Know where actual context sources are
• Not only relying on Context Broker
– Know what entities are available and what attributes they have beforehand
– Avoid unnecessary network overload of IoT services.
• IoT Services might be constrained
Target Users
• NGSI-9 Clients– Context Producers
• Any IoT Agent– Exposes a service endpoint for data/actuation provision via NGSI-10
(“data interface”)– e.g. gateway
• Data Handling GE– Register resources; sensing sources, actuators, processing elements
(composite of sensing sources)
• Backend device management GE– Register sensing sources, aggregated sensing sources
– Context Consumers• Applications• IoT Broker
– Discover entities on behalf of the consumers– retrieves, assembles, and processes information from the providers– offers consumers a simple interface and masking the complexity and
heterogeneity of the IoT
• Context Broker– Subscribes for notification of context source availability
1(a). Deploy IoT Discovery from image
• Prerequisite– To have a FIWARE Lab account
• Steps– Go to IoT Discovery catalogue page
– Follow the steps in “Deploying a dedicated GE instance based on an image” in the “Creating Instances tab”
– Check IoT Discovery is working using the “/sanityCheck” operation from your local computer• http://hostname:8080/ngsi9/sanityCheck
• Hints– Remember to set the security group properly
(typically to allow port 8080)
1(b). Deploy on your own running instance
• Alternative in the case you already have a VM in FIWARE Lab and don’t want to deploy another want
• Refer to Installation & Admin Guide• Prerequisite
– Java 8– mysql-server/client, tomcat7– Tested on Ubuntu 14.04 VM and Windows 7
• Steps– Download and extract package– Copy war files to tomcat /webapps folder
• Hints– Refer to installation and admin guide– Remember to set the security group properly (typically
to port 8080)
1(c). Interact with global instance
• Pre-requisites
– FIWARE Lab account
– Get Authentication token
– Auth-token inserted in request header
• X-Auth-Token: SAFJxc323dfiDS32IDEWF..
• Address of global instance
– iot-discovery.lab.fiware.org
– Port 80
Interface
• Operations for context source availability– Registration– Discovery– Subscription– Update Subscription– Unsubscribe– Notification
• Standard– POST
• Convenience– GET, POST, UPDATE, DELETE (more RESTful)
What you will need to start
• A REST client
– Browser plugin
– Client program in your programming language.
2. Registration
• Prerequisites– Step 1
• Goal– Register an entity(s) to the NGSI-9 Server
• Standard Op– URL: http://{serverRoot}/ngsi9/registerContext
– Method: POST
– Payload: registerContextRequest
3. Registration Update
• Prerequisites
– Step 2 – registration done
• Goal
– Register an entity(s) to the NGSI-9 Server
• Standard Op– URL: http://{serverRoot}/ngsi9/registerContext
– Method: POST
– Payload: registerContextRequest
4. Discover
• Prerequisites– Step 2 – registration done
• Goal– Discover an entity(s) at the NGSI-9 Server
• Standard Op– URL: http://{serverRoot}/ngsi9/discoverContextAvailability
– Method: POST
– Payload: discoverContextAvailabilityRequest
5. Subscribe
• Prerequisites– Step 4 – no results from discovery
• Goal– Subscribe to availability of an entity(s) to the NGSI-9
Server
• Standard Op– URL: http://{serverRoot}/ngsi9/subscribeContextAvailability
– Method: POST
– Payload: subscribeContextAvailabilityRequest
6. Update Subscription
• Prerequisites– Step 5 – Already subscribed
• Goal– Update Subscription to availability of an entity(s) to the NGSI-9
Server
• Standard Op– URL: http://{serverRoot}/ngsi9/updateContextAvailabilitySubscription
– Method: POST
– Payload: updateContextAvailabilitySubscriptionRequest
7. Unsubscribe
• Prerequisites– Step 5 – Already subscribed
• Goal– Unsubscribe to availability of an entity(s) to the NGSI-9 Server
• Standard Op– URL: http://{serverRoot}/ngsi9/unsubscribeContextAvailability
– Method: POST
– Payload: unsubscribeContextAvailabilityRequest
8. Notification
• Prerequisites– Step 5: Subscription already done
• Goal– Notify availability of an entity(s) to an NGSI-9 subscriber
• Standard Op– URL: http://{serverRoot}/ngsi9/notifyContextAvailability
– Method: POST
– Payload: notifyContextAvailabilityRequest
Resources
• Slideshare:• http://www.slideshare.net/UniSurreyIo
T/iotdiscoverytutorial• FIWARE Wiki
– Catalogue– Installation and Admin guide– FI-WARE NGSI Open RESTful API
Specification– User’s and Programmer’s guide– Unit Tests for NGSI-9 Server
FIWARE and IoT
• Provide Generic Enablers for IoT Service Enablement
• enable “things” to become citizens of the Internet– available, searchable, accessible, and
usable
• for Applications to create value from real-world interaction – enabled by ubiquity of heterogeneous and
resource-constrained devices.