Compare commits

2 Commits
dev ... main

Author SHA1 Message Date
430eeca9eb grafcet manuel 2025-12-08 12:44:55 +01:00
50a3a765d2 Lib prometheus et paho.mqtt 2025-12-07 20:40:40 +01:00
4 changed files with 33 additions and 4 deletions

View File

@@ -15,14 +15,25 @@ RUN set -eux; \
libmicrohttpd-dev \
libcurl4-openssl-dev \
zlib1g-dev \
prometheus-cpp-dev
prometheus-cpp-dev \
nlohmann-json3-dev
RUN set -eux; \
apt-get update; \
apt-get install -y \
libpaho-mqtt-dev
RUN set -eux; \
RUN set -eux; \
git clone https://github.com/eclipse/paho.mqtt.cpp.git; \
cd paho.mqtt.cpp; \
git submodule init; \
git submodule update; \
mkdir build && cd build; \
cmake -DPAHO_WITH_MQTT_C=ON ..; \
cmake --build . --target install; \
ldconfig;
RUN set -eux; \
apt-get update; \
apt-get install -y \
librabbitmq4 \

View File

@@ -34,6 +34,7 @@ find_library(NCURSESW_LIB ncursesw REQUIRED)
find_library(RABBITMQ_LIB rabbitmq REQUIRED)
# Paho MQTT C client
find_library(PAHO_MQTTPP3_LIB paho-mqttpp3 REQUIRED)
find_library(PAHO_MQTT3C_LIB paho-mqtt3c REQUIRED)
# -------------------------------
@@ -53,5 +54,6 @@ target_link_libraries(geii_exporter
${Z_LIB}
${NCURSESW_LIB}
${RABBITMQ_LIB}
${PAHO_MQTT3C_LIB}
${PAHO_MQTT3C_LIB} # dépendance C
${PAHO_MQTTPP3_LIB} # lib C++
)

View File

@@ -6,13 +6,19 @@
#include "main.hpp"
#include "AutomForArduino.cpp"
#include <prometheus/counter.h>
#include <prometheus/gauge.h>
#include <prometheus/histogram.h>
#include <prometheus/registry.h>
#include <prometheus/exposer.h>
// Constantes de fonctionnement
#define LEVEL_MIN 2
#define FLOW_PER_PUMP 150
WINDOW *window;
int etape = 10; // Étape du grafcet : début Automatique
int etape = 0; // Étape du grafcet : début Automatique
int bp_mode, bp_mode_fm;
unsigned short pompe1, pompe2, pompe3, pompe4; // bouton des pompes 0 (arrêt) / 1 (marche)
unsigned short pompe1_old, pompe2_old, pompe3_old, pompe4_old;
@@ -778,3 +784,8 @@ void ProcessPrometheus()
{
}
void ProcessMQTT(mqtt::async_client* client)
{
}

View File

@@ -1,3 +1,6 @@
#undef timeout
#include "mqtt/async_client.h"
void ConsoleInit();
void LireClavier(int ch);
@@ -16,6 +19,8 @@ void Process();
void InitPrometheus();
void ProcessPrometheus();
void ProcessMQTT(mqtt::async_client* client);
double SimulConsoSinusoidale(long t);
double SimulConsoBrown(double valeur_precedente);