BresserWeatherSensorLW
Bresser 868 MHz Weather Sensor Radio Receiver based on ESP32/RP2040 and SX1262/SX1276/LR1121 - sends data to a LoRaWAN Network
Loading...
Searching...
No Matches
LoadNodeCfg.h File Reference

Load LoRaWAN node configuration 'node_config.json' from LittleFS, if available. More...

#include <Arduino.h>
#include <LittleFS.h>
#include <ArduinoJson.h>
#include "../BresserWeatherSensorLWCfg.h"
#include "logging.h"
Include dependency graph for LoadNodeCfg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void loadNodeCfg (String &tzinfo, uint16_t &voltage_eco_exit, uint16_t &voltage_eco_enter, uint16_t &voltage_critical, uint16_t &batt_discharge_lim, uint16_t &batt_charge_lim, struct sPowerFeatherCfg &powerFeatherCfg, struct sM5StackCfg &m5StackCfg)
 Load LoRaWAN node configuration 'node_config.json' from LittleFS, if available.

Detailed Description

Load LoRaWAN node configuration 'node_config.json' from LittleFS, if available.

This configuration file is intended for hardware/deployment environment specific settings (e.g. battery voltage thresholds, timezone).

Function Documentation

◆ loadNodeCfg()

void loadNodeCfg ( String & tzinfo,
uint16_t & voltage_eco_exit,
uint16_t & voltage_eco_enter,
uint16_t & voltage_critical,
uint16_t & batt_discharge_lim,
uint16_t & batt_charge_lim,
struct sPowerFeatherCfg & powerFeatherCfg,
struct sM5StackCfg & m5StackCfg )

Load LoRaWAN node configuration 'node_config.json' from LittleFS, if available.

Returns all values by reference. Keeps the original value(s) if file not found, cannot be parsed or any value is missing.

JSON file format: { "timezone": "CET-1CEST,M3.5.0,M10.5.0/3", "voltage_eco_exit": 3580, "voltage_eco_enter": 3500, "voltage_critical": 3300, "battery_discharge_lim": 3200, "battery_charge_lim": 4200, "powerfeather": { "battery_capacity":, 2200 "supply_maintain_voltage": 5500, "max_charge_current": 50, "soc_eco_enter": 20, "soc_eco_exit": 25, "soc_critical": 5, "temperature_measurement": false, "battery_fuel_gauge": true }, "m5stack": { "soc_eco_enter": 20, "soc_eco_exit": 25, "soc_critical": 3 } }