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
afa49c20
Commit
afa49c20
authored
Feb 09, 2022
by
Eric Duminil
Browse files
Checking if MQTT is active
parent
985e9560
Pipeline
#5771
passed with stage
in 2 minutes and 15 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ampel-firmware/mqtt.cpp
View file @
afa49c20
...
...
@@ -42,6 +42,8 @@ namespace mqtt {
char
last_successful_publish
[
23
]
=
""
;
void
initialize
(
const
char
*
sensorId
)
{
Serial
.
print
(
"MQTT ? "
);
Serial
.
println
(
config
::
mqtt_active
());
json_sensor_format
=
PSTR
(
"{
\"
time
\"
:
\"
%s
\"
,
\"
co2
\"
:%d,
\"
temp
\"
:%.1f,
\"
rh
\"
:%.1f}"
);
snprintf
(
publish_topic
,
sizeof
(
publish_topic
),
"CO2sensors/%s"
,
sensorId
);
#if MQTT_ENCRYPTED
...
...
ampel-firmware/web_config.cpp
View file @
afa49c20
...
...
@@ -295,6 +295,9 @@ namespace config {
uint16_t
&
csv_interval
=
web_config
::
csvTimestepParam
.
value
();
// MQTT
bool
mqtt_active
()
{
return
web_config
::
mqttParams
.
isActive
();
}
char
*
mqtt_server
=
web_config
::
mqttServerParam
.
value
();
char
*
mqtt_user
=
web_config
::
mqttUserParam
.
value
();
char
*
mqtt_password
=
web_config
::
mqttPasswordParam
.
value
();
...
...
ampel-firmware/web_config.h
View file @
afa49c20
...
...
@@ -32,7 +32,7 @@ namespace config {
extern
uint16_t
&
csv_interval
;
// [s]
// MQTT
//TODO: Add use_mqtt
bool
mqtt_active
();
extern
char
*
mqtt_server
;
extern
char
*
mqtt_user
;
extern
char
*
mqtt_password
;
...
...
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