Commit e2bb5beb authored by Eric Duminil's avatar Eric Duminil
Browse files

LORAWAN -> AMPEL_LORAWAN

parent 4201db6d
......@@ -15,7 +15,7 @@
#ifdef AMPEL_MQTT
# include "mqtt.h"
#endif
#ifdef LORAWAN
#ifdef AMPEL_LORAWAN
# include "lorawan.h"
#endif
#ifdef AMPEL_HTTP
......
......@@ -104,7 +104,7 @@ void setup() {
csv_writer::initialize();
#endif
#if defined(LORAWAN) && defined(ESP32)
#if defined(AMPEL_LORAWAN) && defined(ESP32)
lorawan::initialize();
#endif
}
......@@ -114,7 +114,7 @@ void setup() {
*****************************************************************/
void loop() {
#if defined(LORAWAN) && defined(ESP32)
#if defined(AMPEL_LORAWAN) && defined(ESP32)
//LMIC Library seems to be very sensitive to timing issues, so run it first.
lorawan::process();
......@@ -141,7 +141,7 @@ void loop() {
mqtt::publishIfTimeHasCome(sensor::timestamp, sensor::co2, sensor::temperature, sensor::humidity);
#endif
#if defined(LORAWAN) && defined(ESP32)
#if defined(AMPEL_LORAWAN) && defined(ESP32)
lorawan::preparePayloadIfTimeHasCome(sensor::co2, sensor::temperature, sensor::humidity);
#endif
}
......
......@@ -117,7 +117,7 @@
// 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
# define AMPEL_LORAWAN
// 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.
......
......@@ -94,7 +94,7 @@ namespace web_server {
"<tr><td>Last publish</td><td>%s</td></tr>\n"
"<tr><td>Timestep</td><td>%5d s</td></tr>\n"
#endif
#if defined(LORAWAN) && defined(ESP32)
#if defined(AMPEL_LORAWAN) && defined(ESP32)
"<tr><th colspan='2'>LoRaWAN</th></tr>\n"
"<tr><td>Connected?</td><td>%s</td></tr>\n"
"<tr><td>Frequency</td><td>%s MHz</td></tr>\n"
......@@ -220,7 +220,7 @@ namespace web_server {
#ifdef AMPEL_MQTT
mqtt::last_successful_publish.c_str(), config::sending_interval,
#endif
#if defined(LORAWAN) && defined(ESP32)
#if defined(AMPEL_LORAWAN) && defined(ESP32)
lorawan::connected ? "Yes" : "No", LMIC_FREQUENCY_PLAN, lorawan::last_transmission.c_str(),
config::lorawan_sending_interval,
#endif
......
......@@ -15,7 +15,7 @@
#ifdef AMPEL_MQTT
# include "mqtt.h"
#endif
#ifdef LORAWAN
#ifdef AMPEL_LORAWAN
# include "lorawan.h"
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment