This project was realised for the Epitech 4th year Global Nomad Track module "IoT Architecture".
This project creates a graphical user interface emulating IoT devices that communicate with a Thingsboard server.
- Device Manager
- Thingsboard server
- Thinksboard Intern Rules
- Devices
- Example Telemtry Data
You can download pre-built binaries from here.
Download the ZIP file, unzip it in a folder on your PC and run the executable from inside that folder. You can also create a link to this executable in order to execute it from a remote location (like your desktop).
Currently, pre-built binaries are availables for Windows 10 (64 bits) and Ubuntu (64 bits).
If your OS or processor architecture is not supported, you can also choose to build from the source code.
You can find here detailed instructions about installing Python on your machine. Make sure to use Python 3.9+, because this project depends on PySide6 (Python implementation for Qt6) which requires this version. Although it might also work with older versions, there is no guarantee.
We use cx_Freeze for packaging the executable. This library has different dependencies depending on the OS, which you can find here.
This tutorial is made for Debian/Ubuntu-based Linux distributions. Please adapt the steps to your own OS (use dnf instead of apt if you are on Fedora, for example). You python commands may differ depending on your own Python installation.
- Change directories to the one corresponding to this directory:
cd ~/Downloads/Iot_Project_Epitech- Install the dependencies of the project
pip install -r ./requirements.txt- Launch the
setup.pyscript
python ./setup.py build- Done! Your program is now in the newly-appeared
buildfolder at the root of the repository. You can now follow the rest of the intructions explained earlier in the document.
Finally, if you are using a system that is not supported by cx_Freeze (such as ARM architecture like the recent Apple M1 series processors), you can still try to launch it in developer mode. For that, please refer to the next parts of this document. Alternatively, you can try to find another tool that supports your architecture and is compatible with Qt6's deployment requirements.
python -m venv venv/.\venv\Scripts\activate.ps1.\venv\Scripts\activate.batsource venv/bin/activatepip install -r ./requirements.txtpython ./main.pyThere are 3 main places to configure the project:
-
- The
./PyOneDark_settings.jsonfile (only for the GUI)
- The
-
- The
./DeviceManager/config.pyfile (or a.envfile at the root of the repo, but it's only used for development settings, as it is not copied to the executable directory by cx_Freeze) that contains all the URLs, tokens, etc.
- The
-
- The
./docker-compose.ymlfile for the Thingsboard server's configuration.
- The
The interface is compose of 3 tabs:
- lights,
- temperature,
- fluids.

- Switch On/Off (controls only the electricity passed through the light)
- Intensity controller
- Color temperature controller


- an ink color sensor,
- a flow sensor (in milliliters per second),
- a fluid substance (=kind) sensor.
This page does not implement the Thingsboard telemetry dashboard for these sensors directly, so there are two ways of accessing it:
- opening the dashboard directly in a web browser thanks to this link,
- or going to one of the other two pages of the GUI (Lights or Temperature) and change the dashboard displayed thanks to the menu in the top-right corner of the webview.
The thingsboard server is deployed using Docker Compose. By default, the project uses a web deployment with public dashboards, hosted here (the server might not be available at the moment you read those lines, presumably because the project has become quite old).
Make sure docker-compose is installed (instructions here).
Warning: the locally deployed instance will be empty. The configurations, devices etc. available on the publically deployed server will not be available by default. Simply run the following command:
docker-compose upYou can add the -d flag to that command if you want to run it in background (detached), which is useful for deployment.
Make sure to configure the Device Manager to use the correct URL (in ./DeviceManager/config.py or via a ./.env file. For a local deployment, that would be http://localhost:8080.
You can either deploy directly on your server by forwarding the port you want to use in the ./docker-compose.yml file, or put it behind a reverse proxy (example for NGINX in ./nginx.conf).
If you configure your own Thingsboard instance, you can use the files in ./Thingsboard/ to import dashboards and rules from this project.
However, you will have to manually create the devices (a total of 9: 3 lights, 3 temperature sensors, 3 fluid sensors (1 of each kind)) and configure the GUI manually with the correct access tokens (cf. this section).
To access the Thingsboard instance, there are multiple users, with each their own credentials.
Email: sysadmin@thingsboard.org
Password: sysadmin
Email: tenant@thingsboard.org
Password: tenant
Email: customer@thingsboard.org
Password: customer
Internily to Thingsboard we create rules to verifying the data. When the data is not corresponding it's create an alarm via the rules. Depending on the alarm type the alarm severity change.
When the humidity is above 90% an alarm is created.
This rule create an alarm when the temperature is invalid. Invalid temperature is when the temperature is below -10°C and above 35°C.
When the temperature is between -10°C and -5°C an alarm is created.
When the temperature is between 30°C and 35°C an alarm is created.
Calculate the delta between the temperature of 10 minutes ago and last temperature. When the result of the delta is above 20°C an alarm is created.
When the temperature equal to 0 an alarm is created.
The temperature & humidity sensor send to server the detected temperature and humidity.
The light sensor detect the light state, intesity and color temperature. Through the dashboard the user can turn on.off the light, change the intensity and the color temperature.
The fluid sensor detect the fluid type, color and calculate the flow in ml/s. Through the dashboard the user can determine the color and the type of the fluid. And can also set the flow.
All telemetry data is send to thingsboard in JSON format.
{
"temperature": 26.87,
"humidity": 58
}{
"state": 1,
"led": 0,
"intensity": 67.18,
"color_temp": 3256
}{
"color": "cyan",
"substance": "water",
"flow_in_ml_per_s": 11.98
}