Middleware for IoT

PART A: GENERALITIES

Presentation

The “Middleware for IoT” course, taught by T. Monteil, provided an in-depth look into communication protocols and middleware solutions for IoT. The course covered middleware architectures and their applications in IoT, focusing on how to create scalable and efficient communication systems.

PART B: DESCRIPTIVE PART

Experience Details

Environment and Context

During this course, I explored both theoretical and practical aspects of middleware for IoT. The increasing importance of efficient communication protocols in IoT highlighted the relevance of this subject. The hands-on sessions allowed me to apply the concepts learned in class to real-world scenarios, which was beneficial.

My Function

In this course, I was responsible for:

PART C: TECHNICAL PART

This section explores the technical aspects of middleware for IoT, focusing on communication protocols like MQTT, OneM2M and Node-RED and their applications in real-world scenarios.

Technical Concepts Learned

1. MQTT Protocol

I learned about the MQTT protocol, which is a lightweight messaging protocol designed for small sensors and mobile devices. MQTT uses a publish/subscribe model, making it efficient for IoT applications with limited bandwidth and resources. Key features include:


2. Installing and Testing the MQTT Broker

I installed the Mosquitto broker, an open-source implementation of the MQTT protocol. Using commands like mosquitto_pub and mosquitto_sub, I tested the communication between the client and the broker, validating the setup.


3. NodeMCU and MQTT Communication

I used the ESP8266 to create an IoT device that communicates via MQTT. The NodeMCU supports Wi-Fi and can be programmed using the Arduino IDE. I configured the board to publish and subscribe to MQTT topics, enabling real-time communication with other devices.

I utilized the ArduinoMqttClient library to program the board. The objective was to update the button status on the button/state topic each time the button was pressed. Additionally, each button press triggered the extraction of luminosity data, which was then published on the light/state topic.


4. Fast Application Prototyping with Node-RED

Node-RED is a visual programming tool that simplifies IoT application development. I used Node-RED to integrate real and simulated devices, accelerating development and providing clear visualization. I implemented the following features to manage sensor data and control actuators:

a. Check MQTT Connectivity

We added an MQTT receiver block on Node-RED subscribed to the insa/luminosity topic. The debugger confirmed correct value reception.

b. Sensors and Actuators

This flow simulates a light sensor sending values. A Switch node checks if luminosity exceeds 50, toggling LED ON or OFF:

c. Dashboard

Using node-red-dashboard, we created a GUI to visualize sensor data and control devices in real-time. Graphs display sensor data, and buttons control actuators.


d. Email and Notification

Implemented with node-red-node-email, this feature sends automatic alerts when switch state or luminosity changes, ensuring proactive monitoring and quick reactions to anomalies.

PART D: ANALYTICAL PART

The Knowledge and Skills Mobilized

Self-Evaluation

This course was my first experience with concepts like MQTT and OneM2M. I found them relatively simple to use and did not encounter significant difficulties. I am aware that tools like these are extremely useful in IoT projects. Thanks to libray that exist already and forums, it is pretty simple to put in place a communication system between devices. Also I understood the utility of these concepts which lead to an utilization of few of them in our innovative project for a better functioning.

My Opinion

This was one of my favorite courses as it combined both hardware and software aspects. I aspire to work as an embedded software engineer, and this course provided a perfect blend of both domains. The labs showed a clear progression in our work on the project. We started with simple MQTT communication, moved on to using the Arduino library for MQTT, and finally integrated everything with Node-RED. This step-by-step approach made the learning process both enjoyable and highly educational.

Project Report

Open Complete Report

Open Lab Subject