Draft 19-11-2020 09:30 CET
Is it possible to activate a second SDR on an already running SatNOGS ground-station?
Some thoughts on what I wanted to achieve:
- Connect a secondary SDR to the same satnogs ground station system, and with this setup be able to expand the frequency coverage and also be able run multiple observations at the same time.
- Don’t change a thing on the basic satnogs-client setup, this to prevent difficulties with future upgrades and also be able to use the standard satnogs-client tooling.
Here my journey in how to get this working.
On a SatNOGS ground-station, the systemd deamon is used to start and stop the satnogs-client service and on my quest to enable a second SDR I looked at the configuration files and came up with an idea the enable a second satnogs-client instance and by doing so enabling a second radio.
This setup is using a second RTL-SDR v3 and the ground-station software is running on an old HP NC-6400 laptop. The cpu is a Intel Centrino Duo and the operating system is Debian Buster i386.
Here is a link to the SatNOGS station page where you can find the observations that are done with this setup.
Lets start by investigating the satnogs-client start and stop configuration.
The satnogs-client systemd services file:
[Unit] Description=SatNOGS client [Service] EnvironmentFile=-/etc/default/satnogs-client ExecStart=/var/lib/satnogs/bin/satnogs-client Restart=on-failure User=satnogs Group=satnogs [Install] WantedBy=multi-user.target
Looking at this file it seems that the start-up is using an environment input file and this gives the option to create a copy of this file and use it for a second satnogs-client service.
Here an example of the default config as configured by satnogs-setup.
SATNOGS_API_TOKEN="your token" SATNOGS_STATION_ID="your station id" SATNOGS_STATION_LAT="your latitude" SATNOGS_STATION_LON="your longitude" SATNOGS_STATION_ELEV="long your elevation" SATNOGS_SOAPY_RX_DEVICE="driver=rtlsdr" SATNOGS_RX_SAMP_RATE="2.048e6" SATNOGS_PPM_ERROR="-2" SATNOGS_RF_GAIN="38.6" SATNOGS_ANTENNA="RX"
When the second satnogs-client is configure, you also need to change this
"driver=rtlsdr,serial=00000001" do this with the help of the
satnogs-setup utility the original service will be managed via the standard tooling.
Based on what we just found we can make a copy of the satnogs-client systemd and environment file.
Lets start with the systemd configuration file
/etc/systemd/system/satnogs-client.service we make a copy and change the
[Unit] Description=SatNOGS Second client [Service] EnvironmentFile=-/etc/default/satnogs-client-second ExecStart=/var/lib/satnogs/bin/satnogs-client Restart=on-failure User=satnogs Group=satnogs [Install] WantedBy=multi-user.target
When something is changed within the systemd subsystem you need to execute the following command
sudo systemctl daemon-reload this will make this new systemd file available.
Now with the following commands you will activate the new service and get the status.
systemctl enable satnogs-client-second
systemctl status satnogs-client-second
systemctl start satnogs-client-second
To make sure this new service is configured in the right way, we need to configure the below settings in the newly created systemd Environmentfile.
When using multiple ground stations you need to create a second ID or multiple ID’s.
SATNOGS_API_TOKEN="your token" SATNOGS_STATION_ID="your station id (create a new one)" SATNOGS_STATION_LAT="your latitude" SATNOGS_STATION_LON="your longitude" SATNOGS_STATION_ELEV="long your elevation" SATNOGS_SOAPY_RX_DEVICE="driver=rtlsdr,serial=00000002" SATNOGS_RX_SAMP_RATE="2.048e6" SATNOGS_PPM_ERROR="-2" SATNOGS_RF_GAIN="38.6" SATNOGS_ANTENNA="RX" SATNOGS_RIG_PORT="4534" SATNOGS_ROT_PORT="/dev/USB1" SATNOGS_OUTPUT_PATH="/home/lab/data/vhf" SATNOGS_INCOMPLETE_OUTPUT_PATH="/home/(user)/data/vhf/incomplete"
In the original environment file there are some values that aren’t explicitly shown because the defaults are used or don’t need to be configured. Now with the new situation we do need them. Most of them are self explanatory apart from
SATNOGS_RIG_PORT this tells the service to what rigctld port to connect and this in its turn is used for doppler control.
So we need a second rigctld daemon with the corresponding port as configured in the environment file. In this example I am using
SATNOGS_RIG_PORT="4534" to get this done we basically use the same way as with the satnogs-client.services systemd config.
Make a copy of
/etc/default/hamlib-utils-second then edit the files so they look similar to the following.
[Unit] Description=rigctld VHF server [Service] EnvironmentFile=-/etc/default/hamlib-utils-second ExecStart=/usr/bin/rigctld $RIG_OPTS Restart=on-failure User=hamlib-utils Group=hamlib-utils [Install] WantedBy=multi-user.target
ROT_OPTS="" RIG_OPTS="-T 127.0.0.1 -t 4534 -m 1"
When you are done execute
systemctl daemon-reload and enable the newly created service with
systemctl enable rigctld-second.service and start it with
systemctl start rigctld-second.service.
Now to the last part, how to bind the right SDR and everything connected to the corresponding satnogs-client service running on the system. For the RTL-SDR devices this can be done with the help of the
SATNOGS_SOAPY_RX_DEVICE="driver=rtlsdr,serial= option there is only one challenge all SDR-RTL units have the same serial number.
To change the serial number you can use the tool
rtl_eeprom program. I think the easiest way to make the RTL-SDR unique is to connect ONE to your system and execute the following command
rtl_eeprom -d 0 -s 0000000x where x is the value you want to use for this RTL-SDR. The remove this unit from the system and plugin the next one. Use the same command but with a different serial value.
Remember the serial number that belongs to the RTL-SDR and configure your
When this is all successful you should now see two active ground stations at https://network.satnogs.org/users/username/
I hope this information is useful and good luck with enabling your second receiver.
The SatNOGS documentation wiki
RTL-SDR eeprom tool