web_config.cpp 12.7 KB
Newer Older
1
2
#include "web_config.h"

Eric Duminil's avatar
Eric Duminil committed
3
4
#define STRING_LEN 40 // Should be enough for ip, addresses, passwords...

Eric Duminil's avatar
Eric Duminil committed
5
6
7
8
9
10
11
#if defined(ESP8266)
#  include <ESP8266WebServer.h>
#elif defined(ESP32)
#  include <WebServer.h>
#endif

#include "config.h"
Eric Duminil's avatar
Eric Duminil committed
12
13
14
15
#ifndef MEASUREMENT_TIMESTEP
#  error Missing config.h file. Please copy config.public.h to config.h.
#endif

16
17
18
19
20
// Make sure AMPEL_WIFI is defined and not empty:
#if !defined(AMPEL_WIFI) || (7-AMPEL_WIFI-7 == 14)
#  error config.h has a new structure, please update it from config.public.h (e.g. AMPEL_WIFI should be set to true or false)
#endif

Eric Duminil's avatar
Eric Duminil committed
21
22
#include "util.h"
#include "sensor_console.h"
Eric Duminil's avatar
Eric Duminil committed
23

Eric Duminil's avatar
Eric Duminil committed
24
#include <IotWebConf.h>
Eric Duminil's avatar
Eric Duminil committed
25
#include <IotWebConfTParameter.h>
Eric Duminil's avatar
Eric Duminil committed
26
27
#include <IotWebConfOptionalGroup.h>

28
29
//TODO: Check memory consumption. Disable DEBUG info?
//TODO: Convert all strings to F-strings
Eric Duminil's avatar
Notes    
Eric Duminil committed
30

31
32
33
34
35
36
37
namespace web_config {
#if defined(ESP8266)
  ESP8266WebServer http(80); // Create a webserver object that listens for HTTP request on port 80
#elif defined(ESP32)
  WebServer http(80);
#endif

Eric Duminil's avatar
Eric Duminil committed
38
  DNSServer dnsServer; //TODO: Check if needed
39
40
41

  IotWebConf *iotWebConf;

Eric Duminil's avatar
Eric Duminil committed
42
  const char config_version[IOTWEBCONF_CONFIG_VERSION_LENGTH] = "a09"; // -- Configuration specific key. The value should be modified if config structure was changed.
43
  using namespace iotwebconf;
44

Eric Duminil's avatar
Eric Duminil committed
45
  /**
Eric Duminil's avatar
Eric Duminil committed
46
   * WiFi params
Eric Duminil's avatar
Eric Duminil committed
47
   */
48
49
  CheckboxTParameter ampelWifiParam =
      Builder<CheckboxTParameter>("WiFi").label("WiFi?").defaultValue(AMPEL_WIFI).build();
Eric Duminil's avatar
Eric Duminil committed
50
51
52
  IntTParameter<uint16_t> wifiTimeoutParam =
      Builder<IntTParameter<uint16_t>>("wifi_timeout").label("WiFi timeout").defaultValue(WIFI_TIMEOUT).min(0).placeholder(
          "[s]").build();
Eric Duminil's avatar
Eric Duminil committed
53

Eric Duminil's avatar
Eric Duminil committed
54
  //TODO: Distribute to corresponding classes, possibly with callbacks?
Eric Duminil's avatar
Eric Duminil committed
55
  //TODO: Chainedparameters?
Eric Duminil's avatar
Eric Duminil committed
56
57
58
  /**
   * CO2 sensor
   */
Eric Duminil's avatar
Done    
Eric Duminil committed
59
  ParameterGroup co2Params = ParameterGroup("co2", "CO2 Sensor");
Eric Duminil's avatar
Eric Duminil committed
60

Eric Duminil's avatar
Eric Duminil committed
61
62
  IntTParameter<uint16_t> timestepParam =
      Builder<IntTParameter<uint16_t>>("timestep").label("Measurement timestep").defaultValue(MEASUREMENT_TIMESTEP).min(
Eric Duminil's avatar
Eric Duminil committed
63
          2).max(1800).placeholder("[s]").build();
Eric Duminil's avatar
Eric Duminil committed
64

Eric Duminil's avatar
Eric Duminil committed
65
  FloatTParameter temperatureOffsetParam =
Eric Duminil's avatar
Eric Duminil committed
66
      Builder<FloatTParameter>("temp_offset").label("Temperature offset").defaultValue(TEMPERATURE_OFFSET).placeholder(
Eric Duminil's avatar
Eric Duminil committed
67
          "[K]").step(0.1).build();
Eric Duminil's avatar
Eric Duminil committed
68

Eric Duminil's avatar
Eric Duminil committed
69
  IntTParameter<uint16_t> altitudeParam = Builder<IntTParameter<uint16_t>>("altitude").label("Altitude").defaultValue(
Eric Duminil's avatar
Eric Duminil committed
70
  ALTITUDE_ABOVE_SEA_LEVEL).min(0).step(1).placeholder("[m]").build();
Eric Duminil's avatar
Eric Duminil committed
71

Eric Duminil's avatar
Eric Duminil committed
72
73
  IntTParameter<uint16_t> atmosphericCO2Param = Builder<IntTParameter<uint16_t>>("atmospheric_co2").label(
      "Atmospheric CO2 concentration").defaultValue(
Eric Duminil's avatar
Eric Duminil committed
74
  ATMOSPHERIC_CO2_CONCENTRATION).min(400).max(2000).step(1).placeholder("ppm").build();
Eric Duminil's avatar
Eric Duminil committed
75

Eric Duminil's avatar
Eric Duminil committed
76
  CheckboxTParameter autoCalibrateParam = Builder<CheckboxTParameter>("asc").label("Auto-calibration?").defaultValue(
Eric Duminil's avatar
Eric Duminil committed
77
  AUTO_CALIBRATE_SENSOR).build();
Eric Duminil's avatar
Eric Duminil committed
78

Eric Duminil's avatar
Eric Duminil committed
79
80
81
  /**
   * LED
   */
Eric Duminil's avatar
Eric Duminil committed
82
  //NOTE: Could also be optional : for LED 0 / 1
Eric Duminil's avatar
Eric Duminil committed
83
84
85
86
87
88
89
90
  ParameterGroup ledParams = ParameterGroup("LED", "LED");

  IntTParameter<uint8_t> maxBrightnessParam =
      Builder<IntTParameter<uint8_t>>("max_brightness").label("Max Brightness").defaultValue(MAX_BRIGHTNESS).min(0).max(
          255).build();
  IntTParameter<uint8_t> minBrightnessParam =
      Builder<IntTParameter<uint8_t>>("min_brightness").label("Min Brightness").defaultValue(MIN_BRIGHTNESS).min(0).max(
          255).build();
91
  IntTParameter<uint16_t> ledCountParam = Builder<IntTParameter<uint16_t>>("led_count").label("LED ring").defaultValue(
Eric Duminil's avatar
Eric Duminil committed
92
93
  LED_COUNT).min(12).max(16).step(4).build();

Eric Duminil's avatar
Eric Duminil committed
94
95
96
  /**
   * CSV
   */
97
  OptionalParameterGroup csvParams = OptionalParameterGroup("CSV", "CSV", AMPEL_CSV);
Eric Duminil's avatar
Eric Duminil committed
98

Eric Duminil's avatar
Eric Duminil committed
99
  IntTParameter<uint16_t> csvTimestepParam =
Eric Duminil's avatar
Eric Duminil committed
100
101
      Builder<IntTParameter<uint16_t>>("csv_timestep").label("CSV timestep").defaultValue(CSV_INTERVAL).min(0).step(1).placeholder(
          "[s]").build();
Eric Duminil's avatar
Eric Duminil committed
102
103
104
105

  /**
   * MQTT
   */
106
  OptionalParameterGroup mqttParams = OptionalParameterGroup("MQTT", "MQTT", AMPEL_MQTT);
Eric Duminil's avatar
Eric Duminil committed
107

Eric Duminil's avatar
Eric Duminil committed
108
109
  IntTParameter<uint16_t> mqttTimestepParam =
      Builder<IntTParameter<uint16_t>>("mqtt_timestep").label("MQTT timestep").defaultValue(
Eric Duminil's avatar
Eric Duminil committed
110
      MQTT_SENDING_INTERVAL).min(0).step(1).defaultValue(300).placeholder("[s]").build();
Eric Duminil's avatar
Eric Duminil committed
111

Eric Duminil's avatar
Eric Duminil committed
112
113
114
  CheckboxTParameter mqttEncryptionParam =
      Builder<CheckboxTParameter>("mqtt_encryption").label("Encrypt MQTT?").defaultValue(MQTT_ENCRYPTED).build();

Eric Duminil's avatar
Eric Duminil committed
115
  CheckboxTParameter mqttCommandsParam =
Eric Duminil's avatar
Eric Duminil committed
116
      Builder<CheckboxTParameter>("mqtt_commands").label("Allow MQTT commands?").defaultValue(ALLOW_MQTT_COMMANDS).build();
Eric Duminil's avatar
Eric Duminil committed
117

Eric Duminil's avatar
Eric Duminil committed
118
119
  TextTParameter<STRING_LEN> mqttServerParam =
      Builder<TextTParameter<STRING_LEN>>("mqtt_server").label("MQTT Server").defaultValue(MQTT_SERVER).build();
Eric Duminil's avatar
Eric Duminil committed
120

Eric Duminil's avatar
Eric Duminil committed
121
122
  IntTParameter<uint16_t> mqttPortParam = Builder<IntTParameter<uint16_t>>("mqtt_port").label("MQTT Port").defaultValue(
  MQTT_PORT).build();
Eric Duminil's avatar
Eric Duminil committed
123

Eric Duminil's avatar
Eric Duminil committed
124
125
  TextTParameter<STRING_LEN> mqttUserParam =
      Builder<TextTParameter<STRING_LEN>>("mqtt_user").label("MQTT User").defaultValue(MQTT_USER).build();
Eric Duminil's avatar
Eric Duminil committed
126

Eric Duminil's avatar
TODO    
Eric Duminil committed
127
  //TODO: Show the number of * for password?
Eric Duminil's avatar
Eric Duminil committed
128
  PasswordTParameter<STRING_LEN> mqttPasswordParam = Builder<PasswordTParameter<STRING_LEN>>("mqtt_password").label(
Eric Duminil's avatar
Eric Duminil committed
129
      "MQTT password").defaultValue(MQTT_PASSWORD).build();
Eric Duminil's avatar
Eric Duminil committed
130

Eric Duminil's avatar
Eric Duminil committed
131
132
133
  /**
   * NTP Time
   */
Eric Duminil's avatar
Eric Duminil committed
134

Eric Duminil's avatar
Eric Duminil committed
135
  ParameterGroup timeParams = ParameterGroup("NTP", "Time server");
Eric Duminil's avatar
Eric Duminil committed
136
  TextTParameter<STRING_LEN> ntpServerParam =
Eric Duminil's avatar
Eric Duminil committed
137
      Builder<TextTParameter<STRING_LEN>>("ntp_server").label("NTP Server").defaultValue(NTP_SERVER).build();
Eric Duminil's avatar
Eric Duminil committed
138
  IntTParameter<int16_t> timeOffsetParam = Builder<IntTParameter<int16_t>>("timezone").label("Timezone").defaultValue(
Eric Duminil's avatar
Eric Duminil committed
139
      (UTC_OFFSET_IN_SECONDS) / 3600).min(-23).max(23).step(1).placeholder("[h]").build();
Eric Duminil's avatar
Eric Duminil committed
140
  CheckboxTParameter dstParam =
Eric Duminil's avatar
Eric Duminil committed
141
      Builder<CheckboxTParameter>("dst").label("Daylight Saving Time?").defaultValue(false).build();
142

Eric Duminil's avatar
Eric Duminil committed
143
  /**
Eric Duminil's avatar
TODO    
Eric Duminil committed
144
   * LoRaWAN
Eric Duminil's avatar
Eric Duminil committed
145
   */
Eric Duminil's avatar
Eric Duminil committed
146
#if defined(ESP32)
147
  OptionalParameterGroup loraParams = OptionalParameterGroup("LoRaWan", "LoRaWan", AMPEL_LORAWAN);
Eric Duminil's avatar
Eric Duminil committed
148
149
  IntTParameter<uint16_t> loraTimestepParam =
      Builder<IntTParameter<uint16_t>>("lora_timestep").label("LoRa timestep").defaultValue(
Eric Duminil's avatar
Eric Duminil committed
150
151
      LORAWAN_SENDING_INTERVAL).min(0).step(1).defaultValue(300).placeholder("[s]").build();

Eric Duminil's avatar
TODO    
Eric Duminil committed
152
  //TODO: Use those parameters
Eric Duminil's avatar
Eric Duminil committed
153
154
155
156
157
158
  TextTParameter<17> deviceEUIParam = Builder<TextTParameter<17>>("device_eui").label("Device EUI").defaultValue(
      "70B3D5...").build();
  TextTParameter<17> appEUIParam =
      Builder<TextTParameter<17>>("app_eui").label("App EUI").defaultValue("00EA07...").build();
  TextTParameter<32> appKeyParam =
      Builder<TextTParameter<32>>("app_key").label("App key").defaultValue("81CCFE...").build();
Eric Duminil's avatar
TODO    
Eric Duminil committed
159
  //TODO: Save LoRa session to hidden parameter after first OTAA successful login
Eric Duminil's avatar
Eric Duminil committed
160
#endif
161

Eric Duminil's avatar
Eric Duminil committed
162
  OptionalGroupHtmlFormatProvider optionalGroupHtmlFormatProvider;
163
164
165
166
167

  void update() {
    iotWebConf->doLoop(); // Listen for HTTP requests from clients
  }

Eric Duminil's avatar
Eric Duminil committed
168
169
  void setWifiConnectionCallback(void (*success_function)()) {
    iotWebConf->setWifiConnectionCallback(success_function);
Eric Duminil's avatar
Eric Duminil committed
170
171
  }

Eric Duminil's avatar
Eric Duminil committed
172
173
174
  void setWifiFailCallback(void (*fail_function)()) {
    std::function<WifiAuthInfo* ()> fail_and_return_null = [fail_function]() {
      fail_function();
Eric Duminil's avatar
Eric Duminil committed
175
      iotWebConf->forceApMode(true); // Will stay in AP.
Eric Duminil's avatar
Eric Duminil committed
176
177
178
      return nullptr;
    };
    iotWebConf->setWifiConnectionFailedHandler(fail_and_return_null);
Eric Duminil's avatar
Eric Duminil committed
179
180
  }

181
182
183
  void initialize() {
    iotWebConf = new IotWebConf(ampel.sensorId, &dnsServer, &http, HTTP_PASSWORD, config_version);

184
185
186
    iotWebConf->setHtmlFormatProvider(&optionalGroupHtmlFormatProvider);

    iotWebConf->addSystemParameter(&ampelWifiParam);
Eric Duminil's avatar
Eric Duminil committed
187
    iotWebConf->addSystemParameter(&wifiTimeoutParam);
Eric Duminil's avatar
Eric Duminil committed
188
189
190

    co2Params.addItem(&timestepParam);
    co2Params.addItem(&temperatureOffsetParam);
Eric Duminil's avatar
Eric Duminil committed
191
192
193
    co2Params.addItem(&altitudeParam);
    co2Params.addItem(&atmosphericCO2Param);
    co2Params.addItem(&autoCalibrateParam);
Eric Duminil's avatar
Eric Duminil committed
194

Eric Duminil's avatar
Eric Duminil committed
195
    ledParams.addItem(&minBrightnessParam);
Eric Duminil's avatar
Eric Duminil committed
196
    ledParams.addItem(&maxBrightnessParam);
Eric Duminil's avatar
Eric Duminil committed
197
198
    ledParams.addItem(&ledCountParam);

Eric Duminil's avatar
Eric Duminil committed
199
    timeParams.addItem(&ntpServerParam);
200
201
202
    timeParams.addItem(&timeOffsetParam);
    timeParams.addItem(&dstParam);

Eric Duminil's avatar
Eric Duminil committed
203
204
205
206
207
208
209
    csvParams.addItem(&csvTimestepParam);

    mqttParams.addItem(&mqttTimestepParam);
    mqttParams.addItem(&mqttServerParam);
    mqttParams.addItem(&mqttPortParam);
    mqttParams.addItem(&mqttUserParam);
    mqttParams.addItem(&mqttPasswordParam);
Eric Duminil's avatar
Eric Duminil committed
210
211
    mqttParams.addItem(&mqttEncryptionParam);
    mqttParams.addItem(&mqttCommandsParam);
Eric Duminil's avatar
Eric Duminil committed
212

Eric Duminil's avatar
Eric Duminil committed
213
#if defined(ESP32)
214
    loraParams.addItem(&loraTimestepParam);
Eric Duminil's avatar
Eric Duminil committed
215
216
217
    loraParams.addItem(&deviceEUIParam);
    loraParams.addItem(&appEUIParam);
    loraParams.addItem(&appKeyParam);
Eric Duminil's avatar
Eric Duminil committed
218
#endif
219

Eric Duminil's avatar
Eric Duminil committed
220
    iotWebConf->addParameterGroup(&co2Params);
Eric Duminil's avatar
Eric Duminil committed
221
    iotWebConf->addParameterGroup(&ledParams);
222
    iotWebConf->addParameterGroup(&timeParams);
Eric Duminil's avatar
Eric Duminil committed
223
224
    iotWebConf->addParameterGroup(&csvParams);
    iotWebConf->addParameterGroup(&mqttParams);
Eric Duminil's avatar
Eric Duminil committed
225
#if defined(ESP32)
226
    iotWebConf->addParameterGroup(&loraParams);
Eric Duminil's avatar
Eric Duminil committed
227
#endif
Eric Duminil's avatar
Eric Duminil committed
228

Eric Duminil's avatar
Eric Duminil committed
229
    //TODO: Add "ap" command?
Eric Duminil's avatar
Eric Duminil committed
230
231
    sensor_console::defineCommand("reset_config", []() {
      Serial.println(F("Resetting config..."));
Eric Duminil's avatar
Eric Duminil committed
232
      iotWebConf->getRootParameterGroup()->applyDefaultValue();
Eric Duminil's avatar
Eric Duminil committed
233
234
235
236
      iotWebConf->saveConfig();
      Serial.println(F("Done!"));
    }, F("(resets the complete IotWeb config)"));

Eric Duminil's avatar
Eric Duminil committed
237
238
239
240
241
    sensor_console::defineIntCommand("wifi", [](int32_t onOff) {
      config::wifi_active = onOff;
      iotWebConf->saveConfig();
      Serial.print(F("WiFi - "));
      Serial.println(onOff ? F("On!") : F("Off!"));
Eric Duminil's avatar
Doc    
Eric Duminil committed
242
    }, F("0/1 (Turns Wifi on/off)."));
Eric Duminil's avatar
Eric Duminil committed
243

Eric Duminil's avatar
Eric Duminil committed
244
    iotWebConf->loadConfig();
Eric Duminil's avatar
Eric Duminil committed
245
246
247
248
249

    if (!config::wifi_active) {
      Serial.println(F("Wifi is off : no access point or connection. Use 'wifi 1' to turn on again!"));
      return;
    }
Eric Duminil's avatar
Eric Duminil committed
250

251
252
253
254
255
256
    const int ONBOARD_LED_PIN = 2;
# ifdef ESP8266
    iotWebConf->setStatusPin(ONBOARD_LED_PIN, LOW);
# else
    iotWebConf->setStatusPin(ONBOARD_LED_PIN, HIGH);
# endif
Eric Duminil's avatar
Eric Duminil committed
257
258

    iotWebConf->setWifiConnectionTimeoutMs(1000UL * config::wifi_timeout);
259
260
261
262
263
264
265
266
267
268
269
270
271

    iotWebConf->skipApStartup();
    //TODO: Add callbacks
    //TODO: Add LED effects
    //TODO: Allow offline config loading
    //TODO: Add default values for SSID/password
    //TODO: Add other params
    //TODO: Use HTTP_USER / HTTP_PASSWORD for config
    //TODO: Remove AP Password config?
    //TODO: Save LoRaWAN key if possible?

    iotWebConf->init();

Eric Duminil's avatar
Eric Duminil committed
272
273
    //TODO: Authenticate only if required?
    //TODO: / captive fast return?
274
275
276
277

    http.on("/config", [] {
      iotWebConf->handleConfig();
    });
Eric Duminil's avatar
Eric Duminil committed
278

279
280
281
282
283
    http.onNotFound([]() {
      iotWebConf->handleNotFound();
    });
  }
}
Eric Duminil's avatar
Eric Duminil committed
284

Eric Duminil's avatar
Eric Duminil committed
285
286
287
/***
 * Define all the corresponding config values as reference, so that they can be updated.
 */
Eric Duminil's avatar
Eric Duminil committed
288
namespace config {
Eric Duminil's avatar
Eric Duminil committed
289

Eric Duminil's avatar
Eric Duminil committed
290
291
292
293
  char* ampel_name() {
    return web_config::iotWebConf->getThingName();
  }

Eric Duminil's avatar
Rename    
Eric Duminil committed
294
  char* selected_ssid() {
Eric Duminil's avatar
Eric Duminil committed
295
296
297
    return web_config::iotWebConf->getWifiSsidParameter()->valueBuffer;
  }

Eric Duminil's avatar
Eric Duminil committed
298
299
300
301
  char* ap_password() {
    return web_config::iotWebConf->getApPasswordParameter()->valueBuffer;
  }

Eric Duminil's avatar
Eric Duminil committed
302
  // Sensor
303
304
305
306
307
308
  uint16_t &measurement_timestep = web_config::timestepParam.value(); // [s] Value between 2 and 1800 (range for SCD30 sensor).
  uint16_t &altitude_above_sea_level = web_config::altitudeParam.value(); // [m]
  uint16_t &co2_calibration_level = web_config::atmosphericCO2Param.value(); // [ppm]
  bool &auto_calibrate_sensor = web_config::autoCalibrateParam.value(); // [true / false]
  float &temperature_offset = web_config::temperatureOffsetParam.value(); // [K] Sign isn't relevant.

Eric Duminil's avatar
Eric Duminil committed
309
  bool &wifi_active = web_config::ampelWifiParam.value();
Eric Duminil's avatar
Eric Duminil committed
310
  uint16_t &wifi_timeout = web_config::wifiTimeoutParam.value();
Eric Duminil's avatar
Eric Duminil committed
311
312
313
  void save() {
    web_config::iotWebConf->saveConfig();
  }
Eric Duminil's avatar
Eric Duminil committed
314

Eric Duminil's avatar
Eric Duminil committed
315
  // LEDs
316
317
318
  uint8_t &max_brightness = web_config::maxBrightnessParam.value();
  uint8_t &min_brightness = web_config::minBrightnessParam.value();
  uint16_t &led_count = web_config::ledCountParam.value();
Eric Duminil's avatar
Eric Duminil committed
319

Eric Duminil's avatar
Eric Duminil committed
320
321
  // Time server
  char *ntp_server = web_config::ntpServerParam.value();
Eric Duminil's avatar
Eric Duminil committed
322
  int16_t &time_zone = web_config::timeOffsetParam.value();
Eric Duminil's avatar
Eric Duminil committed
323
324
  bool &daylight_saving_time = web_config::dstParam.value();

Eric Duminil's avatar
Eric Duminil committed
325
  // CSV
326
327
328
  bool csv_active() {
    return web_config::csvParams.isActive();
  }
Eric Duminil's avatar
Eric Duminil committed
329
330
  uint16_t &csv_interval = web_config::csvTimestepParam.value();

331
  // MQTT
Eric Duminil's avatar
Eric Duminil committed
332
333
334
  bool mqtt_active() {
    return web_config::mqttParams.isActive();
  }
Eric Duminil's avatar
Eric Duminil committed
335
336
337
338
  char *mqtt_server = web_config::mqttServerParam.value();
  char *mqtt_user = web_config::mqttUserParam.value();
  char *mqtt_password = web_config::mqttPasswordParam.value();
  uint16_t &mqtt_port = web_config::mqttPortParam.value();
Eric Duminil's avatar
Eric Duminil committed
339
  uint16_t &mqtt_sending_interval = web_config::mqttTimestepParam.value();
Eric Duminil's avatar
Eric Duminil committed
340
  bool &mqtt_encryption = web_config::mqttEncryptionParam.value();
Eric Duminil's avatar
Eric Duminil committed
341
  bool &allow_mqtt_commands = web_config::mqttCommandsParam.value();
Eric Duminil's avatar
Eric Duminil committed
342

Eric Duminil's avatar
Eric Duminil committed
343
344
345
346
  // HTTP
//  const char *http_user = IOTWEBCONF_ADMIN_USER_NAME; // "admin" by default
//  char *http_password = web_config::iotWebConf->getApPasswordParameter()->valueBuffer;

Eric Duminil's avatar
Eric Duminil committed
347
348
349
350
351
352
  // LORAWAN
#if defined(ESP32)
  bool lorawan_active() {
    return web_config::loraParams.isActive();
  }
#endif
Eric Duminil's avatar
Eric Duminil committed
353
}