Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
4 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
MQTT -> AMPEL_MQTT
parent
9b764da9
master
develop
experimental/example_for_iotwebconf
senseair_s8
v0.3.0
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.0
archive/refactor/src_structure
archive/experimental/wifimanager
archive/experimental/simple
archive/experimental/save_lora_session
archive/experimental/save_config
archive/experimental/ota
archive/experimental/binary_clock
archive/experimental/autoconnect
archive/dev/debugcalib
archive/debug/loop_too_fast
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
ampel-firmware.h
+1
-1
ampel-firmware.h
ampel-firmware.ino
+3
-3
ampel-firmware.ino
config.public.h
+1
-1
config.public.h
web_server.cpp
+2
-2
web_server.cpp
web_server.h
+1
-1
web_server.h
with
8 additions
and
8 deletions
+8
-8
ampel-firmware.h
+
1
-
1
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
...
...
This diff is collapsed.
Click to expand it.
ampel-firmware.ino
+
3
-
3
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
}
...
...
This diff is collapsed.
Click to expand it.
config.public.h
+
1
-
1
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.
...
...
This diff is collapsed.
Click to expand it.
web_server.cpp
+
2
-
2
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)
...
...
This diff is collapsed.
Click to expand it.
web_server.h
+
1
-
1
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
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets