Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
d0483949
Commit
d0483949
authored
Dec 27, 2020
by
Eric Duminil
Browse files
MQTT -> AMPEL_MQTT
parent
9b764da9
Changes
5
Hide whitespace changes
Inline
Side-by-side
ampel-firmware.h
View file @
d0483949
...
...
@@ -12,7 +12,7 @@
#ifdef CSV_WRITER
# include "csv_writer.h"
#endif
#ifdef MQTT
#ifdef
AMPEL_
MQTT
# include "mqtt.h"
#endif
#ifdef LORAWAN
...
...
ampel-firmware.ino
View file @
d0483949
...
...
@@ -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
}
...
...
config.public.h
View file @
d0483949
...
...
@@ -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.
...
...
web_server.cpp
View file @
d0483949
...
...
@@ -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)
...
...
web_server.h
View file @
d0483949
...
...
@@ -12,7 +12,7 @@
#ifdef CSV_WRITER
# include "csv_writer.h"
#endif
#ifdef MQTT
#ifdef
AMPEL_
MQTT
# include "mqtt.h"
#endif
#ifdef LORAWAN
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment