Skip to content

Instantly share code, notes, and snippets.

@kng
Last active August 9, 2022 14:38
Show Gist options
  • Save kng/a529bc71d582237cecf66bd37e7bac6c to your computer and use it in GitHub Desktop.
Save kng/a529bc71d582237cecf66bd37e7bac6c to your computer and use it in GitHub Desktop.
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)

under settings: set hostname raspi-cam, enable ssh with password auth, wifi config

boot the rpi with the fresh sd then connect to it with the hostname set earlier, raspi-cam.local

update the software before running raspi-config

sudo apt update --allow-releaseinfo-change
sudo apt upgrade -y

enable camera, reboot

sudo raspi-config

install required system packages

sudo apt install -y git python3-pip virtualenv python3-virtualenv libopenjp2-7 libhdf5-103 libavcodec58 libavformat58 libswscale5 python3-pyqt5 libatlas-base-dev
sudo apt autoremove
sudo apt clean

get stvid and install requirements

git clone https://github.com/EelkeVisser/stvid.git
cd stvid
virtualenv -p python3 env
source env/bin/activate
pip install numpy opencv-contrib-python "picamerax[array]" --prefer-binary
pip install -r requirements.txt --prefer-binary
pip install -r requirements-pi.txt --prefer-binary
pip cache remove '*'
cp configuration.ini-dist configuration.ini

edit config

observations_path = /home/pi/stvid/obs/ # Path for raw acquisitions
tle_path = /home/pi/stvid/tle/          # Path where TLEs are stored (and updated)
results_path = /home/pi/stvid/results   # Path for results of processed obs
camera_type = PI

create directories for acquisition

mkdir -p obs/control tle results
touch obs/control/position.txt

running: with activated venv ./acquire.py -t 10

not activated venv ./env/bin/python3 ./acquire.py -t 10

or with paths ~/stvid/env/bin/python3 ~/stvid/acquire.py -c ~/stvid/configuration.ini -t 10

example log

2022-08-09 09:34:52,825 [MainThread  ] [INFO ]  Using config: configuration.ini
2022-08-09 09:34:52,826 [MainThread  ] [INFO ]  Test mode: True
2022-08-09 09:34:52,826 [MainThread  ] [INFO ]  Test duration: 10s
2022-08-09 09:34:52,826 [MainThread  ] [INFO ]  Live mode: False
Downloading https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat
|======================================================================================================| 1.3k/1.3k (100.00%)         0s
2022-08-09 09:34:53,143 [MainThread  ] [INFO ]  Starting data acquisition
2022-08-09 09:34:53,144 [MainThread  ] [INFO ]  Acquisition will end after 2022-08-09T07:35:02.827
2022-08-09 09:34:53,460 [MainThread  ] [INFO ]  Storing files in /home/pi/stvid/obs/20220809_0/073453
/home/pi/stvid/env/lib/python3.7/site-packages/picamerax/encoders.py:544: PiCameraResolutionRounded: frame size rounded up from 800x600 to 800x608
  width, height, fwidth, fheight)))
2022-08-09 09:35:14,934 [MainThread  ] [DEBUG]  Captured z1
2022-08-09 09:35:14,935 [MainThread  ] [INFO ]  Capture: Session complete - Exiting
2022-08-09 09:35:14,939 [MainThread  ] [DEBUG]  Processing buffer 1
2022-08-09 09:35:18,044 [MainThread  ] [INFO ]  Compressed 2022-08-09T07:34:55.147.fits in 3.10 sec
2022-08-09 09:35:18,045 [MainThread  ] [INFO ]  Exiting compress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment