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

Testing 20240616 #21

Merged
merged 163 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
1308f34
Merge pull request #748 from projecthorus/testing
darksidelemm Feb 4, 2023
cbaa4b7
Rebase M20 decoder
Mar 24, 2023
16240e6
Merge pull request #762 from darksidelemm/testing
darksidelemm Mar 24, 2023
050617b
Update version prior to merge into master
Apr 1, 2023
6ff21e2
Merge remote-tracking branch 'upstream/testing' into testing
Apr 1, 2023
353193b
Merge pull request #763 from darksidelemm/testing
darksidelemm Apr 1, 2023
3e0d8ef
Merge pull request #764 from projecthorus/testing
darksidelemm Apr 1, 2023
6b2ce1d
Rebase M20 demod
May 18, 2023
139378b
Add email notification on detection of an encrypted radisonde
May 18, 2023
ba86f90
Merge pull request #774 from darksidelemm/testing
darksidelemm May 18, 2023
6e09810
Add simple-websocket to requirements
May 23, 2023
e7cce32
Merge pull request #775 from darksidelemm/testing
darksidelemm May 23, 2023
a3aae7a
Only send landing notifications if sonde has gone above the landing a…
May 28, 2023
0b6e74f
Merge pull request #776 from darksidelemm/testing
darksidelemm May 28, 2023
38f4141
Add comment about DFM upload rates
Jun 14, 2023
1a6dbc0
Exit scan loop faster. Add wettersonde.net to APRS allowed list
Jun 24, 2023
e55e808
Merge pull request #781 from darksidelemm/testing
darksidelemm Jun 24, 2023
40926ab
raise exception on config file problems instead of returning quietly
mastmees Jul 3, 2023
16acef5
added timeouts for joining threads so that the system will not
mastmees Jul 3, 2023
f028836
added timeout for joining gps thread
mastmees Jul 3, 2023
55f9924
added timeouts for joining theards to ensure that the system
mastmees Jul 3, 2023
1dd780b
added join timeout for ozimux input thread
mastmees Jul 3, 2023
cb8921c
added join timeout for rotator thread
mastmees Jul 3, 2023
c105244
added function to figure out which timeout command to use
mastmees Jul 3, 2023
815ef49
switched to using system-appropriate timeout command
mastmees Jul 3, 2023
942c992
switched to using system-appropriate timeout command
mastmees Jul 3, 2023
0464b26
added function for checking if flask has been started
mastmees Jul 3, 2023
b7d6932
added timout for email notification thread joinging
mastmees Jul 3, 2023
bce4b99
script to power cycle connected RTL-SDR devices
mastmees Jul 3, 2023
b16b5db
running auto_rx.py in a loop, handling exit codes
mastmees Jul 3, 2023
29699c0
clean shutdown with consistent exit status codes
mastmees Jul 3, 2023
9bec705
do not swallow exception thrown during scanning
mastmees Jul 4, 2023
75fd53b
schematics for SDR power cycling hardware
mastmees Jul 4, 2023
7064b6b
Merge remote-tracking branch 'mastmees/master' into mastmees-pr
Jul 15, 2023
e0764d7
Reset auto_rx.sh
Jul 15, 2023
2e9eea5
Bump beta version
Jul 15, 2023
f881995
Merge remote-tracking branch 'upstream/testing' into testing
Jul 15, 2023
b740de6
Merge pull request #785 from darksidelemm/testing
darksidelemm Jul 15, 2023
3b35974
Change SDR task list on web interface to block sections. Add on SDR t…
Jul 16, 2023
72c98ed
Merge pull request #786 from darksidelemm/testing
darksidelemm Jul 16, 2023
f2d211e
Add iq_dec to .gitignore
argilo Jul 19, 2023
b672eae
Fix reverse proxy path handling
drid Jul 24, 2023
f641be9
Fix more absolute paths
drid Jul 25, 2023
3a77bf0
Fix namespace
drid Jul 26, 2023
0079166
Merge in drid/proxy-fix changes
Jul 29, 2023
6bc510f
Merge pull request #790 from darksidelemm/testing
darksidelemm Jul 29, 2023
9bff0ee
Merge pull request #787 from argilo/update-gitignore
darksidelemm Jul 29, 2023
0eed213
Use fixed-point notation for ascent rate
argilo Aug 1, 2023
362cad9
Merge pull request #791 from argilo/fix-ascent-rate-kml
darksidelemm Aug 1, 2023
fb72588
Update version prior to merge
Aug 4, 2023
0296175
Merge pull request #792 from darksidelemm/testing
darksidelemm Aug 4, 2023
79815c8
Move detection and decode iq/audio recordings to the log directory
Aug 6, 2023
e627edf
Merge pull request #796 from darksidelemm/testing
darksidelemm Aug 6, 2023
b688084
Working towards WXR301D support. Also added Wideband option
Aug 14, 2023
bcf6b32
Fix rotator azimuth difference calculation
Aug 15, 2023
0ff2553
Add --imet1 option to imet decoder when in wideband mode
Aug 15, 2023
4805348
Detect missing rtl_sdr utils and print error message
Aug 21, 2023
2134bab
More vebose logging when attempting to reset rtlsdrs
Aug 31, 2023
658dec2
Hopefully fix issues with werkzeug not allowing auto_rx to exit. Hand…
Sep 2, 2023
fbe4cbe
Merge remote-tracking branch 'upstream/testing' into testing
Sep 2, 2023
6efc17e
Merge pull request #804 from darksidelemm/testing
darksidelemm Sep 2, 2023
243a89b
Further updates to make WxR-301D decoding work.
Sep 13, 2023
0877ecc
Merge pull request #806 from darksidelemm/testing
darksidelemm Sep 13, 2023
29e7049
Tweak tests so landing notifications work
Sep 15, 2023
0e51550
Remove print statement
Sep 15, 2023
1a78596
Merge pull request #808 from darksidelemm/testing
darksidelemm Sep 15, 2023
5d00c85
Enable mask estimator for WxR301D decoder. EXPERIMENTAL, may cause ot…
Sep 17, 2023
a77039f
Merge pull request #810 from darksidelemm/testing
darksidelemm Sep 17, 2023
4efee74
Rebase WxR301D decoder for additional SN verification
Sep 19, 2023
d2c3778
Merge pull request #811 from darksidelemm/testing
darksidelemm Sep 19, 2023
6d24b2d
Fix to skewt decimation error.
Sep 24, 2023
24911c0
Merge pull request #814 from darksidelemm/testing
darksidelemm Sep 24, 2023
4fa095a
Bump version prior to final merge.
Sep 30, 2023
5550bf6
Merge pull request #817 from darksidelemm/testing
darksidelemm Sep 30, 2023
4e8176b
Handle IMET1RS as IMET-4, pass rs41_mainboard into to sondehub
Oct 1, 2023
b922246
Merge pull request #818 from darksidelemm/testing
darksidelemm Oct 1, 2023
8d14750
Fixes for iMet+XDATA. Don't add -Ozone onto the end of types anymore.
Oct 2, 2023
d2000ab
Merge pull request #819 from darksidelemm/testing
darksidelemm Oct 2, 2023
5fa3605
Add -XDATA onto type when logging imet sondes
Oct 2, 2023
dc32da4
Merge pull request #821 from darksidelemm/testing
darksidelemm Oct 2, 2023
3ca10ea
Show mainboard type on web interface if not RSM412, upload RS41 subfr…
Oct 3, 2023
58feaeb
rebase rs41mod, change field name for subframe data
Oct 3, 2023
97660fb
Merge pull request #823 from darksidelemm/testing
darksidelemm Oct 4, 2023
58641df
Version number change prior to merge
Oct 7, 2023
f93229a
Merge pull request #825 from darksidelemm/testing
darksidelemm Oct 7, 2023
6708540
Very preliminary RS41 subframe data extraction utility
Oct 8, 2023
acb24b2
Handle no subframe data available
Oct 8, 2023
65138b0
Update systemd file to use a python venv
Oct 27, 2023
30b1e18
Merge pull request #829 from darksidelemm/testing
darksidelemm Oct 27, 2023
a96c60d
Restart always_on decoders after 6 hours of no packets. Give addition…
Nov 2, 2023
45a9a86
Merge pull request #833 from darksidelemm/testing
darksidelemm Nov 2, 2023
24b6835
Some intial tests of KA9Q-Radio support (no spectrum yet)
Nov 9, 2023
1d90d0c
bump testing version
Nov 9, 2023
2807232
Add Temp Block button on web controls
Dec 31, 2023
c65d7fc
Merge remote-tracking branch 'upstream/testing' into testing
Dec 31, 2023
9dcb784
Merge pull request #842 from darksidelemm/testing
darksidelemm Dec 31, 2023
5878ad4
Update meisei demod to handle 2024 year
Jan 5, 2024
78e1a55
Merge pull request #846 from darksidelemm/testing
darksidelemm Jan 5, 2024
5a2925d
Bump testing version
Jan 6, 2024
0020333
Merge pull request #848 from darksidelemm/testing
darksidelemm Jan 6, 2024
6c887ce
Fix imperial units on historical page
Jan 24, 2024
e20e7c1
Merge remote-tracking branch 'upstream/testing' into testing
Jan 24, 2024
3bc46f9
Merge pull request #852 from darksidelemm/testing
darksidelemm Jan 24, 2024
0e6af12
Some fixes to statistics generation
Jan 25, 2024
d59081a
Merge pull request #854 from darksidelemm/testing
darksidelemm Jan 25, 2024
96228c4
Write rtl_power log output to user-defined log directory
Jan 27, 2024
49d213e
Add spaces
Jan 27, 2024
1dfb06a
Merge pull request #856 from darksidelemm/testing
darksidelemm Jan 27, 2024
7226c31
Combine export_selected and export_all
argilo Jan 28, 2024
ecc092b
Merge pull request #857 from argilo/refactor-export-all
darksidelemm Jan 28, 2024
52135db
Fix code style
argilo Jan 28, 2024
54ba77e
Remove unused imports
argilo Jan 28, 2024
7d739ab
Replace fastkml & shapely with ElementTree
argilo Jan 29, 2024
6446070
Add "Generate KML" button to the "Historical" page
argilo Jan 29, 2024
2413762
Remove unused code
argilo Jan 30, 2024
65b1da7
Use autorx.log_files to read logs
argilo Jan 30, 2024
e227eea
Move KML generation into autorx.log_files
argilo Jan 30, 2024
209a78a
Replace print statements with logging
argilo Jan 30, 2024
0ea4558
Merge pull request #858 from argilo/web-generate-kml
darksidelemm Jan 30, 2024
58a183d
Generate live KML using ElementTree
argilo Jan 31, 2024
5e2c50c
Show recent sondes at the top of the list
argilo Jan 31, 2024
765947c
Remove unused Habitat code
argilo Jan 31, 2024
468712e
Merge pull request #859 from argilo/web-live-kml-refactor
darksidelemm Jan 31, 2024
8e20b72
Merge pull request #860 from argilo/remove-habitat
darksidelemm Jan 31, 2024
6cf4962
Add sample count to fsk demod stats output, bump testing beta count
Jan 31, 2024
dc367ca
Merge pull request #861 from darksidelemm/testing
darksidelemm Jan 31, 2024
2323ac5
Log the shutdown timeout if set
argilo Jan 31, 2024
a810948
Merge pull request #862 from argilo/log-timeout
darksidelemm Jan 31, 2024
ee54d30
Remove rm log_power line from autorx.sh
Feb 1, 2024
da27f99
Merge pull request #863 from darksidelemm/testing
darksidelemm Feb 1, 2024
74e362b
Rebase m20mod.c
Feb 11, 2024
3a04130
Merge pull request #864 from darksidelemm/testing
darksidelemm Feb 11, 2024
ab398f9
Replace deprecated utcnow() with now()
argilo Mar 27, 2024
51745e7
Merge pull request #867 from argilo/replace-utcnow
darksidelemm Mar 28, 2024
f2201b2
Bump beta version
Mar 29, 2024
a72bcfe
Restore the previous time format in Scan Results
argilo Mar 29, 2024
d784d83
Merge pull request #868 from argilo/time-format
darksidelemm Mar 29, 2024
a9fbe71
Don't update scan chart data until there's actual data
argilo Mar 29, 2024
2e04da0
Merge pull request #869 from argilo/scan-chart-threshold-fix
darksidelemm Mar 29, 2024
3fdea49
Rebase dfm demodulator for better DFM17 handling
May 18, 2024
53dcca3
Merge pull request #875 from darksidelemm/testing
darksidelemm May 18, 2024
111f03f
Rebase both DFM and MP3H1 demods
May 20, 2024
b5e132c
Merge pull request #876 from darksidelemm/testing
darksidelemm May 20, 2024
40b8cfa
auto_rx/build.sh: exit immediatelly on error
pinkavaj May 24, 2024
60f8474
Merge pull request #877 from pinkavaj/pi-ee
darksidelemm May 24, 2024
5809521
delete lms6mod - replaced by lms6Xmod
pinkavaj May 25, 2024
6834391
Merge pull request #879 from pinkavaj/pi-rm
darksidelemm May 25, 2024
bbb4322
Add support for WxR-301 PN9 variant
May 31, 2024
63b2257
Merge pull request #882 from darksidelemm/testing
darksidelemm May 31, 2024
9021501
Fix WXR301-PN9 baud rate
May 31, 2024
dd8a658
Merge pull request #883 from darksidelemm/testing
darksidelemm May 31, 2024
9cdc2cd
Change PN9 variant sonde type name to WxR-301D-5k so it fits on the t…
Jun 2, 2024
228910e
Merge pull request #885 from darksidelemm/testing
darksidelemm Jun 2, 2024
1b7b639
Narrow WXRPN9 mask estimator back to 50 khz
Jun 3, 2024
559b33d
Merge pull request #886 from darksidelemm/testing
darksidelemm Jun 3, 2024
967741d
Rebase dft_detect, bump beta version
Jun 6, 2024
3d9a115
Merge pull request #887 from darksidelemm/testing
darksidelemm Jun 6, 2024
bc2585c
Fix KA9Q support to work with latest commit (2024-06-11)
Jun 15, 2024
6c2a174
Make the test SSRC used for ka9q-radio testing more unique
Jun 16, 2024
07950ae
Merge pull request #890 from darksidelemm/testing
darksidelemm Jun 16, 2024
224eb6a
Prepare for 1.7.3 release
Jun 16, 2024
f42bf24
Merge pull request #891 from darksidelemm/testing
darksidelemm Jun 16, 2024
5fe81b1
Merge branch 'testing-AstroTaka1' into testing-20240616
AstroTaka Jun 16, 2024
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
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ auto_rx/dfm09mod
auto_rx/dft_detect
auto_rx/fsk_demod
auto_rx/imet1rs_dft
auto_rx/iq_dec
auto_rx/lms6Xmod
auto_rx/lms6mod
auto_rx/m10mod
auto_rx/m20mod
auto_rx/mk2a1680mod
Expand All @@ -52,14 +52,14 @@ auto_rx/imet54mod
auto_rx/mXXmod
auto_rx/mp3h1mod
auto_rx/mts01mod
auto_rx/weathex301d

m10
meisei100mod
mk2a_lms1680
demod/dfm09ecc
demod/mod/dfm09mod
demod/mod/lms6Xmod
demod/mod/lms6mod
demod/mod/meisei100mod
demod/mod/rs41mod
demod/mod/rs92mod
Expand All @@ -81,3 +81,4 @@ rs_module/rs41mod
rs_module/rs92mod
scan/reset_usb
scan/rs_detect
weathex/weathex301d
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SUBDIRS := \
mk2a \
scan \
utils \
weathex \

all: $(SUBDIRS)

Expand Down
87 changes: 48 additions & 39 deletions auto_rx/auto_rx.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
# Refer github page for instructions on setup and usage.
# https://github.com/projecthorus/radiosonde_auto_rx/
#

# exit status codes:
#
# 0 - normal termination (ctrl-c)
# 1 - critical error, needs human attention to fix
# 2 - exit because continous running timeout reached
# 3 - exception occurred, can rerun after resetting SDR
# 4 - some of the threads failed to join, SDR reset and restart required
# this is mostly caused by hung external utilities

import argparse
import datetime
import logging
Expand All @@ -28,7 +38,6 @@
from autorx.decode import SondeDecoder, VALID_SONDE_TYPES, DRIFTY_SONDE_TYPES
from autorx.logger import TelemetryLogger
from autorx.email_notification import EmailNotification
from autorx.habitat import HabitatUploader
from autorx.aprs import APRSUploader
from autorx.ozimux import OziUploader
from autorx.sondehub import SondehubUploader
Expand All @@ -44,6 +53,7 @@
start_flask,
stop_flask,
flask_emit_event,
flask_running,
WebHandler,
WebExporter,
)
Expand Down Expand Up @@ -170,6 +180,7 @@ def start_scanner():
ppm=autorx.sdr_list[_device_idx]["ppm"],
bias=autorx.sdr_list[_device_idx]["bias"],
save_detection_audio=config["save_detection_audio"],
wideband_sondes=config["wideband_sondes"],
temporary_block_list=temporary_block_list,
temporary_block_time=config["temporary_block_time"],
)
Expand Down Expand Up @@ -232,7 +243,7 @@ def start_decoder(freq, sonde_type, continuous=False):
_exp_sonde_type = sonde_type

if continuous:
_timeout = 0
_timeout = 3600*6 # 6 hours before a 'continuous' decoder gets restarted automatically.
else:
_timeout = config["rx_timeout"]

Expand Down Expand Up @@ -261,7 +272,8 @@ def start_decoder(freq, sonde_type, continuous=False):
rs92_ephemeris=rs92_ephemeris,
rs41_drift_tweak=config["rs41_drift_tweak"],
experimental_decoder=config["experimental_decoders"][_exp_sonde_type],
save_raw_hex=config["save_raw_hex"]
save_raw_hex=config["save_raw_hex"],
wideband_sondes=config["wideband_sondes"]
)
autorx.sdr_list[_device_idx]["task"] = autorx.task_list[freq]["task"]

Expand Down Expand Up @@ -322,7 +334,7 @@ def handle_scan_results():
if (type(_key) == int) or (type(_key) == float):
# Extract the currently decoded sonde type from the currently running decoder.
_decoding_sonde_type = autorx.task_list[_key]["task"].sonde_type

# Remove any inverted decoder information for the comparison.
if _decoding_sonde_type.startswith("-"):
_decoding_sonde_type = _decoding_sonde_type[1:]
Expand Down Expand Up @@ -432,7 +444,8 @@ def clean_task_list():

else:
# Shutdown the SDR, if required for the particular SDR type.
shutdown_sdr(config["sdr_type"], _task_sdr)
if _key != 'SCAN':
shutdown_sdr(config["sdr_type"], _task_sdr, sdr_hostname=config["sdr_hostname"], frequency=_key)
# Release its associated SDR.
autorx.sdr_list[_task_sdr]["in_use"] = False
autorx.sdr_list[_task_sdr]["task"] = None
Expand Down Expand Up @@ -492,6 +505,12 @@ def stop_all():
for _task in autorx.task_list.keys():
try:
autorx.task_list[_task]["task"].stop()

# Release the SDR channel if necessary
_task_sdr = autorx.task_list[_task]["device_idx"]
if _task != 'SCAN':
shutdown_sdr(config["sdr_type"], _task_sdr, sdr_hostname=config["sdr_hostname"], frequency=_task)

except Exception as e:
logging.error("Error stopping task - %s" % str(e))

Expand Down Expand Up @@ -640,6 +659,7 @@ def telemetry_filter(telemetry):
or ("LMS" in telemetry["type"])
or ("IMET" in telemetry["type"])
or ("MTS01" in telemetry["type"])
or ("WXR" in telemetry["type"])
):
return "OK"
else:
Expand Down Expand Up @@ -745,9 +765,6 @@ def main():
)
args = parser.parse_args()

# Copy out timeout value, and convert to seconds,
_timeout = args.timeout * 60

# Copy out RS92 ephemeris value, if provided.
if args.ephemeris != "None":
rs92_ephemeris = args.ephemeris
Expand All @@ -770,7 +787,7 @@ def main():
autorx.logging_path = logging_path

# Configure logging
_log_suffix = datetime.datetime.utcnow().strftime("%Y%m%d-%H%M%S_system.log")
_log_suffix = datetime.datetime.now(datetime.timezone.utc).strftime("%Y%m%d-%H%M%S_system.log")
_log_path = os.path.join(logging_path, _log_suffix)

system_log_enabled = False
Expand Down Expand Up @@ -806,6 +823,16 @@ def main():
logging.getLogger("engineio").setLevel(logging.ERROR)
logging.getLogger("geventwebsocket").setLevel(logging.ERROR)

# Copy out timeout value, and convert to seconds.
if args.timeout > 0:
logging.info(f"Will shut down automatically after {args.timeout} minutes.")
_timeout = args.timeout * 60

# Check all the RS utilities exist.
logging.debug("Checking if required binaries exist")
if not check_rs_utils(config):
sys.exit(1)

# Attempt to read in config file
logging.info("Reading configuration file...")
_temp_cfg = read_auto_rx_config(args.config)
Expand All @@ -816,6 +843,7 @@ def main():
config = _temp_cfg
autorx.sdr_list = config["sdr_settings"]


# Apply any logging changes based on configuration file settings.
if config["save_system_log"]:
# Enable system logging.
Expand Down Expand Up @@ -844,9 +872,6 @@ def main():
web_handler = WebHandler()
logging.getLogger().addHandler(web_handler)

# Check all the RS utilities exist.
if not check_rs_utils():
sys.exit(1)

# If a sonde type has been provided, insert an entry into the scan results,
# and immediately start a decoder. This also sets the decoder time to 0, which
Expand Down Expand Up @@ -874,7 +899,10 @@ def main():
# Start our exporter options
# Telemetry Logger
if config["per_sonde_log"]:
_logger = TelemetryLogger(log_directory=logging_path)
_logger = TelemetryLogger(
log_directory=logging_path,
save_cal_data=config["save_cal_data"]
)
exporter_objects.append(_logger)
exporter_functions.append(_logger.add)

Expand All @@ -897,6 +925,7 @@ def main():
),
launch_notifications=config["email_launch_notifications"],
landing_notifications=config["email_landing_notifications"],
encrypted_sonde_notifications=config["email_encrypted_sonde_notifications"],
landing_range_threshold=config["email_landing_range_threshold"],
landing_altitude_threshold=config["email_landing_altitude_threshold"],
)
Expand All @@ -905,30 +934,6 @@ def main():
exporter_objects.append(_email_notification)
exporter_functions.append(_email_notification.add)

# Habitat Uploader - DEPRECATED - Sondehub DB now in use (>1.5.0)
# if config["habitat_enabled"]:

# if config["habitat_upload_listener_position"] is False:
# _habitat_station_position = None
# else:
# _habitat_station_position = (
# config["station_lat"],
# config["station_lon"],
# config["station_alt"],
# )

# _habitat = HabitatUploader(
# user_callsign=config["habitat_uploader_callsign"],
# user_antenna=config["habitat_uploader_antenna"],
# station_position=_habitat_station_position,
# synchronous_upload_time=config["habitat_upload_rate"],
# callsign_validity_threshold=config["payload_id_valid"],
# url=config["habitat_url"],
# )

# exporter_objects.append(_habitat)
# exporter_functions.append(_habitat.add)

# APRS Uploader
if config["aprs_enabled"]:

Expand Down Expand Up @@ -1073,7 +1078,7 @@ def main():
logging.info("Shutdown time reached. Closing.")
stop_flask(host=config["web_host"], port=config["web_port"])
stop_all()
break
sys.exit(2)


if __name__ == "__main__":
Expand All @@ -1084,9 +1089,13 @@ def main():
# Upon CTRL+C, shutdown all threads and exit.
stop_flask(host=config["web_host"], port=config["web_port"])
stop_all()
sys.exit(0)
except Exception as e:
# Upon exceptions, attempt to shutdown threads and exit.
traceback.print_exc()
print("Main Loop Error - %s" % str(e))
stop_flask(host=config["web_host"], port=config["web_port"])
if flask_running():
stop_flask(host=config["web_host"], port=config["web_port"])
stop_all()
sys.exit(3)

6 changes: 5 additions & 1 deletion auto_rx/auto_rx.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ Description=auto_rx
After=syslog.target

[Service]
ExecStart=/usr/bin/python3 /home/pi/radiosonde_auto_rx/auto_rx/auto_rx.py -t 0
# For running outside of a python virtual environment
# ExecStart=/usr/bin/python3 /home/pi/radiosonde_auto_rx/auto_rx/auto_rx.py -t 0

# For running within a venv, located at /home/pi/radiosonde_auto_rx/auto_rx/venv/
ExecStart=/home/pi/radiosonde_auto_rx/auto_rx/venv/bin/python3 /home/pi/radiosonde_auto_rx/auto_rx/auto_rx.py -t 0
Restart=always
RestartSec=120
WorkingDirectory=/home/pi/radiosonde_auto_rx/auto_rx/
Expand Down
12 changes: 4 additions & 8 deletions auto_rx/auto_rx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@
# NOTE: If running this from crontab, make sure to set the appropriate PATH env-vars,
# else utilities like rtl_power and rtl_fm won't be found.
#
# WARNING - THIS IS DEPRECATED - PLEASE USE THE SYSTEMD SERVICE
# WARNING - THIS IS DEPRECATED - PLEASE USE THE SYSTEMD SERVICE OR DOCKER IMAGE
# See: https://github.com/projecthorus/radiosonde_auto_rx/wiki#451-option-1---operation-as-a-systemd-service-recommended
# Or: https://github.com/projecthorus/radiosonde_auto_rx/wiki/Docker
#

# change into appropriate directory
cd $(dirname $0)

# Clean up old files
rm log_power*.csv

# Start auto_rx process with a 3 hour timeout.
# auto_rx will exit after this time.

python3 auto_rx.py -t 180
python3 auto_rx.py -t 180
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.1-beta2"
__version__ = "1.7.3"


# Global Variables
Expand Down
30 changes: 18 additions & 12 deletions auto_rx/autorx/aprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def generate_station_object(
_datum = "!w%s%s!" % (_lat_prec, _lon_prec)

# Generate timestamp using current UTC time
_aprs_timestamp = datetime.datetime.utcnow().strftime("%H%M%S")
_aprs_timestamp = datetime.datetime.now(datetime.timezone.utc).strftime("%H%M%S")

# Add version string to position comment, if requested.
_aprs_comment = comment
Expand Down Expand Up @@ -759,13 +759,19 @@ def close(self):

# Wait for all threads to close.
if self.upload_thread is not None:
self.upload_thread.join()
self.upload_thread.join(60)
if self.upload_thread.is_alive():
self.log_error("aprs upload thread failed to join")

if self.timer_thread is not None:
self.timer_thread.join()
self.timer_thread.join(60)
if self.timer_thread.is_alive():
self.log_error("aprs timer thread failed to join")

if self.input_thread is not None:
self.input_thread.join()
self.input_thread.join(60)
if self.input_thread.is_alive():
self.log_error("aprs input thread failed to join")

def log_debug(self, line):
""" Helper function to log a debug message with a descriptive heading.
Expand Down Expand Up @@ -801,10 +807,10 @@ def log_warning(self, line):
# ['frame', 'id', 'datetime', 'lat', 'lon', 'alt', 'temp', 'type', 'freq', 'freq_float', 'datetime_dt']
test_telem = [
# These types of DFM serial IDs are deprecated
# {'id':'DFM06-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM09-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM15-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM17-12345678', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.utcnow()},
# {'id':'DFM06-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
# {'id':'DFM09-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
# {'id':'DFM15-123456', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
# {'id':'DFM17-12345678', 'frame':10, 'lat':-10.0, 'lon':10.0, 'alt':10000, 'temp':1.0, 'type':'DFM', 'freq':'401.520 MHz', 'freq_float':401.52, 'heading':0.0, 'vel_h':5.1, 'vel_v':-5.0, 'datetime_dt':datetime.datetime.now(datetime.timezone.utc)},
{
"id": "DFM-19123456",
"frame": 10,
Expand All @@ -821,7 +827,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
{
"id": "DFM-123456",
Expand All @@ -839,7 +845,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
{
"id": "N1234567",
Expand All @@ -857,7 +863,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
{
"id": "M1234567",
Expand All @@ -875,7 +881,7 @@ def log_warning(self, line):
"heading": 0.0,
"vel_h": 5.1,
"vel_v": -5.0,
"datetime_dt": datetime.datetime.utcnow(),
"datetime_dt": datetime.datetime.now(datetime.timezone.utc),
},
]

Expand Down
Loading
Loading