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
38845676
Commit
38845676
authored
Dec 26, 2020
by
Eric Duminil
Browse files
SENDING_INTERVAL -> MQTT_SENDING_INTERVAL
parent
7790cf72
Changes
2
Hide whitespace changes
Inline
Side-by-side
config.public.h
View file @
38845676
...
...
@@ -23,8 +23,8 @@
// How often measurements should be sent to MQTT server?
// Probably a good idea to use a multiple of MEASUREMENT_TIMESTEP, so that averages can be calculated
// Set to 0 if you want to send values after each measurement
// # define SENDING_INTERVAL MEASUREMENT_TIMESTEP * 5 // [s]
# define SENDING_INTERVAL 300 // [s]
// # define
MQTT_
SENDING_INTERVAL MEASUREMENT_TIMESTEP * 5 // [s]
# define
MQTT_
SENDING_INTERVAL 300 // [s]
// How often should measurements be appended to CSV ?
// Probably a good idea to use a multiple of MEASUREMENT_TIMESTEP, so that averages can be calculated
...
...
@@ -76,7 +76,7 @@
# define MQTT // Comment or remove this line if you want to disable MQTT
/*
* If MQTT is enabled, co2ampel will publish data every SENDING_INTERVAL seconds.
* If MQTT is enabled, co2ampel will publish data every
MQTT_
SENDING_INTERVAL seconds.
* 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
...
...
@@ -112,7 +112,6 @@
// * Arduino/libraries/MCCI_LoRaWAN_LMIC_library/project_config/lmic_project_config.h for Arduino IDE
// * platformio.ini for PlatformIO
// See https://github.com/mcci-catena/arduino-lmic#configuration for more information
// Should data be sent over LoRaWAN?
// It has been tested with "TTGO ESP32 SX1276 LoRa 868" and will only work with an ESP32 + LoRa modem
# define LORAWAN
...
...
mqtt.cpp
View file @
38845676
...
...
@@ -2,7 +2,7 @@
namespace
config
{
// Values should be defined in config.h
uint16_t
sending_interval
=
SENDING_INTERVAL
;
// [s]
uint16_t
sending_interval
=
MQTT_
SENDING_INTERVAL
;
// [s]
//INFO: Listen to every CO2 sensor which is connected to the server:
// mosquitto_sub -h MQTT_SERVER -t 'CO2sensors/#' -p 443 --capath /etc/ssl/certs/ -u "MQTT_USER" -P "MQTT_PASSWORD" -v
const
char
*
mqtt_server
=
MQTT_SERVER
;
...
...
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