From ab406c9e44a0f3ac51626e4bf6f0bc6030fc6287 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Wed, 10 Jul 2024 23:44:13 +0000 Subject: [PATCH 1/6] Add write_samples and description control from waterfall UI. --- docker/Dockerfile.base | 2 +- gamutrf/grscan.py | 1 + .../gamutrfwaterfall/flask_handler.py | 2 +- .../gamutrfwaterfall/templates/waterfall.html | 56 ++++++++++--------- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 4467c021..83f206cc 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ pybind11-dev \ python3-numpy WORKDIR /root -RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.110 +RUN git clone https://github.com/iqtlabs/gr-iqtlabs -b 1.0.111 COPY --from=iqtlabs/gamutrf-vkfft:latest /root /root/gr-iqtlabs WORKDIR /root/gr-iqtlabs/build COPY --from=iqtlabs/gamutrf-sigmf:latest /usr/local /usr/local diff --git a/gamutrf/grscan.py b/gamutrf/grscan.py index 688b7727..34d201c5 100644 --- a/gamutrf/grscan.py +++ b/gamutrf/grscan.py @@ -222,6 +222,7 @@ def __init__( sigmf, zstd=True, rotate=False, + description=description, ), ] ) diff --git a/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py b/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py index 82cba235..603fa21c 100644 --- a/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py +++ b/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py @@ -222,7 +222,7 @@ def config_form(self): reset = request.form.get("reset", None) if reset == "reset": reconf_query_str = "&".join( - [f"{k}={v}" for k, v in self.config_vars.items()] + [f"{k}=\"{v}\"" for k, v in self.config_vars.items()] ) logging.info(f"\n\n{reconf_query_str=}\n\n") try: diff --git a/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html b/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html index 2055db3c..1018d506 100644 --- a/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html +++ b/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html @@ -1,39 +1,43 @@ {% extends "base.html" %} {% block body %}
- -
-
-

Freq start:

-

-

Freq end:

-

-

Gain:

-

-

Tune overlap:

-

-

Tune step (# of FFTs):

-

-

Sweep seconds:

-

+ +
+ +

Freq start:

+

+

Freq end:

+

+

Gain:

+

+

Tune overlap:

+

+

Tune step (# of FFTs):

+

+

Sweep seconds:

+

+

Write samples:

+

+

SigMF description:

+

-

- -
+

+ +
{% endblock body %} {% block script %} {% endblock script %} From 9d919ac48f7eb4a972d14b285482035e7a076bff Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 11 Jul 2024 00:04:38 +0000 Subject: [PATCH 2/6] black. --- gamutrfwaterfall/gamutrfwaterfall/flask_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py b/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py index 603fa21c..17811ea7 100644 --- a/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py +++ b/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py @@ -222,7 +222,7 @@ def config_form(self): reset = request.form.get("reset", None) if reset == "reset": reconf_query_str = "&".join( - [f"{k}=\"{v}\"" for k, v in self.config_vars.items()] + [f'{k}="{v}"' for k, v in self.config_vars.items()] ) logging.info(f"\n\n{reconf_query_str=}\n\n") try: From 0bcb935aca78c8cba68cb9fc987673169494d4c2 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 11 Jul 2024 00:52:01 +0000 Subject: [PATCH 3/6] string. --- .../gamutrfwaterfall/templates/waterfall.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html b/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html index 1018d506..ee2b02d8 100644 --- a/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html +++ b/gamutrfwaterfall/gamutrfwaterfall/templates/waterfall.html @@ -16,10 +16,10 @@

Sweep seconds:

-

Write samples:

-

-

SigMF description:

-

+

Write samples:

+

+

SigMF description:

+

From b54338af3df8ad1408b49449c981b8eee0440a1d Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 11 Jul 2024 00:59:33 +0000 Subject: [PATCH 4/6] quoting. --- gamutrfwaterfall/gamutrfwaterfall/flask_handler.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py b/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py index 17811ea7..bf01744e 100644 --- a/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py +++ b/gamutrfwaterfall/gamutrfwaterfall/flask_handler.py @@ -221,9 +221,13 @@ def config_form(self): write_scanner_args(self.config_vars_path, self.config_vars) reset = request.form.get("reset", None) if reset == "reset": - reconf_query_str = "&".join( - [f'{k}="{v}"' for k, v in self.config_vars.items()] - ) + reconf_queries = [] + for k, v in self.config_vars.items(): + if k in ["description"]: + reconf_queries.append(f'{k}="{v}"') + else: + reconf_queries.append(f"{k}={v}") + reconf_query_str = "&".join(reconf_queries) logging.info(f"\n\n{reconf_query_str=}\n\n") try: response = requests.get( From ef23e56b310702198275be3171696e303bf73cf9 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 11 Jul 2024 01:21:23 +0000 Subject: [PATCH 5/6] strip. --- gamutrf/grscan.py | 2 ++ gamutrfwaterfall/gamutrfwaterfall/waterfall.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/gamutrf/grscan.py b/gamutrf/grscan.py index 34d201c5..3794f3d7 100644 --- a/gamutrf/grscan.py +++ b/gamutrf/grscan.py @@ -101,6 +101,8 @@ def __init__( ): gr.top_block.__init__(self, "scan", catch_exceptions=True) + if description: + description = description.strip('"') tune_step_hz = int(samp_rate * tuneoverlap) stare = False diff --git a/gamutrfwaterfall/gamutrfwaterfall/waterfall.py b/gamutrfwaterfall/gamutrfwaterfall/waterfall.py index f5491b62..693a77e8 100644 --- a/gamutrfwaterfall/gamutrfwaterfall/waterfall.py +++ b/gamutrfwaterfall/gamutrfwaterfall/waterfall.py @@ -31,6 +31,8 @@ "tuneoverlap": None, "tune_step_fft": None, "sweep_sec": None, + "write_samples": 0, + "description": "", } From 0f2b39eebdc0e7ecde6dd396f0e48fd85c68efb1 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 11 Jul 2024 01:28:27 +0000 Subject: [PATCH 6/6] sample_dir --- orchestrator.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchestrator.yml b/orchestrator.yml index 99c8ec3f..da336506 100644 --- a/orchestrator.yml +++ b/orchestrator.yml @@ -108,7 +108,7 @@ services: - --iq_inference_model_server=torchserve:8080 - --iq_inference_model_name=torchsig_model # - --write_samples=1000000000 - # - --sample_dir=/logs/samples + - --sample_dir=/logs/samples healthcheck: test: [CMD, "/gamutrf/bin/scanhc.sh", "9000"] interval: 10s