This commit is contained in:
Peter Buchegger 2021-12-19 22:27:29 +01:00
parent 6f2fd7e959
commit a87c3ddb76
4 changed files with 32 additions and 31 deletions

View file

@ -1,23 +1,21 @@
{ {
"debug": false, "debug": false,
"enhance_precision": true, "enhance_precision": true,
"beacons": "beacons": [
[
{ {
"callsign": "NOCALL-7", "callsign": "NOCALL-7",
"path": "WIDE1-1",
"message": "LoRa Tracker", "message": "LoRa Tracker",
"timeout": 1, "timeout": 1,
"symbol": "[", "symbol": "[",
"overlay": "/" "overlay": "/"
} }
], ],
"button": "button": {
{
"tx": true, "tx": true,
"alt_message": true "alt_message": true
}, },
"smart_beacon": "smart_beacon": {
{
"active": true, "active": true,
"turn_min": 25, "turn_min": 25,
"slow_rate": 300, "slow_rate": 300,
@ -27,8 +25,7 @@
"min_tx_dist": 100, "min_tx_dist": 100,
"min_bcn": 5 "min_bcn": 5
}, },
"lora": "lora": {
{
"frequency_rx": 433775000, "frequency_rx": 433775000,
"frequency_tx": 433775000, "frequency_tx": 433775000,
"power": 20, "power": 20,
@ -36,8 +33,7 @@
"signal_bandwidth": 125000, "signal_bandwidth": 125000,
"coding_rate4": 5 "coding_rate4": 5
}, },
"ptt_output": "ptt_output": {
{
"active": false, "active": false,
"io_pin": 4, "io_pin": 4,
"start_delay": 0, "start_delay": 0,

View file

@ -197,6 +197,7 @@ void loop() {
String dao; String dao;
msg.setSource(beacon.callsign); msg.setSource(beacon.callsign);
msg.setPath(beacon.path);
msg.setDestination("APLT00-1"); msg.setDestination("APLT00-1");
if (!Config.enhance_precision) { if (!Config.enhance_precision) {

View file

@ -43,6 +43,8 @@ Configuration ConfigurationManagement::readConfiguration() {
if (v.containsKey("callsign")) if (v.containsKey("callsign"))
beacon.callsign = v["callsign"].as<String>(); beacon.callsign = v["callsign"].as<String>();
if (v.containsKey("path"))
beacon.path = v["path"].as<String>();
if (v.containsKey("message")) if (v.containsKey("message"))
beacon.message = v["message"].as<String>(); beacon.message = v["message"].as<String>();
beacon.timeout = v["timeout"] | 1; beacon.timeout = v["timeout"] | 1;
@ -95,6 +97,7 @@ void ConfigurationManagement::writeConfiguration(Configuration conf) {
for (Configuration::Beacon beacon : conf.beacons) { for (Configuration::Beacon beacon : conf.beacons) {
JsonObject v = beacons.createNestedObject(); JsonObject v = beacons.createNestedObject();
v["callsign"] = beacon.callsign; v["callsign"] = beacon.callsign;
v["path"] = beacon.path;
v["message"] = beacon.message; v["message"] = beacon.message;
v["timeout"] = beacon.timeout; v["timeout"] = beacon.timeout;
v["symbol"] = beacon.symbol; v["symbol"] = beacon.symbol;

View file

@ -1,8 +1,8 @@
#ifndef CONFIGURATION_H_ #ifndef CONFIGURATION_H_
#define CONFIGURATION_H_ #define CONFIGURATION_H_
#include <list>
#include <iterator> #include <iterator>
#include <list>
#include <Arduino.h> #include <Arduino.h>
@ -10,10 +10,11 @@ class Configuration {
public: public:
class Beacon { class Beacon {
public: public:
Beacon() : callsign("NOCALL-10"), message("LoRa Tracker, Info: github.com/lora-aprs/LoRa_APRS_Tracker"), timeout(1), symbol("["), overlay("/") { Beacon() : callsign("NOCALL-10"), path("WIDE1-1"), message("LoRa Tracker"), timeout(1), symbol("["), overlay("/") {
} }
String callsign; String callsign;
String path;
String message; String message;
int timeout; int timeout;
String symbol; String symbol;
@ -69,7 +70,7 @@ public:
int alt_message; int alt_message;
}; };
Configuration() : debug(false), enhance_precision(true), current_beacon_index(0) {}; Configuration() : debug(false), enhance_precision(true), current_beacon_index(0){};
bool debug; bool debug;
bool enhance_precision; bool enhance_precision;