Commit d0483949 authored by Eric Duminil's avatar Eric Duminil
Browse files

MQTT -> AMPEL_MQTT

parent 9b764da9
......@@ -12,7 +12,7 @@
#ifdef CSV_WRITER
# include "csv_writer.h"
#endif
#ifdef MQTT
#ifdef AMPEL_MQTT
# include "mqtt.h"
#endif
#ifdef LORAWAN
......
......@@ -95,7 +95,7 @@ void setup() {
Serial.println(F("Error setting up MDNS responder!"));
}
#ifdef MQTT
#ifdef AMPEL_MQTT
mqtt::initialize("CO2sensors/" + SENSOR_ID);
#endif
}
......@@ -137,7 +137,7 @@ void loop() {
csv_writer::logIfTimeHasCome(sensor::timestamp, sensor::co2, sensor::temperature, sensor::humidity);
#endif
#ifdef MQTT
#ifdef AMPEL_MQTT
mqtt::publishIfTimeHasCome(sensor::timestamp, sensor::co2, sensor::temperature, sensor::humidity);
#endif
......@@ -189,7 +189,7 @@ void keepServicesAlive() {
#ifdef HTTP
web_server::update();
#endif
#ifdef MQTT
#ifdef AMPEL_MQTT
mqtt::keepConnection(); // MQTT client has its own timer. It will keep alive every 15s.
#endif
}
......
......@@ -76,7 +76,7 @@
/**
* MQTT SERVER
*/
# define MQTT // Comment or remove this line if you want to disable MQTT
# define AMPEL_MQTT // Comment or remove this line if you want to disable MQTT
/*
* If MQTT is enabled, co2ampel will publish data every MQTT_SENDING_INTERVAL seconds.
......
......@@ -89,7 +89,7 @@ namespace web_server {
"<tr><td>Last write</td><td>%s</td></tr>\n"
"<tr><td>Timestep</td><td>%5d s</td></tr>\n"
#endif
#ifdef MQTT
#ifdef AMPEL_MQTT
"<tr><th colspan='2'>MQTT</th></tr>\n"
"<tr><td>Last publish</td><td>%s</td></tr>\n"
"<tr><td>Timestep</td><td>%5d s</td></tr>\n"
......@@ -217,7 +217,7 @@ namespace web_server {
#ifdef CSV_WRITER
csv_writer::last_successful_write.c_str(), config::csv_interval,
#endif
#ifdef MQTT
#ifdef AMPEL_MQTT
mqtt::last_successful_publish.c_str(), config::sending_interval,
#endif
#if defined(LORAWAN) && defined(ESP32)
......
......@@ -12,7 +12,7 @@
#ifdef CSV_WRITER
# include "csv_writer.h"
#endif
#ifdef MQTT
#ifdef AMPEL_MQTT
# include "mqtt.h"
#endif
#ifdef LORAWAN
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment