Outils pour utilisateurs

Outils du site


Panneau latéral

Accueil

Select other language :


Apprentissage

Enseignements

Enseignements Département Informatique SI5 et Master IFI

Enseignements Département Bâtiment Polytech'Nice

Autres Formations française et étrangère

Activités administratives, Ingénierie et Innovation Pédagogiques

Apprentissage Département Informatique SI5/Master 2 ingénierie informatique EUR DS4H


Recherche

Valorisation de la Recherche

Dépôts Logiciels à l’Agence de Protection des Programme (APP)

Valorisation des résultats de recherche et transfert

Diffusion de la Culture scientifique et Technologique

Communications de presse

Séminaire ENSI Tunis

Pédagogie Innovante

Relations industrielles et socio-économique

Organisation de Manifestations

  • Conférence sur les FabLabs, Alexandre Schneider, Professeur Agrégé en Génie Mécanique, Université de Reims Champagne-Ardenne Web
  • Journées UbiMob'14 Site Web

Animation de la Recherche

U-Santé

Privé

Outils

Sources d'Informations

cours:mit_2018_2019:soa4iotlab

Ceci est une ancienne révision du document !


LAB : Service Oriented Approach for IoT

Author : Jean-Yves Tigli - tigli@unice.fr

If Web Services are used for data exchange in classical distributed software, they are also used in cars, television sets, routers, printers, audio equipment, mobile phones, tablets, settop boxes, media players and is the internet transfer backbone for thousands of software applications affecting billions of humans daily.

Requirements :
  • Node RED (for example) under Docker : Node-Red

SOA for IoT and WS-REST

Get started with curl

curl is used in command lines or scripts to transfer data.

Curl is mainly used to send/receive some HTTP messages with command lines. That's the reason why curl is well adapted for first tests of Rest services.

Lot of WS-REST API are available on the web. Big compagnies provide some Cloud of Services using this kind of access. For example the IBM Cloud provides its own list of services.

Exercice: After Signin, test services like TexttoSpeech with curl.

Question: Look at IBM Watson IoT Plateform. What does it provide ?

WS-REST in Node-Red

In fact, WS-Rest basicaly uses HTTP to communicate with some GET and POST HTTP commands.

Rest client

Exercice: Get current cities temperatures and display them use openweathermap

Drag the http request node from the output block. This will output the payload of the msg as response of remote web service API.

Create a client to get Weather Temperature from openweathermap with a WS-REST

use ThingSpeak for WS-Rest that provides a Web UI

The ThingSpeak server is install on https://sparks-vm24.i3s.unice.fr/. Sign up to start using ThingSpeak getting an ID and a Key for future ThingSpeak requests (see explainations Here (you can test ThingSpeak alone with curl).

Get consecutive temperatures for a city and display them in ThingSpeak using Node-Red like in the figure.

node-red_solution_assembly_export.rtf

Rest server :

So using basic HTTP nodes, we can developp a REST server that answers to GET requests and returns some values.

Exercice: To create a WS-Rest in Node-Red :

  1. Use the http node from the input block to handle request from outside.
  2. Drag the http response node from the output block. This will output the payload of the msg as response of API.
  3. Now go to your browser and hit http://localhost:1880/users to use your WS-REST API.

Advanced Exercice: write your own REST server that getw an MQTT topic and provide it through a web service API. you can extend a past lab MQTT example to do that.

IoT Use Cases with WS-REST

SOA for IoT and WS-SOAP

Get started with WS-SOAP
WS-SOAP in Node-Red
  • Exercice: write your own client programm of a SOAP web service and node-red-contrib-soap package SOAP web service.

Soap server Usage

This package provides a node that can be used to start a Node-RED flow. The node is called soap server and listens on a configurable TCP port on the host on which Node-RED run. It is important that the port number be supplied as there is no default assumed. The listener is listening for an incoming SOAP/HTTP request. The WSDL that describes the SOAP server can be retrieved through an HTTP GET request using the /soap?wsdl URL and query parameters. For example: http:<node-RED-Host>:<port>/soap?wsdl . The endpoint for the SOAP request is found at the same address http:<node-RED-Host>:<port>/soap .

The interface supplies one operation called startFlow which takes a single parameter as input of type string. When a client invokes that operation, a new Node-RED flow is initiated. The passed in data appears in the msg.payload property of the Node-RED message.

A Node-RED flow that starts with a soap server node should also conclude with a corresponding soap server output node. This is used to pass back a value to the original SOAP client. The string found in msg.payload is returned as the response value.

  • Exercice: write your own soap server that get an MQTT topic and provide it on web service client request
IoT Use Cases with WS-SOAP

SOA for IoT and CoAP

Constrained Application Protocol (CoAP) is a specialized Internet Application Protocol for constrained devices, as defined in RFC 7252.

CoAP is a service layer protocol that is intended for use in resource-constrained internet devices, such as wireless sensor network nodes. CoAP is designed to easily translate to HTTP for simplified integration with the web, while also meeting specialized requirements such as multicast support, very low overhead, and simplicity.

Exercice : Answer to this question : why CoAP is much more adapted to Local Internet Network (on LAN) than Wide Internet Network (on WAN). What might be the solution to allow CoAP communications between distant places.

Get started with CoAP-CLI

CoAP-CLI is a command line interface for CoAP, built on node.js and node-coap. Install it under a shell after Node-Red (or at least node.js) installation with : npm install coap-cli -g

Some examples to test are then available in https://github.com/reederz/node-red-contrib-coap.git Start observe_server.js, import client_flow.json to your Node-RED instance and start red.js…

CoAP in Node-Red
IoT Use Cases with CoAP

Advanced SOA - Service Registry

Get started with UDDI
UDDI in Node-Red
IoT Use Cases with UDDI

Advanced SOA for IoT - Service Discovery Protocol

Get started with SSDP
SSDP in Node-Red
IoT Use Cases with SSDP

SOA for IoT : Web Service for Device (UPnP and DPWS)

Get started with UPnP
UPnP in Node-Red
IoT Use Cases with UPnP
Get started with DPWS
DPWS in Node-Red
IoT Use Cases with DPWs

Synthesis

Middleware for IoT are deployed on heterogeneous IoT Plateform to provide a more homogeneous way to develop some distributed software applications. Most of the time, we distinguish four levels : IoT Devices, Edge, Fog, and Cloud.

Exercice : Find in the technical and scientific litterature some definitions and recent surveys on these concepts for IoT. Write a paper (Max 2 pages long) on this 4-levels point of view of distributed system that can then emerged like CyberPhysical Systems. For example you can argue :

  • why differents patterns of communication are used in this 4-levels System,
  • what are the famoust technologies for each levels
This paper will be sent To tigli@unice.fr with Subject : <Your Name> IoT Paper 2019 as to attached files : one .zip with sources (tex/docx) and one pdf, no later than 10th of February
cours/mit_2018_2019/soa4iotlab.1548741290.txt.gz · Dernière modification: 2019/01/29 06:54 par tigli