Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Landing notification tweaks, allow localhost APRS #776

Merged
merged 1 commit into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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