My attempt on multiple clients

Hi, I wanted to share with you all on my attempt with running multiple SatNOGS client using multiple dongles to get 2m & 70cm observations simultaneously.

  • Question - is it really possible?
  • Answer - It should be - running satnogs-client under two different system accounts.

First of all I created two observation stations - Station 108 for 2m and 70cm station, the share the same location but different antennas & dongle.

Next I created two system accounts “satnogs_2m” and “satnogs_70cm”.

groupadd satcom
useradd -g satcom -d /opt/satnogs_2m -m satnogs_2m
useradd -g satcom -d /opt/satnogs_70cm -m satnogs_70cm

later it appeared that under Debian you have to add these users to group plugdev to gain access to SDRs:

usermod -G plugdev satnogs_2m
usermod -G plugdev satnogs_2m

Then I created directory structure & environment as in documentation - basically I copied already running config and changed SATNOGS_ exports to reflect new directory structure, also changed PPM error, station ID, rigctld&rotctld ports. It was very important to set different SATNOGS_RX_DEVICE as I wanted to use two dongles at once.

OK, so far so good - I had basic setup. Now it’s time to change something in gr-satnogs to get two dongles running. For that I had to change hw_settings.py & dsp_settings.py I have my gr-satellites compiled to use /usr so I dug into /usr/lib/python2.7/dist-packages/satnogs/ and added new hardware in hw_settings.py:

'rtlsdr_70' : {'rf_gain' : 49.6, 'if_gain' : 0.0,
'bb_gain' : 0.0, 'samp_rate' : 1e6,
'antenna' : '', 'dev_arg' : 'rtl=ATOMUS70cm'} }

It was also added to dsp_settings.py:
'rtlsdr_70' : {'decimation_rx' : 5, 'audio_gain' : 0.9}

Then in screen I just did su - satnogs_2m and su - satnogs_70cm in new window, created simple script file to run rigctld and rotctld Then I ran source envir in every window and typed satnogs-client.

It didn’t work. OK, first client was running but the other was complaining about “port already in use” - as I mentioned before, I use “0” branch with webgui.

So I hooked into another terminal and started searching. It seemed that satnogsclient/main.py does not have port set in socketio.run(). So I created a simple patch checking if port was in use using sockets connect_ex() and if yes - selecting next port (just added +1). Dirty, simple - but it worked!

Or… it seemed so… Turned out that satnogs-client was using a bunch of hardcoded ports in settings.py. So as you might guess - I patched it adding environ.get() to get these working.

Now I had to add new lines in my envir file:

SATNOGS_PASS_TCP_PORT="5005"
SATNOGS_TASK_FEEDER_TCP_PORT="5011"
SATNOGS_ECSS_FEEDER_UDP_PORT="5031"
SATNOGS_BACKEND_LISTENER_PORT="5022"
SATNOGS_BACKEND_FEEDER_PORT="5023"
SATNOGS_CLIENT_LISTENER_UDP_PORT="5015"
SATNOGS_TASK_FEEDER_TCP_PORT="5011"
SATNOGS_ECSS_FEEDER_UDP_PORT="5031"
SATNOGS_STATUS_LISTENER_PORT="5032"
SATNOGS_LD_UPLINK_LISTEN_PORT="5021"
SATNOGS_WOD_UDP_PORT="5023"
SATNOGS_LD_DOWNLINK_LISTEN_PORT="5033"

and changed these values in the other user env file, run the client, added some observations and … it seemed that gnuradio is confused, closing files etc. So I looked again at the code and there it was! GNURADIO_UDP_PORT ! Again added environ.get() & changed upsat/packet_settings.py to import os environ and changed FRAME_RECEIVER_PORT to get the setting from environment settings. Added new export:

SATNOGS_GNURADIO_UDP_PORT

sourced env file, ran the clients and … voila ! It worked!

So it is absolutely possible to run multiple clients with multiple settings for different bands (even for one dongle!). The only disadvantage is you’re running two clients and have two groundstations - even if it’s the same one.

The webinterface is still confused (redis?) and displays current passes alternately. On both app instances.


I am using latest GIT “0” branch of satnogs-client & latest GIT gr-satnogs. I have now three dongles attached, each doing its own work - one for automated APT/LRPT imaging, second for 2m SatNOGS observations (with QFH antenna) and third for 70cm (test with paralindy antenna). So far it’s working and I hadn’t fount issues (yet). Please keep in mind I own machine way more powerful than rPi and I can’t tell if it could work on embedded device.

All changes to the satnogs-client code are on my GitHub fork.

4 Likes

Hi

I am triying to deploy a very similar station, but I am having problems with the client not being prepared for this.
Right now I have two problems:

  • Flask status server (port 5000) is not configurable (or I don’t know how to change it)

  • Not being able to select which RTL donge uses each instance, I have them labeled with the serial changed on the EEPROM, but I didn’t find how to specify what dongle to use.

Has anyone else tried this? I don’t want to fork the client, as it would mean mantaining the port and I don’t have enough time.