Welcome to the MiniProject powered by FIWARE. This project is aimed at showcasing the use of FIWARE components to create a smart environment involving IoT, linked data, and integration of external APIs.
This MiniProject powered by FIWARE is an educational project designed to help users learn about FIWARE environments by leveraging the technologies, protocols, and solutions it offers. It is focused on a Smart City scenario involving buildings, sensors, actuators, and more. Keep in mind that this is a small-scale development scenario aimed at learning and getting started in the world of FIWARE.
The project involves setting up an intelligent scenario using various FIWARE components. The project is deployed using Docker Compose, and the scenario includes multiple IoT devices simulated through MQTT, with data integration handled by Node-RED.
Follow the detailed steps in the provided readme files to deploy and configure the environment, initialize the scenario, and enable the integration of IoT and external data sources.
If you have any questions or need further assistance, please feel free to reach out!
To keep things simple all components will be run using Docker. Docker is a container technology which allows to different components isolated into their respective environments.
- To install Docker on Linux follow the instructions here
Docker Compose is a tool for defining and running multi-container Docker applications. A YAML file is used configure the required services for the application. This means all container services can be brought up in a single command. Docker Compose is installed by default as part of Docker for Windows and Docker for Mac, however Linux users will need to follow the instructions found here
You can check your current Docker and Docker Compose versions using the following commands:
docker compose -v
docker versionPlease ensure that you are using Docker version 24.0.x or higher and Docker Compose 2.24.x or higher and upgrade if necessary.
You can start up our services using a simple bash script. Windows users should download the Windows Subsystem for Linux to provide a command-line functionality similar to a Linux distribution on Windows.
Before you start you should ensure that you have obtained or built the necessary Docker images locally. Please clone the repository by running the commands as shown:
git clone https://github.com/piripopero/miniproject-excellcity-winterschool.gitThis document provides an overview of the architecture, data models, and steps to get started with deploying and configuring the scenario locally.
The project architecture consists of several FIWARE services deployed using Docker and Docker Compose. Below, you will find an illustration of the project architecture and the data model diagram.
- Grafana: Used for visualization and monitoring of time-series data, allowing dashboards to be built for the analysis of IoT data.
- Orion-LD (Context Broker): Manages context information and handles NGSI-LD queries and subscriptions.
- IoT-Agent (JSON): Manages the communication with IoT devices using the JSON protocol and MQTT.
- MongoDB: Stores context data for Orion-LD and IoT-Agent. (2 different databases but same instance)
- TimescaleDB: Handles time-series data for analytics.
- Mintaka: Handles temporal queries of NGSI-LD data.
- Node-RED: Handles external API integrations, such as fetching weather data and simulating IoT devices reporting via MQTT.
- Mosquitto: MQTT broker for managing IoT device messages.
- Apache HTTP Server: Serves the
context.jsonldfile for linked data.
The data model diagram provides an overview of the entities used in this project, such as Building, BuildingSpace, and Device. These entities are essential for setting up the scenario and have various attributes used in managing smart environment functionalities.
These data models are based on SmartDataModels repository, provided by FIWARE:
- Building -> https://github.com/smart-data-models/dataModel.Building/tree/master/Building
- BuildingSpace -> https://github.com/smart-data-models/dataModel.S4BLDG/tree/master/BuildingSpace
- Device -> https://github.com/smart-data-models/dataModel.Device/tree/master/Device
- WeatherObserved -> https://github.com/smart-data-models/dataModel.Weather/tree/master/WeatherObserved
- WeatherForecast -> https://github.com/smart-data-models/dataModel.Weather/tree/master/WeatherForecast
This section will guide you through the technical steps involved in deploying and configuring the project.
All entity data used to initialize the scenario can be found in the following directory:
/import-data
This directory contains JSON files such as buildings.json, buildingspaces.json,devices.json, weatherforecast.json and weatherobserved.json which are used to define the entities in the scenario. These entities include static attributes that are required for the simulation.
To deploy the scenario using Docker and Docker Compose, please follow the instructions provided in the deployment readme:
The deploy.sh script is designed to automate the setup of FIWARE services, including Orion-LD, IoT-Agent, MongoDB, TimescaleDB, Mintaka, Node-RED, Mosquitto, Apache, and Grafana.
Once the scenario is initialized with the static entity data (such as Building, BuildingSpace, and Device), the next step is to configure the integration layer. This involves setting up the IoT-Agent JSON for managing MQTT devices and configuring Node-RED flows for integration with external APIs.
An essential step in setting up Node-RED is importing the pre-configured flows to ensure everything works correctly from the start. The flows can be imported using the file named flows-nodered-v2.json. The following two images illustrate the process of importing the Node-RED flows, making it easy for you to get started.
For more information on configuring the integration layer, please refer to the following readme:
IoT Agent Configuration README
External Source Integration with NodeRED README
This README will guide you through setting up Node-RED flows and configuring the IoT-Agent JSON to communicate with IoT devices via MQTT, as well as integrating external data sources such as weather APIs.
Important note: The device provisioning process is manual. If you want to start viewing data reports, you need to provision each device individually as indicated in IoT Configuration README . The respective requests for this process can also be found in the provided Postman collection in this repo
Once the IoT-Agent is initialized and configured, the next step is to prepare the visualization tool, Grafana. For guidance on setting up Grafana, please refer to the following readme:
For questions, issues, or suggestions, feel free to reach out:
Juan Sanchez Valverde 📧 Email: [email protected]
Portions of this software are derived from the FIWARE project:
- Copyright (c) 2020-2023 FIWARE
- Licensed under the MIT License (https://github.com/FIWARE/tutorials.NGSI-LD)



