Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Käppler
ampel-firmware
Commits
cdd0d56e
Commit
cdd0d56e
authored
Dec 19, 2020
by
Eric Duminil
Browse files
Change sensor IDs for documentation
parent
87271d12
Changes
3
Show whitespace changes
Inline
Side-by-side
ampel-firmware.h
View file @
cdd0d56e
...
...
@@ -23,7 +23,7 @@
#include
"csv_writer.h"
#if defined(ESP8266)
//allows sensor to be seen as SENSOR_ID.local, from the local network. For example : espd0
5
cc
9
.local
//allows sensor to be seen as SENSOR_ID.local, from the local network. For example : espd0
3
cc
5
.local
# include <ESP8266mDNS.h>
#elif defined(ESP32)
# include <ESPmDNS.h>
...
...
config.public.h
View file @
cdd0d56e
...
...
@@ -80,13 +80,13 @@
* An MQTT subscriber can then get the data from the corresponding broker, either encrypted or unencrypted:
*
* ❯ mosquitto_sub -h 'test.mosquitto.org' -p 8883 -t 'CO2sensors/#' --cafile mosquitto.org.crt -v
* CO2sensors/ESPd0
5
cc
9
{"time":"2020-12-13 13:14:37+01", "co2":571, "temp":18.9, "rh":50.9}
* CO2sensors/ESPd0
5
cc
9
{"time":"2020-12-13 13:14:48+01", "co2":573, "temp":18.9, "rh":50.2}
* CO2sensors/ESPd0
3
cc
5
{"time":"2020-12-13 13:14:37+01", "co2":571, "temp":18.9, "rh":50.9}
* CO2sensors/ESPd0
3
cc
5
{"time":"2020-12-13 13:14:48+01", "co2":573, "temp":18.9, "rh":50.2}
* ...
*
* ❯ mosquitto_sub -h 'test.mosquitto.org' -t 'CO2sensors/#' -v
* CO2sensors/ESPd0
5
cc
9
{"time":"2020-12-13 13:15:09+01", "co2":568, "temp":18.9, "rh":50.1}
* CO2sensors/ESPd0
5
cc
9
{"time":"2020-12-13 13:15:20+01", "co2":572, "temp":18.9, "rh":50.3}
* CO2sensors/ESPd0
3
cc
5
{"time":"2020-12-13 13:15:09+01", "co2":568, "temp":18.9, "rh":50.1}
* CO2sensors/ESPd0
3
cc
5
{"time":"2020-12-13 13:15:20+01", "co2":572, "temp":18.9, "rh":50.3}
* ...
*/
...
...
mqtt.cpp
View file @
cdd0d56e
...
...
@@ -106,7 +106,7 @@ namespace mqtt {
}
void
sendInfoAboutLocalNetwork
()
{
char
info_topic
[
60
];
// Should be enough for "CO2sensors/ESPd0
5
cc
9
/info"
char
info_topic
[
60
];
// Should be enough for "CO2sensors/ESPd0
3
cc
5
/info"
snprintf
(
info_topic
,
sizeof
(
info_topic
),
"%s/info"
,
publish_topic
.
c_str
());
char
payload
[
75
];
// Should be enough for info json...
...
...
@@ -190,7 +190,7 @@ namespace mqtt {
if
(
mqttClient
.
connected
())
{
//TODO: Send local IP?
if
(
config
::
allow_mqtt_commands
)
{
char
control_topic
[
60
];
// Should be enough for "CO2sensors/ESPd0
5
cc
9
/control"
char
control_topic
[
60
];
// Should be enough for "CO2sensors/ESPd0
3
cc
5
/control"
snprintf
(
control_topic
,
sizeof
(
control_topic
),
"%s/control"
,
publish_topic
.
c_str
());
mqttClient
.
subscribe
(
control_topic
);
mqttClient
.
setCallback
(
controlSensorCallback
);
...
...
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