Skip to content

OSTLCLab/SmartFactory_MQTTCommunication-UnderReview

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This code needs a review: Reveiw with nyfelix needed and then merge into SmartFactory_MQTTCommunication

SmartFactory_MQTTCommunication

The SmartFactroy_MQTTCommunication is an modular part of the SmartFactory project. MQTTCommunication establishes a WLAN-connection and allows you to connect with an MQTT-Broker to send and receive message.
Incomming messages have to be in a known JSON-format and will be serialized with the SmartFactory_Messages library. This library is an redundant library with SmartFacotry_MQTTCommunication. It uses the WiFi.h library to work with an Esp32 DevKitC. In addition the callback function and the buffers are no longer implemented in this class.

Table of contents

Tools and technologies

The Source-code is written in C++. To achieve this project, the following tools and technologies were used.

Doxygen

Doxygen is used for the documentation of the source code.
An intorduction to Doxygen and how to install it can be found in the ArdFSM-Repo.

VSCode PlatformIO

The used IDE is VSCode with the PlatformIO-extension.

MQTT

MQTT (Message Queuing Telemetry Transport) is a lightweight publish-subscribe messaging protocol and requires a broker to relay the messages. It's used for M2M (machine-to-machine) communication.
An MQTT-system always consist of a broker and one or multiple clients, which can be either subscriber or publisher.

mqtt

[Image: MQTT101 - Eclispe Foundation]

A client can subscribe and publish to one or multiple topics. Topics are organized in a tree similar to a folder-structure in Windows. Here's an example of how such a topic-tree and published message can look like:

This images also illustrates the scalability of MQTT appropriately.
For more Infos about MQTT and MQTT-topics check out the MQTT-Wiki on Github.
[Source: Wiki:MQTT, MQTT ]

Documentation

Hardware

This code needs a WLAN-shield to function properly.
It's tested with a Esp32 DevKitC from Espressif.

Software

All functions and files are documented on the GitHub-Page with Doxygen

UML

The figure below shows the data model in UML notation.

Click on the image to open doxygen-documentation.

Include graph

Click on the image to open doxygen-documentation.

External libraries:

Important functions and files

MQTTCommunication.h

The MQTTCommunication.h-file serves as interface. It provides the functions for:

  • Network-connection
  • MQTT-functionalities
  • access the message-storage (circular buffer)

CommunicationConfiguration.h

In the CommunicationConfiguration.h-file are all important settings defined:

  • WLAN SSID
  • WLAN password
  • MQTT Broker IP
  • JSON parse size

FAQ's

I'd like to use this code in my project. What do I need to know?

All you need to do is add the GitHub-Link to this Repo under lib_deps in your platformio.ini File and you're set up. All dependencies are downloaded automatic.

Where can I change the configurations like MQTT-Broker IP and WLAN-Credentials?

All the Configuration data is stored in the CommunicationConfiguration.h file and can be edited there.

ToDo's

All the ToDo's are documented in the source code with Doxygen.

Contributors

Changelog

V 1.0 - Release BA FS19 - Luca Mazzoleni

V 2.0 - Release SA HS20 - Philip Zellweger

License

MIT License

Links to SmartFactory

Packages

No packages published

Languages

  • C++ 92.7%
  • C 7.3%