Skip to content

Commit

Permalink
Add GR_SATELLITES_SUBMIT_TLM env variable to control tlm submit
Browse files Browse the repository at this point in the history
This reads the environment variable GR_SATELLITES_SUBMIT_TLM
from the gr-satellites core flowgraph. If the variable exists
and can be converted into an int, its truth value forces/disables
telemetry submission, ignoring the value in the config file.

This is used in the test.sh script to disable telemetry submission
as suggested in #214

(cherry picked from commit 79ab942)
  • Loading branch information
daniestevez committed Mar 21, 2021
1 parent 011d01d commit 66f157a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for TAUSAT-1 and TSURU
- 2k4 downlink for MEZNSAT
- Support for SMOG-1
- Env variable GR_SATELLITES_SUBMIT_TLM to force/disable telemetry submission

### Fixed
- RS basis options swapped in CCSDS Reed-Solomon encoder GRC block
Expand Down
12 changes: 11 additions & 1 deletion python/core/gr_satellites_flowgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import yaml
import argparse
import itertools
import os
import shlex

def set_options(cl, *args, **kwargs):
Expand Down Expand Up @@ -183,8 +184,17 @@ def _init_additional_datasinks(self):
self.options.kiss_server))
if self.options is not None and self.options.zmq_pub:
self._additional_datasinks.append(zeromq.pub_msg_sink(self.options.zmq_pub))
if self.config.getboolean('Groundstation', 'submit_tlm'):

# The GR_SATELLITES_SUBMIT_TLM environment variable takes precendence
# over the configuration to choose whether to enable telemetry submission
tlm_env = os.environ.get('GR_SATELLITES_SUBMIT_TLM')
if tlm_env is not None:
tlm_submit = bool(int(tlm_env))
else:
tlm_submit = self.config.getboolean('Groundstation', 'submit_tlm')
if tlm_submit:
self._additional_datasinks.extend(self.get_telemetry_submitters(self.satyaml, self.config, self.options))

if self.options is not None and self.options.hexdump:
self._additional_datasinks.append(datasinks.hexdump_sink())

Expand Down
2 changes: 2 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

export GR_SATELLITES_SUBMIT_TLM=0

echo 1KUNS-PF
gr_satellites 1KUNS-PF --wavfile satellite-recordings/1kuns_pf.wav
echo 3CAT-1
Expand Down

0 comments on commit 66f157a

Please sign in to comment.