From 0cc44cf9f224e4c99ed6de8b6c51e8ce9e97c2e3 Mon Sep 17 00:00:00 2001 From: richonguzman Date: Wed, 31 May 2023 12:25:07 -0400 Subject: [PATCH] updated JsonFormat --- README.md | 8 ++++++++ data/tracker_config.json | 21 +++++++-------------- src/LoRa_APRS_Tracker.cpp | 6 +++--- src/configuration.h | 12 ++++++------ 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 56cf828..99ec7d0 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,14 @@ ____________________________________________________ - All GPS beacons/packet are encoded for less time on RF/LoRa Tx. - 4th line of the OLED SCREEN shows Number of New Messages Received. - 5th line of the OLED SCREEN shows Recent Heard Trackers/Station/iGates Tx. + +____________________________________________________ + +# INSTRUCTIONS: +(1). Change _Callsign_, _Symbol_ and _Comment_ on /data/tracker_config.json +(2). Upload via Platformio --> Upload Filesystem Image (to your TTGO Board) +(3). Build and Upload the Firmware with Platformio in VSCODE + ____________________________________________________ # MENU EXPLANATION diff --git a/data/tracker_config.json b/data/tracker_config.json index 4d64751..c714099 100644 --- a/data/tracker_config.json +++ b/data/tracker_config.json @@ -14,15 +14,12 @@ "minDeltaBeacon": 20, "turnMinDeg": 12, "turnSlope": 60 - }, - "destination": "APLR01", - "path": "WIDE1-1", - "overlay": "/" + } }, { "callsign": "NOCALL-8", "symbol": "b", - "comment": "https://github.com/richonguzman/LoRa_APRS_Tracker", + "comment": "https://github.com/richonguzman/LoRa_APRS_Tracker", "smart_beacon": { "active": true, "slowRate": 120, @@ -33,11 +30,7 @@ "minDeltaBeacon": 12, "turnMinDeg": 12, "turnSlope": 60 - }, - "destination": "APLR01", - "path": "WIDE1-1", - "overlay": "/" - + } }, { "callsign": "NOCALL-9", @@ -53,10 +46,7 @@ "minDeltaBeacon": 12, "turnMinDeg": 10, "turnSlope": 80 - }, - "destination": "APLR01", - "path": "WIDE1-1", - "overlay": "/" + } } ], "lora": { @@ -67,6 +57,9 @@ "power": 20 }, "other": { + "destination": "APLR01", + "path": "WIDE1-1", + "overlay": "/", "nonSmartBeaconRate": 15, "listeningTrackerTime": 30, "maxDistanceToTracker": 30, diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 77a53bc..5e6d4f3 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -828,8 +828,8 @@ void loop() { if (send_update && gps_loc_update) { APRSMessage msg; msg.setSource(currentBeacon->callsign); - msg.setDestination(currentBeacon->destination); - msg.setPath(currentBeacon->path); + msg.setDestination(Config.destination); + msg.setPath(Config.path); float Tlat, Tlon; @@ -853,7 +853,7 @@ void loop() { if(Tlon < 0) { Tlon= -Tlon; } String infoField = "!"; - infoField += currentBeacon->overlay; + infoField += Config.overlay; char helper_base91[] = {"0000\0"}; int i; diff --git a/src/configuration.h b/src/configuration.h index a0b3691..76fee16 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -10,10 +10,7 @@ class Beacon { public: String callsign; - String destination; - String path; String symbol; - String overlay; String comment; bool smartBeaconState; int slowRate; @@ -42,6 +39,9 @@ public: std::vector beacons; LoraModule loramodule; + String destination; + String path; + String overlay; int nonSmartBeaconRate; int listeningTrackerTime; int maxDistanceToTracker; @@ -78,10 +78,7 @@ private: Beacon bcn; bcn.callsign = BeaconsArray[i]["callsign"].as(); - bcn.destination = BeaconsArray[i]["destination"].as(); - bcn.path = BeaconsArray[i]["path"].as(); bcn.symbol = BeaconsArray[i]["symbol"].as(); - bcn.overlay = BeaconsArray[i]["overlay"].as(); bcn.comment = BeaconsArray[i]["comment"].as(); bcn.smartBeaconState = BeaconsArray[i]["smart_beacon"]["active"].as(); @@ -103,6 +100,9 @@ private: loramodule.codingRate4 = data["lora"]["codingRate4"].as(); loramodule.power = data["lora"]["power"].as(); + destination = data["other"]["destination"].as(); + path = data["other"]["path"].as(); + overlay = data["other"]["overlay"].as(); nonSmartBeaconRate = data["other"]["nonSmartBeaconRate"].as(); listeningTrackerTime = data["other"]["listeningTrackerTime"].as(); maxDistanceToTracker = data["other"]["maxDistanceToTracker"].as();