From 368996c0cc78f732c8c7fa9d40c491ae7ede5763 Mon Sep 17 00:00:00 2001 From: Thomas <35669080+DL3EL@users.noreply.github.com> Date: Tue, 31 May 2022 15:58:57 +0200 Subject: [PATCH 1/6] Update configuration.h --- src/configuration.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/configuration.h b/src/configuration.h index c7dae47..08e0042 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -25,7 +25,7 @@ public: int min_bcn; }; - Beacon() : callsign("NOCALL-10"), path("WIDE1-1"), message("LoRa Tracker"), timeout(1), symbol("["), overlay("/"), enhance_precision(true) { + Beacon() : callsign("NOCALL-10"), path("WIDE1-1"), message("LoRa Tracker"), timeout(1), symbol("["), overlay("/"), type(" "), enhance_precision(true) { } String callsign; @@ -34,6 +34,7 @@ public: int timeout; String symbol; String overlay; + String type; Smart_Beacon smart_beacon; bool enhance_precision; }; From bc267e9e3e222c509c4ffb15e4a13ea857a965a9 Mon Sep 17 00:00:00 2001 From: Thomas <35669080+DL3EL@users.noreply.github.com> Date: Tue, 31 May 2022 15:59:51 +0200 Subject: [PATCH 2/6] Update configuration.cpp --- src/configuration.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/configuration.cpp b/src/configuration.cpp index e69d263..1bb08ca 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -51,6 +51,8 @@ Configuration ConfigurationManagement::readConfiguration() { beacon.symbol = v["symbol"].as(); if (v.containsKey("overlay")) beacon.overlay = v["overlay"].as(); + if (v.containsKey("type")) + beacon.type = v["type"].as(); beacon.smart_beacon.active = v["smart_beacon"]["active"] | false; beacon.smart_beacon.turn_min = v["smart_beacon"]["turn_min"] | 25; From 7a685403af8c019fffebe52eae2943d56c22cee8 Mon Sep 17 00:00:00 2001 From: Thomas <35669080+DL3EL@users.noreply.github.com> Date: Tue, 31 May 2022 16:01:58 +0200 Subject: [PATCH 3/6] Update LoRa_APRS_Tracker.cpp --- src/LoRa_APRS_Tracker.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 74bade2..b1f4147 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -314,8 +314,21 @@ void loop() { } if (gps_time_update) { +// neu für lat/lng im Display + static String dlat = ""; + static String dlng = ""; + + if (gps_loc_update) { + dlat = create_lat_aprs(gps.location.rawLat()) + " " + BeaconMan.getCurrentBeaconConfig()->type; + dlng = create_long_aprs(gps.location.rawLng()); + } else { + dlat = BeaconMan.getCurrentBeaconConfig()->message; + dlng = ""; + } +// + show_display(BeaconMan.getCurrentBeaconConfig()->callsign, createDateString(now()) + " " + createTimeString(now()), String("Sats: ") + gps.satellites.value() + " HDOP: " + gps.hdop.hdop(), String("Nxt Bcn: ") + (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active ? "~" : "") + createTimeString(nextBeaconTimeStamp), BatteryIsConnected ? (String("Bat: ") + batteryVoltage + "V, " + batteryChargeCurrent + "mA") : "Powered via USB", String(dlat + " " + dlng)); - show_display(BeaconMan.getCurrentBeaconConfig()->callsign, createDateString(now()) + " " + createTimeString(now()), String("Sats: ") + gps.satellites.value() + " HDOP: " + gps.hdop.hdop(), String("Nxt Bcn: ") + (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active ? "~" : "") + createTimeString(nextBeaconTimeStamp), BatteryIsConnected ? (String("Bat: ") + batteryVoltage + "V, " + batteryChargeCurrent + "mA") : "Powered via USB", String("Smart Beacon: " + getSmartBeaconState())); +// show_display(BeaconMan.getCurrentBeaconConfig()->callsign, createDateString(now()) + " " + createTimeString(now()), String("Sats: ") + gps.satellites.value() + " HDOP: " + gps.hdop.hdop(), String("Nxt Bcn: ") + (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active ? "~" : "") + createTimeString(nextBeaconTimeStamp), BatteryIsConnected ? (String("Bat: ") + batteryVoltage + "V, " + batteryChargeCurrent + "mA") : "Powered via USB", String("Smart Beacon: " + getSmartBeaconState())); if (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active) { // Change the Tx internal based on the current speed From d39677d777940eb8e67ea0f1801aa2daf0fa20e2 Mon Sep 17 00:00:00 2001 From: Thomas <35669080+DL3EL@users.noreply.github.com> Date: Tue, 31 May 2022 16:08:08 +0200 Subject: [PATCH 4/6] Update tracker.json --- data/tracker.json | 1 + 1 file changed, 1 insertion(+) diff --git a/data/tracker.json b/data/tracker.json index 174af42..883ac3b 100644 --- a/data/tracker.json +++ b/data/tracker.json @@ -8,6 +8,7 @@ "timeout": 1, "symbol": "[", "overlay": "/", + "type": "t", "smart_beacon": { "active": true, "turn_min": 25, From 0235bb1bfe7342259357e82aa5612975ccff3a69 Mon Sep 17 00:00:00 2001 From: Thomas <35669080+DL3EL@users.noreply.github.com> Date: Tue, 31 May 2022 21:53:16 +0200 Subject: [PATCH 5/6] Show speed, course and alt in OLED, if HDOP is less than 6 --- src/LoRa_APRS_Tracker.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index b1f4147..097957d 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -326,7 +326,25 @@ void loop() { dlng = ""; } // - show_display(BeaconMan.getCurrentBeaconConfig()->callsign, createDateString(now()) + " " + createTimeString(now()), String("Sats: ") + gps.satellites.value() + " HDOP: " + gps.hdop.hdop(), String("Nxt Bcn: ") + (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active ? "~" : "") + createTimeString(nextBeaconTimeStamp), BatteryIsConnected ? (String("Bat: ") + batteryVoltage + "V, " + batteryChargeCurrent + "mA") : "Powered via USB", String(dlat + " " + dlng)); + if ((int)gps.hdop.hdop() > 5) { + csa = String("Sats: ") + gps.satellites.value() + " HDOP: " + gps.hdop.hdop(); + } else { + String alt = ""; + int alt_int = max(-99999, min(999999, (int)gps.altitude.feet())); + alt_int *= 0.3048; + if (alt_int < 0) { + alt = "-" + padding(alt_int * -1, 0) + "m "; + } else { + alt = padding(alt_int, 0) + "m "; + } + String course_and_speed = ""; + int speed_int = max(0, min(999, (int)gps.speed.knots())); + String speed = padding(speed_int * 1.852, 0) + "km/h "; + int course_int = max(0, min(360, (int)gps.course.deg())); + String course = padding(course_int, 0) + "\xF7 "; + csa = speed + course + alt + gps.satellites.value() + "/" + (int)gps.hdop.hdop(); + } + show_display(BeaconMan.getCurrentBeaconConfig()->callsign, createDateString(now()) + " " + createTimeString(now()), String(csa), String("Nxt Bcn: ") + (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active ? "~" : "") + createTimeString(nextBeaconTimeStamp), BatteryIsConnected ? (String("Bat: ") + batteryVoltage + "V, " + batteryChargeCurrent + "mA") : "Powered via USB", String(dlat + " " + dlng)); // show_display(BeaconMan.getCurrentBeaconConfig()->callsign, createDateString(now()) + " " + createTimeString(now()), String("Sats: ") + gps.satellites.value() + " HDOP: " + gps.hdop.hdop(), String("Nxt Bcn: ") + (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active ? "~" : "") + createTimeString(nextBeaconTimeStamp), BatteryIsConnected ? (String("Bat: ") + batteryVoltage + "V, " + batteryChargeCurrent + "mA") : "Powered via USB", String("Smart Beacon: " + getSmartBeaconState())); From b4b6aa887a5a28457df09b42edf08a2f223db010 Mon Sep 17 00:00:00 2001 From: DL3EL Date: Tue, 14 Jun 2022 16:44:18 +0200 Subject: [PATCH 6/6] small bugfix Signed-off-by: DL3EL --- data/tracker.json | 44 +++++++++++++++++++++++++++++++++++++-- src/LoRa_APRS_Tracker.cpp | 4 +++- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/data/tracker.json b/data/tracker.json index 883ac3b..c318f23 100644 --- a/data/tracker.json +++ b/data/tracker.json @@ -8,7 +8,27 @@ "timeout": 1, "symbol": "[", "overlay": "/", - "type": "t", + "type": "W", + "smart_beacon": { + "active": true, + "turn_min": 25, + "slow_rate": 300, + "slow_speed": 2, + "fast_rate": 60, + "fast_speed": 5, + "min_tx_dist": 100, + "min_bcn": 5 + }, + "enhance_precision": true + }, + { + "callsign": "NOCALL-7", + "path": "WIDE1-1", + "message": "LoRa Tracker", + "timeout": 1, + "symbol": "[", + "overlay": "/", + "type": "C", "smart_beacon": { "active": true, "turn_min": 25, @@ -20,6 +40,26 @@ "min_bcn": 5 }, "enhance_precision": true + }, + { + "callsign": "NOCALL-7", + "path": "WIDE1-1", + "message": "LoRa Tracker", + "timeout": 1, + "symbol": "[", + "overlay": "/", + "type": "B", + "smart_beacon": { + "active": true, + "turn_min": 25, + "slow_rate": 300, + "slow_speed": 5, + "fast_rate": 60, + "fast_speed": 20, + "min_tx_dist": 100, + "min_bcn": 5 + }, + "enhance_precision": true } ], "button": { @@ -41,4 +81,4 @@ "end_delay": 0, "reverse": false } -} +} diff --git a/src/LoRa_APRS_Tracker.cpp b/src/LoRa_APRS_Tracker.cpp index 097957d..f8465a7 100644 --- a/src/LoRa_APRS_Tracker.cpp +++ b/src/LoRa_APRS_Tracker.cpp @@ -206,6 +206,7 @@ void loop() { } } + String csa = ""; if (send_update && gps_loc_update) { send_update = false; @@ -289,7 +290,8 @@ void loop() { digitalWrite(Config.ptt.io_pin, Config.ptt.reverse ? LOW : HIGH); delay(Config.ptt.start_delay); } - + csa = alt + "/" + course_and_speed; + LoRa.beginPacket(); // Header: LoRa.write('<');