Skip to content

Commit

Permalink
Merge pull request #776 from darksidelemm/testing
Browse files Browse the repository at this point in the history
Landing notification tweaks, allow localhost APRS
  • Loading branch information
darksidelemm authored May 28, 2023
2 parents e7cce32 + a3aae7a commit 0b6e74f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auto_rx/autorx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
# PATCH - Small changes, or minor feature additions.

__version__ = "1.6.2-beta2"
__version__ = "1.6.2-beta3"


# Global Variables
Expand Down
2 changes: 1 addition & 1 deletion auto_rx/autorx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def read_auto_rx_config(filename, no_sdr_test=False):
# that this goes against the wishes of the radiosonde_auto_rx developers to not be part
# of the bigger problem of APRS-IS congestion.

ALLOWED_APRS_SERVERS = ["radiosondy.info"]
ALLOWED_APRS_SERVERS = ["radiosondy.info", "localhost"]
ALLOWED_APRS_PORTS = [14590]

if auto_rx_config["aprs_server"] not in ALLOWED_APRS_SERVERS:
Expand Down
12 changes: 10 additions & 2 deletions auto_rx/autorx/email_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def process_telemetry(self, telemetry):
self.sondes[_id] = {
"last_time": time.time(),
"descending_trip": 0,
"ascent_trip": False,
"descent_notified": False,
"track": GenericTrack(max_elements=20),
}
Expand Down Expand Up @@ -224,14 +225,21 @@ def process_telemetry(self, telemetry):
# We have seen this sonde recently. Let's check it's descending...

if self.sondes[_id]["descent_notified"] == False and _sonde_state:

# Set a flag if the sonde has passed above the landing altitude threshold.
# This is used along with the descending trip to trigger a landing email notification.
if (telemetry["alt"] > self.landing_altitude_threshold):
self.sondes[_id]["ascent_trip"] = True

# If the sonde is below our threshold altitude, *and* is descending at a reasonable rate, increment.
if (telemetry["alt"] < self.landing_altitude_threshold) and (
_sonde_state["ascent_rate"] < -2.0
):
self.sondes[_id]["descending_trip"] += 1

if self.sondes[_id]["descending_trip"] > self.landing_descent_trip:
# We've seen this sonde descending for enough time now.
if (self.sondes[_id]["descending_trip"] > self.landing_descent_trip) and self.sondes[_id]["ascent_trip"]:
# We've seen this sonde descending for enough time now AND we have also seen it go above the landing threshold,
# so it's likely been on a flight and isnt just bouncing around on the ground.
# Note that we've passed the descent threshold, so we shouldn't analyze anything from this sonde anymore.
self.sondes[_id]["descent_notified"] = True

Expand Down

0 comments on commit 0b6e74f

Please sign in to comment.