Skip to content

Commit 1e2c89f

Browse files
authored
Merge pull request #935 from argilo/startup-timeout
Increase network timeout to 60 seconds on startup
2 parents 6bd31a4 + 92a26d5 commit 1e2c89f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

auto_rx/autorx/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ def read_auto_rx_config(filename, no_sdr_test=False):
854854
_sdr_ok = test_sdr(
855855
sdr_type=auto_rx_config["sdr_type"],
856856
sdr_hostname=auto_rx_config["sdr_hostname"],
857-
sdr_port=auto_rx_config["sdr_port"]
857+
sdr_port=auto_rx_config["sdr_port"],
858+
timeout=60
858859
)
859860

860861
if not _sdr_ok:

auto_rx/autorx/sdr_wrappers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def test_sdr(
2323
sdr_port = 5555,
2424
ss_iq_path = "./ss_iq",
2525
ss_power_path = "./ss_power",
26-
check_freq = 401500000
26+
check_freq = 401500000,
27+
timeout = 5
2728
):
2829
"""
2930
Test the prescence / functionality of a SDR.
@@ -71,7 +72,7 @@ def test_sdr(
7172
# Try and configure a channel at check_freq Hz
7273
# tune --samprate 48000 --frequency 404m09 --mode iq --ssrc 404090000 --radio sonde.local
7374
_cmd = (
74-
f"{timeout_cmd()} 5 " # Add a timeout, because connections to non-existing servers block for ages
75+
f"{timeout_cmd()} {timeout} " # Add a timeout, because connections to non-existing servers block for ages
7576
f"tune "
7677
f"--samprate 48000 --mode iq "
7778
f"--frequency {int(check_freq)} "
@@ -108,7 +109,7 @@ def test_sdr(
108109

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

144145
_cmd = (
145-
f"{timeout_cmd()} 10 " # Add a timeout, because connections to non-existing IPs seem to block.
146+
f"{timeout_cmd()} {timeout} " # Add a timeout, because connections to non-existing IPs seem to block.
146147
f"{ss_iq_path} "
147148
f"-f {check_freq} "
148149
f"-s 48000 "

0 commit comments

Comments
 (0)