Merge b4b6aa887a
into c78da085d5
This commit is contained in:
commit
f2d2bb224a
4 changed files with 81 additions and 4 deletions
|
@ -8,6 +8,27 @@
|
||||||
"timeout": 1,
|
"timeout": 1,
|
||||||
"symbol": "[",
|
"symbol": "[",
|
||||||
"overlay": "/",
|
"overlay": "/",
|
||||||
|
"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": {
|
"smart_beacon": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"turn_min": 25,
|
"turn_min": 25,
|
||||||
|
@ -19,6 +40,26 @@
|
||||||
"min_bcn": 5
|
"min_bcn": 5
|
||||||
},
|
},
|
||||||
"enhance_precision": true
|
"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": {
|
"button": {
|
||||||
|
|
|
@ -206,6 +206,7 @@ void loop() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String csa = "";
|
||||||
if (send_update && gps_loc_update) {
|
if (send_update && gps_loc_update) {
|
||||||
send_update = false;
|
send_update = false;
|
||||||
|
|
||||||
|
@ -289,6 +290,7 @@ void loop() {
|
||||||
digitalWrite(Config.ptt.io_pin, Config.ptt.reverse ? LOW : HIGH);
|
digitalWrite(Config.ptt.io_pin, Config.ptt.reverse ? LOW : HIGH);
|
||||||
delay(Config.ptt.start_delay);
|
delay(Config.ptt.start_delay);
|
||||||
}
|
}
|
||||||
|
csa = alt + "/" + course_and_speed;
|
||||||
|
|
||||||
LoRa.beginPacket();
|
LoRa.beginPacket();
|
||||||
// Header:
|
// Header:
|
||||||
|
@ -314,8 +316,39 @@ void loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gps_time_update) {
|
if (gps_time_update) {
|
||||||
|
// neu für lat/lng im Display
|
||||||
|
static String dlat = "";
|
||||||
|
static String 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()));
|
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 = "";
|
||||||
|
}
|
||||||
|
//
|
||||||
|
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()));
|
||||||
|
|
||||||
if (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active) {
|
if (BeaconMan.getCurrentBeaconConfig()->smart_beacon.active) {
|
||||||
// Change the Tx internal based on the current speed
|
// Change the Tx internal based on the current speed
|
||||||
|
|
|
@ -51,6 +51,8 @@ Configuration ConfigurationManagement::readConfiguration() {
|
||||||
beacon.symbol = v["symbol"].as<String>();
|
beacon.symbol = v["symbol"].as<String>();
|
||||||
if (v.containsKey("overlay"))
|
if (v.containsKey("overlay"))
|
||||||
beacon.overlay = v["overlay"].as<String>();
|
beacon.overlay = v["overlay"].as<String>();
|
||||||
|
if (v.containsKey("type"))
|
||||||
|
beacon.type = v["type"].as<String>();
|
||||||
|
|
||||||
beacon.smart_beacon.active = v["smart_beacon"]["active"] | false;
|
beacon.smart_beacon.active = v["smart_beacon"]["active"] | false;
|
||||||
beacon.smart_beacon.turn_min = v["smart_beacon"]["turn_min"] | 25;
|
beacon.smart_beacon.turn_min = v["smart_beacon"]["turn_min"] | 25;
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
int min_bcn;
|
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;
|
String callsign;
|
||||||
|
@ -34,6 +34,7 @@ public:
|
||||||
int timeout;
|
int timeout;
|
||||||
String symbol;
|
String symbol;
|
||||||
String overlay;
|
String overlay;
|
||||||
|
String type;
|
||||||
Smart_Beacon smart_beacon;
|
Smart_Beacon smart_beacon;
|
||||||
bool enhance_precision;
|
bool enhance_precision;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue