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 🙁

Visits: 66

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

Visits: 45