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

MQTT -> AMPEL_MQTT

parent 9b764da9
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#ifdef CSV_WRITER #ifdef CSV_WRITER
# include "csv_writer.h" # include "csv_writer.h"
#endif #endif
#ifdef MQTT #ifdef AMPEL_MQTT
# include "mqtt.h" # include "mqtt.h"
#endif #endif
#ifdef LORAWAN #ifdef LORAWAN
......
...@@ -95,7 +95,7 @@ void setup() { ...@@ -95,7 +95,7 @@ void setup() {
Serial.println(F("Error setting up MDNS responder!")); Serial.println(F("Error setting up MDNS responder!"));
} }
#ifdef MQTT #ifdef AMPEL_MQTT
mqtt::initialize("CO2sensors/" + SENSOR_ID); mqtt::initialize("CO2sensors/" + SENSOR_ID);
#endif #endif
} }
...@@ -137,7 +137,7 @@ void loop() { ...@@ -137,7 +137,7 @@ void loop() {
csv_writer::logIfTimeHasCome(sensor::timestamp, sensor::co2, sensor::temperature, sensor::humidity); csv_writer::logIfTimeHasCome(sensor::timestamp, sensor::co2, sensor::temperature, sensor::humidity);
#endif #endif
#ifdef MQTT #ifdef AMPEL_MQTT
mqtt::publishIfTimeHasCome(sensor::timestamp, sensor::co2, sensor::temperature, sensor::humidity); mqtt::publishIfTimeHasCome(sensor::timestamp, sensor::co2, sensor::temperature, sensor::humidity);
#endif #endif
...@@ -189,7 +189,7 @@ void keepServicesAlive() { ...@@ -189,7 +189,7 @@ void keepServicesAlive() {
#ifdef HTTP #ifdef HTTP
web_server::update(); web_server::update();
#endif #endif
#ifdef MQTT #ifdef AMPEL_MQTT
mqtt::keepConnection(); // MQTT client has its own timer. It will keep alive every 15s. mqtt::keepConnection(); // MQTT client has its own timer. It will keep alive every 15s.
#endif #endif
} }
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
/** /**
* MQTT SERVER * 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. * If MQTT is enabled, co2ampel will publish data every MQTT_SENDING_INTERVAL seconds.
......
...@@ -89,7 +89,7 @@ namespace web_server { ...@@ -89,7 +89,7 @@ namespace web_server {
"<tr><td>Last write</td><td>%s</td></tr>\n" "<tr><td>Last write</td><td>%s</td></tr>\n"
"<tr><td>Timestep</td><td>%5d s</td></tr>\n" "<tr><td>Timestep</td><td>%5d s</td></tr>\n"
#endif #endif
#ifdef MQTT #ifdef AMPEL_MQTT
"<tr><th colspan='2'>MQTT</th></tr>\n" "<tr><th colspan='2'>MQTT</th></tr>\n"
"<tr><td>Last publish</td><td>%s</td></tr>\n" "<tr><td>Last publish</td><td>%s</td></tr>\n"
"<tr><td>Timestep</td><td>%5d s</td></tr>\n" "<tr><td>Timestep</td><td>%5d s</td></tr>\n"
...@@ -217,7 +217,7 @@ namespace web_server { ...@@ -217,7 +217,7 @@ namespace web_server {
#ifdef CSV_WRITER #ifdef CSV_WRITER
csv_writer::last_successful_write.c_str(), config::csv_interval, csv_writer::last_successful_write.c_str(), config::csv_interval,
#endif #endif
#ifdef MQTT #ifdef AMPEL_MQTT
mqtt::last_successful_publish.c_str(), config::sending_interval, mqtt::last_successful_publish.c_str(), config::sending_interval,
#endif #endif
#if defined(LORAWAN) && defined(ESP32) #if defined(LORAWAN) && defined(ESP32)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#ifdef CSV_WRITER #ifdef CSV_WRITER
# include "csv_writer.h" # include "csv_writer.h"
#endif #endif
#ifdef MQTT #ifdef AMPEL_MQTT
# include "mqtt.h" # include "mqtt.h"
#endif #endif
#ifdef LORAWAN #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