Skip to content

Commit

Permalink
Merge pull request #935 from argilo/startup-timeout
Browse files Browse the repository at this point in the history
Increase network timeout to 60 seconds on startup
  • Loading branch information
darksidelemm authored Nov 9, 2024
2 parents 6bd31a4 + 92a26d5 commit 1e2c89f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion auto_rx/autorx/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ def read_auto_rx_config(filename, no_sdr_test=False):
_sdr_ok = test_sdr(
sdr_type=auto_rx_config["sdr_type"],
sdr_hostname=auto_rx_config["sdr_hostname"],
sdr_port=auto_rx_config["sdr_port"]
sdr_port=auto_rx_config["sdr_port"],
timeout=60
)

if not _sdr_ok:
Expand Down
9 changes: 5 additions & 4 deletions auto_rx/autorx/sdr_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def test_sdr(
sdr_port = 5555,
ss_iq_path = "./ss_iq",
ss_power_path = "./ss_power",
check_freq = 401500000
check_freq = 401500000,
timeout = 5
):
"""
Test the prescence / functionality of a SDR.
Expand Down Expand Up @@ -71,7 +72,7 @@ def test_sdr(
# Try and configure a channel at check_freq Hz
# tune --samprate 48000 --frequency 404m09 --mode iq --ssrc 404090000 --radio sonde.local
_cmd = (
f"{timeout_cmd()} 5 " # Add a timeout, because connections to non-existing servers block for ages
f"{timeout_cmd()} {timeout} " # Add a timeout, because connections to non-existing servers block for ages
f"tune "
f"--samprate 48000 --mode iq "
f"--frequency {int(check_freq)} "
Expand Down Expand Up @@ -108,7 +109,7 @@ def test_sdr(

# Now close the channel we just opened by setting the frequency to 0 Hz.
_cmd = (
f"{timeout_cmd()} 5 " # Add a timeout, because connections to non-existing servers block for ages
f"{timeout_cmd()} {timeout} " # Add a timeout, because connections to non-existing servers block for ages
f"tune "
f"--samprate 48000 --mode iq "
f"--frequency 0 "
Expand Down Expand Up @@ -142,7 +143,7 @@ def test_sdr(
return False

_cmd = (
f"{timeout_cmd()} 10 " # Add a timeout, because connections to non-existing IPs seem to block.
f"{timeout_cmd()} {timeout} " # Add a timeout, because connections to non-existing IPs seem to block.
f"{ss_iq_path} "
f"-f {check_freq} "
f"-s 48000 "
Expand Down

0 comments on commit 1e2c89f

Please sign in to comment.