indi allsky ctl - aaronwmorris/indi-allsky GitHub Wiki

Command-Line Utility: indi-allsky-ctl

indi-allsky-ctl is the unified command-line control and maintenance utility for indi-allsky. Installed automatically at /usr/bin/indi-allsky-ctl with the .deb package, it wraps common maintenance tasks, service operations, hardware diagnostics, and database utilities into a single command without requiring you to manually activate python virtual environments or remember script paths.


Quick Reference

indi-allsky-ctl <command> [options/arguments...]

To see all available commands from the terminal:

indi-allsky-ctl --help

1. User & Authentication Management

Manage web interface user accounts directly from the command line:

List Users

List all active and inactive web users, their admin status, and contact info:

indi-allsky-ctl user-list

Reset / Change Password

Change or reset the password for an existing web account:

sudo indi-allsky-ctl passwd -u <username>
# Or alias:
sudo indi-allsky-ctl reset-pass -u <username>

Add a New User

Create a new user account with administrative privileges:

sudo indi-allsky-ctl user-add -u <username> -p <password> -n "Full Name" -e "[email protected]" --admin

(Omit --admin for a standard view-only account).

Delete a User

Remove a user account:

sudo indi-allsky-ctl user-del -u <username>

2. Database & Storage Management

Immediate Database Backup

Create an immediate gzipped SQLite database backup inside /var/lib/indi-allsky/backup/:

sudo indi-allsky-ctl backup-db

Repair File & Directory Permissions (fix-perms)

Recursively verify and repair ownership and permissions across all system and web directories (/var/log/indi-allsky, /etc/indi-allsky, /var/lib/indi-allsky, /var/www/html/allsky, and your active IMAGE_FOLDER):

sudo indi-allsky-ctl fix-perms
# Alias:
sudo indi-allsky-ctl repair-perms

Tip

Use this command if you have manually copied images, darks, or config files with sudo or non-standard permissions and the web interface or capture daemon cannot write to them.

How to Relocate / Change the Image Directory

To move image storage to a secondary drive, SSD, or custom path (e.g. /mnt/storage/allsky/images):

  1. Stop all services:
    sudo systemctl stop indi-allsky.service gunicorn-indi-allsky.service
  2. Copy existing image files to the new location:
    sudo mkdir -p /mnt/storage/allsky/images
    sudo rsync -av /var/www/html/allsky/images/ /mnt/storage/allsky/images/
  3. Update Flask & Web Configuration (/etc/indi-allsky/flask.json): Edit /etc/indi-allsky/flask.json and update INDI_ALLSKY_IMAGE_FOLDER:
    "INDI_ALLSKY_IMAGE_FOLDER": "/mnt/storage/allsky/images",
  4. Update Camera Configuration: In the Web UI under Configuration → Camera Settings, set IMAGE_FOLDER to /mnt/storage/allsky/images (or update via CLI with indi-allsky-ctl config).
  5. Run fix-perms to apply correct ownership & permissions:
    sudo indi-allsky-ctl fix-perms
    fix-perms automatically reads /etc/indi-allsky/flask.json and the database, assigns indi-allsky:www-data ownership, creates required darks/ and export/ subfolders, and sets 775 permissions so both the capture daemon and web server can read and write files.
  6. Restart services:
    sudo systemctl start indi-allsky.service gunicorn-indi-allsky.service

Capture & Generate Master Dark Frames

Capture and stack master dark calibration frames for the connected camera without manually managing Python environments:

# Recommended for 16-bit RAW / monochrome / raw Bayer cameras:
sudo indi-allsky-ctl darks sigmaclip

# For RGB / JPEG / PNG webcams or IP cameras:
sudo indi-allsky-ctl darks average

# Temperature-calibrated dark series:
sudo indi-allsky-ctl darks tempsigmaclip
# or
sudo indi-allsky-ctl darks tempaverage

# Aliases:
sudo indi-allsky-ctl generate-darks sigmaclip
sudo indi-allsky-ctl capture-darks sigmaclip

(Ensure indi-allsky service is stopped before taking dark frames).

Delete / Flush Dark Calibration Frames

Purge all master dark calibration frames from disk and database:

sudo indi-allsky-ctl darks flush
# Alias:
sudo indi-allsky-ctl flush-darks

Camera Configuration Management & Reset

Manage or reset camera configuration JSON blobs stored in the database:

# Reset camera configuration back to initial default values:
sudo indi-allsky-ctl reset-config

# Export active camera configuration to JSON STDOUT:
indi-allsky-ctl dump-config

# Direct access to configuration management actions:
indi-allsky-ctl config list
indi-allsky-ctl config dump
sudo indi-allsky-ctl config bootstrap

Rebuild Missing Thumbnails

Scan your historical image collection and generate any missing thumbnails for timelapses, keograms, and startrails:

sudo indi-allsky-ctl rebuild-thumbnails

Expire Images & Purge Old Files

Manually trigger image retention policies and delete expired captures:

sudo indi-allsky-ctl expire-images

Audit & Validate Database

Check the integrity of image, timelapse, and keogram records against files on disk, fixing orphaned or broken database entries:

sudo indi-allsky-ctl validate-db

Convert Database (SQLite to MySQL)

Migrate database records from SQLite to a MySQL/MariaDB server:

sudo indi-allsky-ctl convert-db

Flush Camera Images & Videos from Database

Purge all image records (and optionally video records) associated with a specific camera ID from the database:

sudo indi-allsky-ctl flush-images --camera_id 1
# Include videos as well:
sudo indi-allsky-ctl flush-images --camera_id 1 --flush-videos
# Alias:
sudo indi-allsky-ctl purge-images --camera_id 1

Flush Recent Images (Last 16 Minutes)

Flush images taken in the last 16 minutes from the database to reset recent exposure/gain/bin adaptation heuristics without clearing full history:

sudo indi-allsky-ctl flush-16min-images
# Alias:
sudo indi-allsky-ctl flush-recent-images

Merge Camera Entries

When upgrading INDI driver versions or switching camera configurations, a camera may be assigned a new database ID. Merge historical records and images from the old camera entry to the new one:

sudo indi-allsky-ctl merge-cameras -orig <old_camera_id> -n <new_camera_id>

Optimize MySQL / MariaDB Database

Analyze and reclaim unused storage space across all indi_allsky MySQL tables:

sudo indi-allsky-ctl optimize-mysql
# Alias:
sudo indi-allsky-ctl mysql-optimize

(Ensure indi-allsky service is stopped before optimizing tables).

Import Dark Frames & Bad Pixel Maps

Interactively import pre-existing dark calibration frames and bad pixel maps into the database:

sudo indi-allsky-ctl import-darks

Retry / Sync Pending Uploads

Manually trigger synchronization of pending or failed uploads (SFTP, S3, Sync API) for images and videos:

# Display upload sync report:
indi-allsky-ctl retry-uploads report

# Run synchronization:
indi-allsky-ctl retry-uploads sync --days 30 --threads 2

# Aliases:
indi-allsky-ctl upload-sync sync
indi-allsky-ctl sync-uploads sync

Add System Alert Notification

Inject a user notification directly into the database to display in the web interface notification center:

indi-allsky-ctl notify <CATEGORY> <ITEM> <MESSAGE> <EXPIRE_MINUTES>

# Example:
indi-allsky-ctl notify GENERAL "Maintenance" "Scheduled system reboot in 10 minutes" 60

Categories: GENERAL, MISC, MEDIA, HARDWARE, CAMERA, etc.


3. Hardware & Diagnostics

Diagnostic Camera Test

Probe your configured camera interface and take a diagnostic test exposure:

indi-allsky-ctl test-camera

List Detected INDI Cameras

Scan the local INDI server and list all detected camera devices:

indi-allsky-ctl list-cameras

Detailed Camera Information

Connect to the running INDI server and print a detailed summary table of sensor parameters, gain ranges, resolutions, pixel dimensions, and supported video formats:

indi-allsky-ctl camera-info

Inspect Camera Properties

Dump all INDI driver properties, controls, switches, and exposed parameters for attached camera devices:

indi-allsky-ctl camera-props
# Alias:
indi-allsky-ctl camera-properties

Test Camera Linearity

Measure camera sensor linearity across progressive exposure times:

indi-allsky-ctl test-linearity -C 3 -M 1.0 -m 0.01 -g 100 -l 25
# Alias:
indi-allsky-ctl camera-linearity -C 3 -M 1.0

Options:

  • -C, --Count: Number of exposures per level (default: 3)
  • -M, --Max_exposure: Maximum exposure in seconds (default: 1.0)
  • -m, --min_exposure: Minimum exposure in seconds
  • -g, --gain: Camera gain to test
  • -l, --level: Exposure increment step percentage (default: 25%)
  • --calibrate: Enable dark calibration subtraction during test

Test Environmental Sensors

Probe configured I2C, SPI, 1-Wire, and serial hardware sensors (e.g. BME280, BMP280, INA219, MLX90614) and display live telemetry readings:

indi-allsky-ctl test-sensors

Test Fans, Heaters & GPIO Devices

Test auxiliary hardware controllers such as enclosure fans, dew heaters, and GPIO outputs:

# Test fan operation:
indi-allsky-ctl test-devices fan

# Test dew heater operation:
indi-allsky-ctl test-devices dew_heater

# Test automatic GPIO pins:
indi-allsky-ctl test-devices auto_gpio

# Aliases:
indi-allsky-ctl test-fans fan
indi-allsky-ctl test-hardware dew_heater

Test Upload Protocols

Validate configured file transfer destinations and cloud storage connections:

# Test SFTP / FTP transfers:
indi-allsky-ctl test-upload filetransfer

# Test S3 / Object Storage:
indi-allsky-ctl test-upload s3

# Test Sync API endpoint:
indi-allsky-ctl test-upload syncapi

Test ADS-B Aircraft Tracking

Validate dump1090 connection and inspect live aircraft tracking data:

indi-allsky-ctl test-adsb

Test Oracle Cloud (OCI) Configuration

Verify that the configured OCI credentials file and API keys are valid:

indi-allsky-ctl test-oci

Test WebSocket Events & Remote Actions

Connect to the real-time WebSocket event stream or send immediate action commands:

# Interactive listener mode (listens for events and accepts interactive commands):
indi-allsky-ctl test-websocket

# Send a single control action:
indi-allsky-ctl test-websocket --action pause
indi-allsky-ctl test-websocket --action ping
indi-allsky-ctl test-websocket --action get_status
indi-allsky-ctl test-websocket --action keogram

# Aliases:
indi-allsky-ctl test-ws --action ping

Generate Diagnostic Support Bundle

Generate a redacted diagnostic report containing system logs, hardware configurations, and environment details for troubleshooting:

sudo indi-allsky-ctl support-info

4. Peripheral Configuration & Integrations

Interactive setup helpers for common hardware accessories and integrations:

Disable Raspberry Pi Onboard LEDs

Disable status, power, and ethernet LEDs on Raspberry Pi 3, 4, or 5 to eliminate stray dome reflections:

sudo indi-allsky-ctl disable-leds
# Alias:
sudo indi-allsky-ctl setup-leds

Setup Mosquitto MQTT Broker

Install and configure the local Mosquitto MQTT message broker:

indi-allsky-ctl setup-mqtt
# Alias:
indi-allsky-ctl setup-mosquitto

(Run as your normal user with sudo privileges; do not run directly as root).

Home Assistant MQTT Auto-Discovery

Publish Home Assistant auto-discovery MQTT payloads so all camera sensors, temperatures, and status indicators immediately populate in Home Assistant:

indi-allsky-ctl ha-discovery
# With custom device topic prefix:
indi-allsky-ctl ha-discovery --device_topic allsky
# Alias:
indi-allsky-ctl setup-ha-discovery

Setup GPS / GPSD

Configure gpsd and serial GPS receivers for hardware time synchronization:

sudo indi-allsky-ctl setup-gps

Setup WiFi Hotspot Failover

Set up automatic WiFi hotspot fallback using NetworkManager when home WiFi is unreachable:

sudo indi-allsky-ctl setup-hotspot

Setup Hardware RTC (Real-Time Clock)

Configure an I2C DS3231 or PCF8563 real-time clock module:

sudo indi-allsky-ctl setup-rtc

Setup USB Drive Automount

Configure udisks2 rules to automatically mount external USB flash storage:

sudo indi-allsky-ctl setup-usb-mount

5. Security & TLS Certificates

Export Local Root CA Certificate

Export or view the local mkcert Root Certificate Authority certificate (/etc/indi-allsky/ca/rootCA.pem) to install it into client devices (laptops, phones, tablets) for browser-trusted local HTTPS access:

# Print Root CA certificate to stdout:
sudo indi-allsky-ctl ssl-ca-export

# Or export directly to a file:
sudo indi-allsky-ctl ssl-ca-export /tmp/indi-allsky-ca.pem

Note

For instructions on installing and trusting this certificate on macOS, Windows, Linux, iOS, and Android, consult the Local SSL Certificates & mDNS guide.

Renew Local TLS Leaf Certificate

Verify leaf certificate validity and renew it automatically if it is within 30 days of expiration:

# Standard renewal check (renews only if expiring within 30 days):
sudo indi-allsky-ctl ssl-renew

# Force immediate certificate renewal and reload web server:
sudo indi-allsky-ctl ssl-renew --force

6. Package & Driver Management (INDI)

Prevent upstream package updates from inadvertently replacing working camera drivers:

Pin (Hold) INDI Packages

Lock installed INDI packages (indi-bin, indi-3rdparty, libindi*) so that system-wide apt upgrade will not touch them:

sudo indi-allsky-ctl hold-indi
# Alias:
sudo indi-allsky-ctl pin-indi

Unpin (Unhold) INDI Packages

Release the hold on INDI packages to allow them to upgrade normally:

sudo indi-allsky-ctl unhold-indi
# Alias:
sudo indi-allsky-ctl unpin-indi

Check Hold Status

View which INDI packages are currently held:

indi-allsky-ctl status-indi-hold

Protect Custom Source-Built INDI

If you compiled INDI or INDI 3rd-party drivers from source, register your build in the APT database using an equivs dummy package (indi-local-source version 99.0.0):

sudo indi-allsky-ctl protect-source-indi

Note

This satisfies all APT package dependencies without allowing package managers to overwrite your custom compiled binaries.


6. Service Control & Logs

View Service Status

Check the status of indi-allsky.service and gunicorn-indi-allsky.service:

indi-allsky-ctl status

Restart Services

Restart both the capture daemon and web server:

indi-allsky-ctl restart

Stream Live Logs

Follow real-time systemd journal logs from both indi-allsky and gunicorn:

indi-allsky-ctl logs

See Also

⚠️ **GitHub.com Fallback** ⚠️