# SatNOGS Flowgraphs

SatNOGS GNU Radio flowgraphs.

## Installation

### Requirements

- CMake (> 3.8)
- GNU Radio (> 3.8.0)
- [gr-satnogs](https://gitlab.com/librespacefoundation/satnogs/gr-satnogs)

### Debian

Dependencies available via openSUSE Open Build Service in the repositories of the
[home:librespace:satnogs project](https://build.opensuse.org/repositories/home:librespace:satnogs).
When using those repositories, the dependencies can be installed with:

```
sudo apt-get install build-essential gnuradio-dev gr-satnogs python3-soapysdr
```

### Installation from Source

```
git clone https://gitlab.com/librespacefoundation/satnogs/satnogs-flowgraphs.git
mkdir build
cd build
cmake ..
make
sudo make install
```

## Usage: The new `flowgraph_dispatcher` tool

Up until satnogs-flowgraphs version 1.5, there have been individual flowgraphs for the multitude of modes, e.g. `satnogs_fsk.py` or `satnogs_fm.py`.

In the current `master` branch and thus with the upcoming release, a single executable `flowgraph_dispatcher` is provided that will configure the
right flow depending on a new command line argument `--mode`. E.g. replace `satnogs_fm.py`  with `flowgraph_dispatcher --mode FM`. See [flowgraph_dispatcher.py](https://gitlab.com/librespacefoundation/satnogs/satnogs-flowgraphs/-/blob/ca69c2dc631b18a14d1937c92c78b24a7a681e54/flowgraph_dispatcher/flowgraph_dispatcher.py) for a complete mapping from flowgraph scripts to modes.

### Examples

Before:
```sh
satnogs_fm.py \
--soapy-rx-device=driver=rtlsdr \
--samp-rate-rx=2.048e6 \
--rx-freq=435000000 \
--file-path=test.ogg \
--waterfall-file-path=test.dat \
--decoded-data-file-path=test_data \
--gain=40.0 \
--antenna=RX \
--ppm=0 \
--rigctl-host=127.0.0.1 \
--rigctl-port=4532
```

After:
```sh
flowgraph_dispatcher \
--mode FM \
--soapy-rx-device=driver=rtlsdr \
--samp-rate-rx=2.048e6 \
--rx-freq=435000000 \
--file-path=test.ogg \
--waterfall-file-path=test.dat \
--decoded-data-file-path=test_data \
--gain=40.0 \
--antenna=RX \
--ppm=0 \
--rigctl-host=127.0.0.1 \
--rigctl-port=4532
```

### Special case: CW flowgraph and WPM

The CW flowgraph expects the words-per-minute parameter passed with `--baud {{WPM}}` now. Previously, this parameter was passed with `--wpm {{WPM}}`.

Before:
```
satnogs_cw.py \
    --wpm 42 \
    [...]
```

After:
```
flowgraph_dispatcher \
    --mode CW \
    --baud 42 \
    [...]
```


### Hard-coded Parameters
The dispatcher starts the flowgraph as well as a zeroMQ subscriber, that writes received telemetry frames into files. For this to function properly, the following values must be passed to the dispatcher:

- `zmq-dump-host='127.0.0.1'`
- `zmq-dump-port=16887`

With a future patch, the dispatch might support alternative values provided by the user, and use those to configure the subscriber accordingly.


## Doppler-corrected I/Q streaming via UDP

For realtime analysis during an observation each SatNOGS flowgraph offers streaming of doppler-corrected I/Q data via an UDP sink. The destination of this sink can be configured by the CLI arguments `--udp_dump_host` and `--udp_dump_port`. The sample format are 16-bit complex integers, the sample rate varies
between the flowgraphs and often depends on the baudrate as well.

## License ##

[![license](https://img.shields.io/badge/license-GPL%203.0-6672D8.svg)](LICENSE)
[![Libre Space Foundation](https://img.shields.io/badge/%C2%A9%202020-Libre%20Space%20Foundation-6672D8.svg)](https://libre.space/)
