
Deployment and processing scripts for Raspberry Pi nodes controlled by KStars/Ekos. Simplifies setup of Pi-based astrophotography nodes and automates data processing workflows.
The AP Toolkit assists with:
- Deploying KStars/Ekos and INDI software on Raspberry Pi nodes
- Configuring hardware permissions and system settings for astrophotography equipment
- Testing camera connectivity and basic hardware functionality
- Processing captured image data with automated calibration and stacking
- Managing file transfers and network storage between nodes
node.sh
- Raspberry Pi deployment, hardware setup, camera testing, NFS setup, and file transfer managementprocess.sh
- Batch processing with Siril and astrometry.netref_binder_gen.py
- Astrophotography sequence planning and telescope setup analysis
# Create custom SD card image and flash
./node.sh flash-image config.json /dev/sdX
# Deploy to a fresh Raspberry Pi with astrophotography hardware
./node.sh test pi@192.168.1.100
./node.sh deploy pi@192.168.1.100
# Test camera connectivity (local or remote)
./node.sh test-camera # Test local camera
./node.sh test-camera pi@192.168.1.100 # Test remote camera
# Setup file sharing
./node.sh setup-nfs pi@192.168.1.100 # Enable NFS server
./node.sh mount-nfs pi@192.168.1.100 # Mount NFS locally
./node.sh transfer pi@192.168.1.100 # SSH transfer to ./captures/
# Plan astrophotography sequences
python3 ref_binder_gen.py --sequence --target-name "Orion Nebula" --target-magnitude 4.0 --target-type nebula --total-time 300
# Process captured data
./process.sh batch ./captures
The process.sh
script automates the processing of astrophotography data using Siril.
Steps:
- Stack darks, flats: Stacks dark and flat frames for calibration.
- Calibrate lights: Applies dark and flat calibration to light frames.
- Apply background extraction: Removes background gradients from light frames.
- Register stars: Aligns frames using stars; uses the middle frame as a reference.
- Exclude frames outside thresholds: Filters frames based on focus (FWHM < mean+2σ), star count (> mean-2σ), and roundness (> mean-1.5σ).
- Stack selected frames: Combines frames using winsorized sigma filter with FWHM weighting.
- Output: Processed images saved in
process_*
directory asresult.fit
.
If Astrometry.net is installed locally, and the appropriate catalogues are present, then the image may be plate-solved and annotated:
solve-field process_captures/result.fit -D output_directory
plot-constellations -w output_directory/result.wcs -C -B -D -d /usr/share/astrometry/data/hd.fits -o result_annotated.png
Alternatively, use the plate-solve-annotate.sh
script for automated plate solving and annotation:
./plate-solve-annotate.sh process_captures/result.fit --hd
The python scriopt fits_to_mp4.py
may also be used to produce a video sequence of the collected data. This is similar to Siril's ability to output a sequence to video (generally the Siril function is recommended), but the script allows specifying prefixes to filter from existing *.fit files in a directory, as well as the intermediate file format used by OpenCV:
fits_to_mp4.py . --prefix bkg_pp_ --bmp
7_26_vega_q5.mp4
This script may also be used to produce video of other timelapse subjects.
7_22_clouds_pm.mp4
Use KStars/Ekos Scheduler for automated observation planning:
- Scheduler Guide: Official KStars Ekos Scheduler Documentation
- Complete Ekos Guide: KStars Ekos Module Documentation
- INDI Setup: Equipment Profile Configuration
- Getting Started: Launch
kstars
, open Ekos (Tools → Ekos), and use the Scheduler tab - Multi-Node Support: Connect to multiple INDI servers simultaneously (each Pi runs its own server on port 7624)
- Remote Control: Switch between nodes or coordinate multiple telescopes from a single Ekos instance
Why use KStars/Ekos instead of custom scheduling scripts?
- Complete GUI-based scheduling with constraints, priorities, and automated equipment control
- Built-in INDI driver support for all major astronomical equipment
- Automated alignment, focusing, guiding, and imaging sequences
- Weather monitoring, meridian flip handling, and safety shutdown
- Remote observatory control over network connections
- Extensive documentation and active community support
The node.sh
script prepares Raspberry Pi systems for KStars/Ekos control by configuring:
- Software installation: KStars/Ekos, INDI drivers, gphoto2, system utilities
- USB permissions: Adds users to plugdev, tty, dialout groups for hardware access
- Udev rules: Automatic device detection for cameras, mounts, and serial adapters
- System services: NTP synchronization, SSH access, directory structure
- Network setup: INDI server configuration for remote KStars/Ekos connections
Configures access for common astrophotography equipment:
- Cameras: Canon/Nikon DSLR cameras via USB
- Mounts: FTDI-based telescope mounts and USB-to-serial adapters
- Accessories: Focusers, filter wheels, guide cameras
Each deployed Pi node:
- Runs INDI server (port 7624) for equipment drivers
- Accepts remote connections from KStars/Ekos control systems
- Provides local storage with optional NFS sharing for captured images
- Operates as part of a multi-node observatory network controlled by KStars/Ekos
Nodes require: KStars/EKOS, INDI drivers, gphoto2, SSH access, hardware permissions
Local processing requires: Siril, Astrometry.net (optional)