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

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 ofcode 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.

Look at a “text to speech” demonstration here

Exercice: After Sign up, test services like TexttoSpeech with curl. Find more details in a step by step tutorial here.

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 on the following URL: /date
  2. Drag the http response node from the output block. This will output the payload of the msg as response of API.
  3. Add the current date as a response to the REST GET request on /date
  4. Now go to your browser and hit http://localhost:1880/date to use your WS-REST API.

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

SOA for IoT and WS-SOAP

Get started with WS-SOAP

http://www.dataaccess.com/ provide a list of WS-SOAP. The main initial difference between WS-REST and WS-SOAP was the explicit description of the WS-SOAP API in a WSDL format (Web Service Descrition Language).

Question: Thanks to

 http://www.dataaccess.com/webservicesserver/NumberConversion.wso?WSDL 

URI, display this description for NumberConversion WS-SOAP. Look at the different part of this XML file to understand the corresponding SOAP API. Test this WS-SOAP with

http://www.dataaccess.com/webservicesserver/NumberConversion.wso?op=NumberToWords
WS-SOAP in Node-Red

Soap client

Exercice: Create a WS-Soap Client to test your own WS-Soap server :

http://www.dataaccess.com/webservicesserver/NumberConversion.wso?op=NumberToWords

To do that in node-red you must install two packages :

  • node-red-contrib-soap
  • node-red-contrib-soapserver

use the manage palette to install them

correction

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
cours/mit_2018_2019/soa4iotlab.txt · Dernière modification: 2019/02/05 07:57 par tigli