diff --git a/config.public.h b/config.public.h index a97a6e27a784b852a4638660b96c4edcc485a60f..6f5da26df7396be93b7c7aedf19fb19a079be520 100644 --- a/config.public.h +++ b/config.public.h @@ -2,14 +2,23 @@ # define CONFIG_H_INCLUDED // This file is a config template, and can be copied to config.h. Please don't save any important password in this template. -//TODO: Copy structure from config.h + +/** + * SERVICES + */ + +// Comment or remove those lines if you want to disable the corresponding services +# define AMPEL_WIFI // WiFi, and all other dependent services (MQTT, HTTP, NTP, ...) +# define AMPEL_HTTP // Should HTTP web server be started? +# define AMPEL_MQTT // Should data be sent over MQTT? +# define AMPEL_LORAWAN // Should data be sent over LoRaWAN? (Requires ESP32 + LoRa modem) +# define AMPEL_CSV // Should data be logged as CSV, on the ESP flash memory? /** * WIFI */ -// Setting WIFI_SSID to "NO_WIFI" will disable WiFi completely, and all other dependent services (MQTT, HTTP, NTP, ...) -# define WIFI_SSID "NO_WIFI" +# define WIFI_SSID "MY_SSID" # define WIFI_PASSWORD "P4SSW0RD" # define WIFI_TIMEOUT 30 // [s] @@ -21,18 +30,10 @@ //NOTE: SCD30 timer does not seem to be very precise. Variations may occur. # define MEASUREMENT_TIMESTEP 60 // [s] Value between 2 and 1800 (range for SCD30 sensor) -// 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 MQTT_SENDING_INTERVAL MEASUREMENT_TIMESTEP * 5 // [s] -# define MQTT_SENDING_INTERVAL 300 // [s] - -// Should data be written to the sensor Flash memory? Writing too often might damage the ESP memory -# define AMPEL_CSV // Comment or remove this line if you want to disable CSV logging. - // 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 // Set to 0 if you want to send values after each measurement +// WARNING: Writing too often might damage the ESP memory # define CSV_INTERVAL 300 // [s] // Residual heat from CO2 sensor seems to be high enough to change the temperature reading. How much should it be offset? @@ -68,19 +69,16 @@ * available at http://local_ip, with user HTTP_USER and password HTTP_PASSWORD */ -# define AMPEL_HTTP // Comment or remove this line if you want to disable HTTP webserver - // Define empty strings in order to disable authentication, or remove the constants altogether. # define HTTP_USER "co2ampel" # define HTTP_PASSWORD "my_password" /** - * MQTT SERVER + * 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. + * If AMPEL_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 @@ -102,6 +100,11 @@ */ # define ALLOW_MQTT_COMMANDS false +// 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 MQTT_SENDING_INTERVAL MEASUREMENT_TIMESTEP * 5 // [s] +# define MQTT_SENDING_INTERVAL 60 // [s] # define MQTT_SERVER "test.mosquitto.org" // MQTT server URL or IP address # define MQTT_PORT 8883 # define MQTT_USER "" @@ -116,9 +119,9 @@ // * 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 AMPEL_LORAWAN +// In order to use LoRaWAN, a gateway should be close to the co2ampel, and an account, an application and a device should be registered, +// e.g. on https://www.thethingsnetwork.org/docs/applications/ // How often should measurements be sent over LoRaWAN? # define LORAWAN_SENDING_INTERVAL 300 // [s] This value should not be too low. See https://www.thethingsnetwork.org/docs/lorawan/duty-cycle.html#maximum-duty-cycle // This EUI must be in little-endian format, so least-significant-byte first.