Skip to content

Engineering-Research-and-Development/fi-mind-bridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FI-MIND (FIWARE-MINDSPHERE) Bridge

The FI-MIND bridge close the gap between MindSphere and FIWARE environments, easing the process of sharing assets and context data (legacy factory systems, non-production IoT data sources, etc.) between the two worlds. FI-MIND Schema

Contents

Getting Started - install

Currently two options are available to install the fi-mind bridge:

Docker - Recommended

Configure MINDSPHERE config.properties setting file located in fi-mind-bridge/conf :

ocb-url=http://orion:1026
client-id={mindpshere-client-id}
client-secret={mindpshere-client-secret}
tenant={mindpshere-tenant}

Create a "docker-compose.yml" file into project root folder:

version: "3.2"
services:
   fi-mind:
      image: rdlabengpa/fi-mind-bridge:latest
      hostname: fi-mind
      networks:
        - hostnet
      ports:
        - "8080:8080"
      volumes:
        - ./conf/config.properties:/home/tomcat/custom_conf/config.properties

   mongo-db:
      image: mongo:latest
      hostname: mongo-db
      expose:
        - "27017"
      networks:
        - hostnet
      command: --bind_ip_all
      volumes:
        - mongo-db:/data

   orion:
      image: fiware/orion:latest
      hostname: orion
      depends_on:
        - mongo-db
      networks:
        - hostnet
      ports:
        - "8126:1026"
      command: -dbhost mongo-db -logLevel DEBUG

volumes:
   mongo-db:

networks:
   hostnet:

Run docker-compose commmand into project root folder:

docker-compose up

WebServer

Configure MINDSPHERE config.properties setting file located in fi-mind-bridge/src/main/resources/ :

ocb-url=http://{ocb-host}:{ocb-port}
client-id={mindpshere-client-id}
client-secret={mindpshere-client-secret}
tenant={mindpshere-tenant}

Generate WAR file executing into project root folder:

mvn clean install

Deploy WAR file (generated into target folder) on the web server of your choice.

API

Service Description
POST /ocb-export Export an existing MindSphere asset into Orion Context Broker
POST /fiware-notification Notification service to ingest data coming after subscription to Orion Context Broker
POST /alert Import an Alert entity into MindSphere
DELETE /alert?id={alert_id} Delete an Alert Asset from MindSphere
POST /alertNormalized Import a NGSI compliant Alert entity into MindSphere
POST /building Import a Building entity into MindSphere
DELETE /building?id={building_id} Delete a Building Asset from MindSphere
POST /buildingNormalized Import a NGSI compliant Building entity into MindSphere
POST /buildingOperation Import a BuildingOperation entity into MindSphere
DELETE /buildingOperation?id={buildingOperation_id} Delete a BuildingOperation Asset from MindSphere
POST /buildingOperationNormalized Import a NGSI compliant Building Operation entity into MindSphere
POST /device Import a Device entity into MindSphere
DELETE /device?id={device_id} Delete a Device Asset from MindSphere
POST /deviceNormalized Import a NGSI compliant Device entity into MindSphere
POST /deviceModel Import a Device Model entity into MindSphere
DELETE /deviceModel?id={deviceModel_id} Delete a DeviceModel Asset from MindSphere
POST /deviceModelNormalized Import a NGSI compliant Device Model entity into MindSphere
POST /trafficFlowObserved Import a TrafficFlowObserved entity into MindSphere
DELETE /trafficFlowObserved?id={trafficFlowObserved_id} Delete a TrafficFlowObserved Asset from MindSphere
POST /trafficFlowObservedNormalized Import a NGSI compliant TrafficFlowObserved entity into MindSphere
POST /vehicle Import a Vehicle entity into MindSphere
DELETE /vehicle?id={vehicle_id} Delete a Vehicle Asset from MindSphere
POST /vehicleNormalized Import a NGSI compliant Vehicle entity into MindSphere
POST /vehicleModel Import a VehicleModel entity into MindSphere
DELETE /vehicleModel?id={vehicleModel_id} Delete a VehicleModel Asset from MindSphere
POST /vehicleModelNormalized Import a NGSI compliant VehicleModel entity into MindSphere
POST /weatherForecast Import a Weather Forecast entity into MindSphere
DELETE /weatherForecast?id={weatherForecast_id} Delete a WeatherForecast Asset from MindSphere
POST /weatherForecastNormalized Import a NGSI compliant WeatherForecast entity into MindSphere
POST /weatherObserved Import a Weather Observed entity into MindSphere
DELETE /weatherObserved?id={weatherObserved_id} Delete a WeatherObserved Asset from MindSphere
POST /weatherObservedNormalized Import a NGSI compliant Weather Observed entity into MindSphere
POST /aas Import an Asset Administration Shell entity into MindSphere
DELETE /aas?id={aas_id} Delete an Asset Administration Shell Asset from MindSphere

Supported Features

FI-MIND helps you setting up a two-way channel to share context data between FIWARE and MindSphere, back and forth. The two different channels are described below:

FIWARE to MindSphere

This channel let you export a subset of FIWARE Data Models into Mindsphere Environment without loss of information. In the table below is reported the documentation for each of the chosen FIWARE Data Models to be shared in MindSphere.

FIWARE Data Model Status Comment FI-MIND Documentation
AeroAllergenObserved ❌ Out of Domain
AirQualityObserved ❌ Out of Domain
Alert βœ… πŸ“š Documentation
ArrivalEstimation ❌ Out of Domain
Beach ❌ Out of Domain
BikeHireDockingStation ❌ Out of Domain
Building βœ… πŸ“š Documentation
BuildingOperation βœ… πŸ“š Documentation
Device βœ… πŸ“š Documentation
DeviceModel βœ… πŸ“š Documentation
EVChargingStation ❌ Out of Domain
FlowerBed ❌ Out of Domain
Garden ❌ Out of Domain
GreenSpaceRecord ❌ Out of Domain
GtfsAccessPoint ❌ Out of Domain
GtfsAgency ❌ Out of Domain
GtfsCalendarDataRule ❌ Out of Domain
GtfsCalendarRule ❌ Out of Domain
GtfsFrequency ❌ Out of Domain
GtfsRoute ❌ Out of Domain
GtfsService ❌ Out of Domain
GtfsShape ❌ Out of Domain
GtfsStation ❌ Out of Domain
GtfsStop ❌ Out of Domain
GtfsStopTime ❌ Out of Domain
GtfsTransferRule ❌ Out of Domain
GtfsTrip ❌ Out of Domain
KeyPerformanceIndicator ❌ Out of Domain
Museum ❌ Out of Domain
NoiseLevelObserved ❌ Out of Domain
OffStreetParking ❌ Out of Domain
OnStreetParking ❌ Out of Domain
Open311:ServiceRequest ❌ Out of Domain
Open311:ServiceType ❌ Out of Domain
ParkingAccess ❌ Out of Domain
ParkingGroup ❌ Out of Domain
ParkingSpot ❌ Out of Domain
PointOfInterest ❌ Out of Domain
Road ❌ Out of Domain
RoadSegment ❌ Out of Domain
SmartPointOfInteraction ❌ Out of Domain
SmartSpot ❌ Out of Domain
Streetlight ❌ Out of Domain
StreetlightModel ❌ Out of Domain
StreetlightGroup ❌ Out of Domain
StreetlightControlCabinet ❌ Out of Domain
ThreePhaseAcMeasurement ❌ Out of Domain
TrafficFlowObserved βœ… πŸ“š Documentation
Vehicle βœ… πŸ“š Documentation
VehicleModel βœ… πŸ“š Documentation
WasteContainer ❌ Out of Domain
WasteContainerIsle ❌ Out of Domain
WasteContainerModel ❌ Out of Domain
WaterQualityObserved ❌ Out of Domain
WeatherForecast βœ… πŸ“š Documentation
WeatherObserved βœ… πŸ“š Documentation
MindSphere to FIWARE

Given an existing asset in MindSphere, FIMIND let you export the resource to FIWARE, simply by passing: assetId, fiwareService and fiwareServicePath as body of a HTTP POST request under the path of /ocb-export.

The export process will extract asset variables and aspect variables of the chosen asset mapping them in the proper format to be ingested by Orion Context Broker.

Exporting is not restricted to FIWARE Data Models only, every MindSphere asset can be exported even though the mapping may not be reversible without extending the current APIs.

Example
curl -X POST \
  http://{server-url}:{server-port}/fimind/webapi/ocb-export \
  -H 'accept: application/json' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
    "assetId":"mindsphere_asset_id",
    "fiwareService":"connector",
    "fiwareServicePath":"/demo"
  }'
Asset Administration Shell to MindSphere

FI-MIND bridge, expressing its interest in Industry 4.0 trend, enables support for Asset Administration Shell (AAS), a key concept of I4.0, used to describe an asset electronically in a standardized manner. Its purpose is to exchange asset-related data among industrial assets and between assets and production orchestration systems or engineering tools. Given the high complexity of a AAS model,

FI-MIND bridge currently only supports an unidirectional binding, thus, not allowing you to export a AAS model from the corresponding Mindsphere Asset.

ZVEI Data Model Status Comment FI-MIND Documentation
Asset Administration Shell 🚧 πŸ“š Documentation

Testing

You can test POST REST API by adding the header:

debug-mode : true

to the request.

Example

Request

curl -X POST \
  http://{server-url}:{server-port}/fimind/webapi/alert \
  -H 'accept: application/json' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'debug-mode: true' \
  -d '{
	"id":"fimind_alert_test",
    "type": "Alert",
    "category": "security",
    "subCategory": "robbery",
    "location": {
        "type": "Point",
        "coordinates": [-3.712247222222222, 40.423852777777775]
    },
    "dateIssued": "2017-04-25T09:25:55.00Z",
    "description": "Potential robbery in main building",
    "alertSource": "Camera1234",
    "severity": "informational"
  }'

Response

{
    "result": "Test gone fine",
    "message": null
}

WebServer logs will, then, display the proper mapping of the given entity for MindSphere.

License

The FI-MIND bridge is licensed under the

GNU Affero General Public License v3.0