Skip to content

Instantly share code, notes, and snippets.

View kng's full-sized avatar

Daniel Ekman kng

  • Umeå, Sweden
View GitHub Profile
@kng
kng / 99-pps.rules
Last active August 3, 2022 09:52
galmon: ntp with nmea and pps
KERNEL=="ttyS0", SYMLINK+="gps0"
KERNEL=="pps0", OWNER="root", GROUP="dialout", MODE="0660"
@kng
kng / raspi_stvid_binary_install.md
Last active August 9, 2022 14:38
Binary install of stvid for acquiring on a raspberry pi

NOTE: this uses EelkeVisser's repo, in the future perhaps look at the upstream

binary install of stvid for acquiring, approx 30min install in total tested with 2022-04-04 image on a 4gb card https://www.raspberrypi.com/software/operating-systems/

raspberry pi imager chose os: Raspberry Pi OS Lite (Legacy) Debian version: 10 (buster)

@kng
kng / build.sh
Last active August 18, 2022 16:41
raspberry pi pgplot build
wget ftp://ftp.astro.caltech.edu/pub/pgplot/pgplot5.2.tar.gz
tar zxvf pgplot5.2.tar.gz
cd pgplot
mkdir build
cd build
# fetch drivers.diff
# fetch makefile.diff
cp ../drivers.list .
patch -l drivers.list drivers.diff
../makemake .. linux f77_gcc
@kng
kng / check_satnogsclient.sh
Last active August 20, 2022 09:58
satnogs client check for error and restart service
#!/bin/bash
if [ "$(journalctl -u satnogs-client.service -n 200|grep -c 'Observer job lock acquiring timed out')" -gt 0 ]; then
# dump the log for later inspection
journalctl -u satnogs-client.service -n 200 > ~/satnogs-client.log
sudo service satnogs-client restart
fi
@kng
kng / run_flowgraph.sh
Created August 29, 2022 20:31
satnogs manual flowgraph run
#!/bin/bash
SATNOGS_SOAPY_RX_DEVICE="driver=rtlsdr"
SATNOGS_RX_SAMP_RATE="2.048e6"
SATNOGS_PPM_ERROR="0"
SATNOGS_RF_GAIN="3.7"
SATNOGS_ANTENNA="RX"
RX_FREQ="137912000" # NOAA 18
BIN="/usr/bin/satnogs_fm.py"
@kng
kng / README.txt
Last active September 5, 2022 12:12
testrun stvid docker processing
# Test run container with known data
# fetch and unpack test-data.tbz2 into data/
tar jxvf test-data.tbz2
# pull and start the container
./run.sh
# inside the container cwd will be /data
./process.sh
@kng
kng / apply.sh
Created September 10, 2022 15:56
manual patch for running systems knegge/gr-satnogs:pr239
#!/bin/bash
patch -b /usr/lib/python3/dist-packages/satnogs/doppler_compensation.py /usr/lib/python3/dist-packages/satnogs/doppler_compensation.diff
@kng
kng / reset_rtlsdr.sh
Created December 25, 2022 19:11
Reset RTL-SDR that is hacing issues otherwise solved with reboot
#!/bin/bash
DEV=$(usbreset|grep RTL2838|awk '{print $2}')
for RTL in $DEV; do
echo "Resetting device $RTL"
usbreset $RTL
done
@kng
kng / docker-compose.yml
Last active December 28, 2022 14:39
SatNOGS librespace docker client with addons
version: '3.8'
services:
rigctld:
image: 'librespace/hamlib:4.0'
user: '999'
read_only: true
environment:
MODEL: '1'
restart: 'unless-stopped'
@kng
kng / update-flowgraphs.sh
Created January 1, 2023 16:36
Workaround for old flowgraphs with satnogs-client
#!/bin/bash
#SATNOGS_RIG_IP=rigctld
CLIENT=satnogs-client
RIGIP=$(getent hosts "$SATNOGS_RIG_IP" | awk '{ print $1 }')
FLOWGRAPHS=(/usr/bin/satnogs_*.py)
OUTPATH=~/.local/bin
if [ -z "$RIGIP" ]; then
echo "Warning: unable to resolve SATNOGS_RIG_IP"
exec $CLIENT