Lessons learned so far

After I got a Wimo AT-1 turnstile installed in my tower I decided to set up a SatNOGS ground station using a RTL-SDR dongle as receiver on a Raspberry Pi 3B.

Using the SAtNOGS image for RPi has not taught me much, but I have let it being used by the community. This will probably continue this way for quite some time until I pull myself together and dive into DSP and GNU Radio.

Using an RPi as server as I do here is a mixed blessing. Although the RPi is cheap and easy to get up and running it appears that it is not quite suited as a server running continuously.

After some time (which can be days and weeks) the CPU apparently looses contact to the micro-SD card that acts as hard disk. It can still be ping’ed but you cannot log into it.

I have been told that it may be due to the way the internal file system on the card works. In any case the card becomes totally unaccesible and has to be replaced by a new card.

I have tried to amend the situation by adding an external hard disk to the RPi but it only took longer before the situation appeared again šŸ™

Hits: 18

SatNOGS’ image for the Raspberry Pi 3

Since I got nowhere with neither pip nor git I turned to the ‘official’ Raspberry Pi image. It contained a ready-to-run setup of all the SatNOGS software, so I got a chance to find out how to configure it.

First of all there was a setup program (which uses Ansible) so I could supply the necessary information to the program. Using the setup program I got the following in /etc/default/satnogs-client:

ATNOGS_API_TOKEN="<---obfuscated--->"
SATNOGS_NETWORK_API_URL="https://network-dev.satnogs.org/api/"
SATNOGS_RX_DEVICE="ic821h" 
SATNOGS_STATION_ELEV="37" 
SATNOGS_STATION_ID="187" 
SATNOGS_STATION_LAT="55.83904" 
SATNOGS_STATION_LON="12.39592"

The tricky part here was the Station ID. It is not the callsign of your station – which to me would be the natural interpretation – but the serial number you get when you register your station at the SatNOGS web site.

Finding the code that actually comprises the client was more difficult but I found it in /var/lib/satnogs/lib/python2.7/site-packages/satnogsclient/ Here was also the settings.py file. The part of it concerning the whereabouts of the ground station is:

import os
from distutils.util import strtobool
from os import environ, path

def _cast_or_none(func, value):
try:
  return func(value)
except (ValueError, TypeError):
  return None

# Ground station information
SATNOGS_API_TOKEN = environ.get('SATNOGS_API_TOKEN', None)
SATNOGS_PRE_OBSERVATION_SCRIPT = environ.get('SATNOGS_PRE_OBSERVATION_SCRIPT', None)
SATNOGS_POST_OBSERVATION_SCRIPT = environ.get('SATNOGS_POST_OBSERVATION_SCRIPT', None)
SATNOGS_STATION_ID = _cast_or_none(int, environ.get('SATNOGS_STATION_ID', None))
SATNOGS_STATION_LAT = _cast_or_none(float, environ.get('SATNOGS_STATION_LAT', None))
SATNOGS_STATION_LON = _cast_or_none(float, environ.get('SATNOGS_STATION_LON', None))
SATNOGS_STATION_ELEV = _cast_or_none(float, environ.get('SATNOGS_STATION_ELEV', None))

So the information is taken from environment variables as I suspected, but who sets the up and how? It turned out that SatNOGS relies heavily on the functionality of systemd, but the service script for the client reveals how:

[Unit]
Description=SatNOGS client
Requires=redis-server.service
After=redis-server.service

[Service]
EnvironmentFile=-/etc/default/satnogs-client
Environment=LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libuhd.so.003
ExecStart=/var/lib/satnogs/bin/satnogs-client
#Restart=on-failure
User=satnogs
Group=satnogs

[Install]
WantedBy=multi-user.target

Keine Hexerei, nur BehƤndigkeit

Hits: 10

Getting satnogs-client with git

Getting the client with git is quite simple. I went to /usr/local/source and executed the following command:

git clone https://gitlab.com/librespacefoundation/satnogs/satnogs-client.git

The code revealed (in scheduler/tasks.py) that it took information on e.g. the location of the ground station from a file called settings – probably even settings.py. And lo and behold: in the root of the tree there was a settings.py. Inspection of that file revealed the the definition of the variables was taken from  some environment variables, but who defines those variables?

Hits: 9

Getting satnogs-client using pip.

Pip has a package containing the client. You get it with this command

pip install satnogsclient

When you run the installed program, it aborts immediately with this error message:

Exception: SATNOGS_STATION_ID not configured.

so quite clearly some configuration is required, but how? There were no obvious hints neither in the code nor on the SatNOGS web site.

Perhaps a look into the code might help. Try getting the source with git.

Hits: 10

Getting satnogs-client

It appears that there are at least three ways of getting satnogs-client onto one of your compters:

  • Go to Github and read ‘README.rst’ which tell you you can either install using pip:
    pip install satnogsclient

    or

  • clone the latest development version:
    $ git clone https://gitlab.com/librespacefoundation/satnogs/satnogs-client.git
    $ cd satnogs-client
    $ pip install -e .
    
  • The reference platform for SatNOGS is the Raspbery Pi 3. so the SatNOGS wiki has a few words on the matter: SatNOGS wiki on the RaspberryPi 3

I have tried all three methods and I’ll comment on all three of them. šŸ˜‰

Hits: 17

SatNOGS’ Client

The client module (dubbed satnogs-client) is one of the two areas I’ll concentrate upon now.

I finally located the documentation for the module:Ā SatNOGS Client DocumentationĀ  So away for some reading.

A few days later: I have found out that the client uses the utilities from hamlib (Hamlib wiki) in casu rigctld and rotctld. Since I have no antennas (yet) I have concentrated on learning how to use rigctld and rigctl.

Using rigctl is quite simple. My radio is an Icom 821 so after having studied the man page I could start rigctl with this command:

sudo /usr/local/bin/rigctl -m 334 -r /dev/ttyUSB0 -s 19200 -c 0x60 -vvvvv

I could talk to the 821 and e.g. see the frequency change in the display.

BTW You may as well use rigctld for this (This is what satnogs-client does, I have found out). The only difference is that instead of receiving commands from stdin rigctld reads them off a TCP socket, default 4532. Use ‘netcat’ to communicate with rigctld:

nc localhost:4532

The available commands are documented in the man page for rigctl and/or rigctld.

The next task will be to get satnogs-client up and running.

Hits: 18

So what is SatNOGS?

SatNOGS stands officially for “Satellite Networked Open Ground Station” which I take to mean “Open Networked Satellite Ground Station”, but ONSGS is not a very user friendly acronym…

The SatNOGS web site satnogs.org has a wealth of information, but the page I found most useful is the wiki: wiki.satnogs.org. I’ll quote one image that gives a overall view of the whole setup:

SatNOGS block diagram

Since my primary purpose of the whole  exercise is to familiarize myself with SatNOGS rather than building an actual grundstation and since I have have no antennas at the moment I’ll restrict myself to work with the two boxes ‘SatNOGS client’ and ‘Signal Reception’ (marked in red in the picture).

I have at hand a radio (an ICOM 821) and several options for decoders: an old DSP12 TNC, a SignaLink soundcard and a standard coundcard in the my workstation. Alternatively I might acquire a SDR unit. Doing this will probably teach me a lot more about signal processing than working with the older ‘classical’ ICOM 821.

The hardware for the SatNOGS client could be either my workstation or a Raspberry Pi 3.

I consider setting up the SatNOGS client as a piece of cake (how difficult can installing a piece of software be?) so the next step will be to get the 821 back into the shack and connect the above mentioned decoders to it. Perhaps I should rig something up as a receive antenna.

Hits: 16