From f69a05eb08029460e36794bf5cdd313a997d9403 Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Sun, 19 Dec 2021 21:51:56 +0100 Subject: [PATCH] add a path to the beacon --- data/tracker.json | 49 ++++++++++++++++++--------------------- src/LoRa_APRS_Tracker.cpp | 2 ++ src/configuration.cpp | 3 +++ src/configuration.h | 3 ++- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/data/tracker.json b/data/tracker.json index f439a10..a940672 100644 --- a/data/tracker.json +++ b/data/tracker.json @@ -1,41 +1,38 @@ { - "callsign":"NOCALL-7", + "callsign": "NOCALL-7", "debug": false, "enhance_precision": true, - "beacon": - { - "message":"LoRa Tracker", + "beacon": { + "message": "LoRa Tracker", + "path": "WIDE1-1", "timeout": 1, "button_tx": false, "symbol": "[", "overlay": "/" }, - "smart_beacon": - { - "active":true, - "turn_min":25, - "slow_rate":300, - "slow_speed":10, - "fast_rate":60, - "fast_speed":100, - "min_tx_dist":100, - "min_bcn":5 + "smart_beacon": { + "active": true, + "turn_min": 25, + "slow_rate": 300, + "slow_speed": 10, + "fast_rate": 60, + "fast_speed": 100, + "min_tx_dist": 100, + "min_bcn": 5 }, - "lora": - { - "frequency_rx":433775000, - "frequency_tx":433775000, - "power":20, - "spreading_factor":12, - "signal_bandwidth":125000, - "coding_rate4":5 + "lora": { + "frequency_rx": 433775000, + "frequency_tx": 433775000, + "power": 20, + "spreading_factor": 12, + "signal_bandwidth": 125000, + "coding_rate4": 5 }, - "ptt_output": - { - "active":false, + "ptt_output": { + "active": false, "io_pin": 4, "start_delay": 0, "end_delay": 0, - "reverse":false + "reverse": false } } diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 05d3761..6fa814c 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -187,6 +187,7 @@ void loop() { msg.setSource(Config.callsign); msg.setDestination("APLT00-1"); + msg.setPath(Config.beacon.path); if (!Config.enhance_precision) { lat = create_lat_aprs(gps.location.rawLat()); @@ -310,6 +311,7 @@ void loop() { if ((Config.debug == false) && (millis() > 5000 && gps.charsProcessed() < 10)) { logPrintlnE("No GPS frames detected! Try to reset the GPS Chip with this " "firmware: https://github.com/lora-aprs/TTGO-T-Beam_GPS-reset"); + show_display("No GPS frames detected!", "Try to reset the GPS Chip", "https://github.com/lora-aprs/TTGO-T-Beam_GPS-reset", 2000); } } diff --git a/src/configuration.cpp b/src/configuration.cpp index 3534698..5077d3f 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -39,6 +39,8 @@ Configuration ConfigurationManagement::readConfiguration() { conf.enhance_precision = data["enhance_precision"] | false; if (data.containsKey("beacon") && data["beacon"].containsKey("message")) conf.beacon.message = data["beacon"]["message"].as(); + if (data.containsKey("beacon") && data["beacon"].containsKey("path")) + conf.beacon.path = data["beacon"]["path"].as(); conf.beacon.timeout = data["beacon"]["timeout"] | 1; if (data.containsKey("beacon") && data["beacon"].containsKey("symbol")) conf.beacon.symbol = data["beacon"]["symbol"].as(); @@ -85,6 +87,7 @@ void ConfigurationManagement::writeConfiguration(Configuration conf) { data["debug"] = conf.debug; data["enhance_precision"] = conf.enhance_precision; data["beacon"]["message"] = conf.beacon.message; + data["beacon"]["path"] = conf.beacon.path; data["beacon"]["timeout"] = conf.beacon.timeout; data["beacon"]["symbol"] = conf.beacon.symbol; data["beacon"]["overlay"] = conf.beacon.overlay; diff --git a/src/configuration.h b/src/configuration.h index affa0cd..7196f59 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -9,10 +9,11 @@ class Configuration { public: class Beacon { public: - Beacon() : message("LoRa Tracker, Info: github.com/lora-aprs/LoRa_APRS_Tracker"), timeout(1), symbol("["), overlay("/"), button_tx(false) { + Beacon() : message("LoRa Tracker"), path("WIDE1-1"), timeout(1), symbol("["), overlay("/"), button_tx(false) { } String message; + String path; int timeout; String symbol; String overlay;