A multiplatform, lightweight astrophotography suite
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Cross-platform headless astronomy controller for Raspberry Pi, ARM64 SBCs, and Windows mini PCs. ⚠️ Polaris Astro Controller is a community-driven fork of N.I.N.A. It is not affiliated with or supported by the official N.I.N.A. development team. Please don't ask them for support with this fork, open issues here instead.查看完整 README ↗
Cross-platform headless astronomy controller for Raspberry Pi, ARM64 SBCs, and Windows mini PCs.
⚠️ Polaris Astro Controller is a community-driven fork of N.I.N.A. It is not affiliated with or supported by the official N.I.N.A. development team. Please don't ask them for support with this fork, open issues here instead.
Polaris Astro Controller is a lightweight, browser-controlled astrophotography system built on ASP.NET Core. It brings the power of N.I.N.A. (Nighttime Imaging 'N' Astronomy) to single-board computers and small-form-factor PCs, with a responsive Web UI accessible from any device on the network.
The Raspberry Pi (or Windows mini PC) acts as a data broker, controlling hardware, saving FITS files, and streaming images, while your laptop, tablet, or phone handles all the heavy rendering in the browser.
Browser (laptop / tablet / phone) Raspberry Pi / Mini PC
┌──────────────────────────────┐ ┌──────────────────────────┐
│ Web UI (Alpine.js) │◄──HTTP─►│ ASP.NET Core + Kestrel │
│ Live preview (Canvas/WebGL) │◄──WS───►│ INDI client (TCP 7624) │
│ Image processing (client) │ │ Plate solving (ASTAP) │
│ Sky explorer │ │ Sequence engine │
└──────────────────────────────┘ │ Live stacking │
└──────────────────────────┘
Looking for the full tooling matrix? See REQUIREMENTS.md for the complete required + optional dependency list per platform (Windows / Linux ARM-RPi / Linux x64), with firewall rules and hardware sizing guidance.
A single self-hosted backend that drives the whole night from any browser: acquisition, guiding, focusing, planning, live stacking, and a full post-processing suite with in-browser AI. Highlights:
nina.local), remote terminal (SSH in the browser), debug
logging, polar alignment (TPPA + rudimentary), and SBC self-update.Polaris supports a huge range of gear through INDI (400+ Linux drivers), ASCOM/Alpaca, and the native camera SDKs, far more than any one person can own. The list below is the hardware that has actually been used with Polaris in the field, as a starting point; anything INDI/ASCOM/Alpaca-compatible should work even if it isn't listed. Reports of other working (or broken) gear are welcome via an issue or PR.
| Category | Tested devices |
|---|---|
| Mounts | ZWO AM3 · AM3N · AM5 · OnStep (LX200) · Sky-Watcher Star Adventurer GTi · Sky-Watcher AZ-GTi (SynScan WiFi) · Sky-Watcher EQ6-R |
| Cameras (OSC / DSLR) | ZWO ASI585MC Pro · ASI678MC · ASI715MC · ASI2600MC Pro · SVBony SV405CC · SV605CC · SV105 · ToupTek ATR533C · ToupTek ATR2600C (Sony IMX571) · AE676C · Canon EOS Rebel T100 (4000D) · Canon EOS Rebel SL2 (200D) · Canon EOS R8 |
| Cameras (mono) | ZWO ASI183MM Pro |
| Focus motors | ZWO EAF · Gemini Focusing Motor / Focuser Pro |
| Guide cameras | ZWO ASI120MM · ToupTek GPM462C |
| Filter wheels | ZWO EFW Mini (5 positions) · ZWO EFW (8 positions) |
| SBCs (server host) | Raspberry Pi 4 (8 GB) · Raspberry Pi 5 (4 GB) · Orange Pi 4 Pro (4 GB) · Orange Pi 5 Pro (4 GB) · Radxa Dragon Q6A (6 GB) |
| Power boxes | SVBony SV241 Pro |
Recommended board: the Orange Pi 4 Pro (4 GB). It is the best balance of cost and capability measured so far, scoring 180 for roughly $50 to $70. The Radxa Dragon Q6A is the fastest (317); the Orange Pi 5 Pro (274) is the one with the proven GPU and NPU acceleration path.
Windows and x86 Linux mini-PCs also run the backend (see Deployment). For benchmark scores per board, see the benchmark reference in the user guide.
The full documentation lives in docs/; that index
organizes every page by area. The essentials:
appsettings.json, environment variables.nina-polaris/
├── src/
│ ├── NINA.Polaris/ ← ASP.NET Core app (Kestrel, Minimal API)
│ │ ├── Program.cs ← Host builder, service registration
│ │ ├── Endpoints/ ← REST API (13 endpoint groups)
│ │ ├── WebSocket/ ← Image stream + status broadcast
│ │ ├── Services/ ← Business logic layer
│ │ └── wwwroot/ ← Web UI (HTML, JS, CSS)
│ │
│ ├── NINA.Core.Portable/ ← Shared enums, models, utilities (net10.0)
│ ├── NINA.Image.Portable/ ← Image processing, FITS I/O, statistics (net10.0)
│ └── NINA.INDI/ ← INDI protocol client (net10.0)
│ ├── Protocol/ ← XML parser/writer
│ ├── Client/ ← TCP client, blob receiver, connection manager
│ └── Devices/ ← 9 device type implementations
│
│ ├── NINA.Relay.Protocol/ ← Shared multiplexed frame format (net10.0)
│ └── NINA.Relay.Server/ ← Standalone reverse-tunnel relay (ASP.NET Core)
│
├── tests/
│ └── NINA.Polaris.Test/ ← 294 unit tests (NUnit)
│
├── deploy/ ← Deployment scripts
│ ├── nina-polaris.service ← systemd unit file
│ ├── install.sh ← Linux installer
│ ├── publish-linux-arm64.sh ← RPi build script
│ ├── publish-win-x64.ps1 ← Windows build script
│ └── docker-build.sh ← Multi-arch Docker buildx
│
├── Dockerfile ← Multi-stage, linux/amd64 + arm64
└── docker-compose.yml ← NINA + optional indiserver sidecar
| Layer | Technology | Purpose |
|---|---|---|
| Web server | Kestrel (standalone) | Native .NET, no nginx/IIS needed |
| API | ASP.NET Core Minimal API | Low overhead, AOT-friendly |
| Real-time (images) | WebSocket (binary) | JPEG or LZ4-compressed raw frames, adaptive |
| Real-time (status) | WebSocket (JSON) | Equipment + sequence + guider + AF + meridian flip at 1Hz |
| Frontend framework | Alpine.js v3 | Reactive UI (~15KB, no build step) |
| UI typeface | Inter (SIL OFL 1.1, self-hosted) | Variable woff2 for every weight + italic, ~740 KB total. No external CDN call, the UI looks the same online and offline |
| Charts | Chart.js v4 | Guiding, focus, HFR, temperature, histogram, altitude |
| Sky map | stellarium-web-engine (AGPLv3, sandboxed in /sky/ iframe) | WebGL2 sky viewer with Gaia stars, DSO surveys, constellation art, atmosphere, HiPS Milky Way tiles |
| Image viewer | OpenSeadragon | Full-resolution zoom/pan over last frame |
| Image rendering | WebGL2 shaders | GPU debayer + MTF stretch (CPU fallback) |
| Image encoding | SkiaSharp | Cross-platform JPEG / PNG encoding (incl. STUDIO previews + thumbnails) |
| FITS I/O | Custom FITSWriter | Extended headers per N.I.N.A. manual spec |
| XISF I/O | Custom XISFWriter | PixInsight native, LZ4-compressed, FITSKeyword mirrored |
| TIFF export | Custom TiffWriter | Baseline uncompressed 8-bit / 16-bit grayscale (SkiaSharp doesn't ship TIFF) |
| STUDIO frame index | Microsoft.Data.Sqlite | On-disk metadata cache so 2000-frame sessions list in < 50 ms |
| Astronomy ephemeris | CosineKitty.AstronomyEngine | Planet positions for the Tonight's Best panel (MIT, ~150 KB, no native deps) |
| Sun / moon math | SunCalc (BSD-2, vendored) | Sunset / sunrise / twilight / moon phase for the Weather panel |
| Weather forecast | 7Timer ASTRO (HTTP, no key) | Cloud / seeing / transparency, 3-day window in 3 h slots |
Minimum to build + run from source:
sudo apt install indi-fullFor the complete tooling matrix, Windows + Linux ARM (Raspberry Pi) + Linux x64, required vs optional per feature, firewall rules, hardware sizing, see REQUIREMENTS.md.
git clone https://github.com/DanWBR/nina-polaris.git
cd nina-polaris
dotnet build
dotnet run --project src/NINA.Polaris
Open http://localhost:5000 in your browser.
Polaris can be built and run on macOS for development and UI/API testing. Install the .NET 10 SDK, install the WebAssembly workload, then run from the repository root:
sudo dotnet workload install wasm-tools
dotnet clean
dotnet build src/NINA.Polaris/NINA.Polaris.csproj
For subsequent local rebuilds, use this single command. It assumes the dependencies have already been restored:
dotnet build src/NINA.Polaris/NINA.Polaris.csproj --no-restore -v:minimal && \
dotnet run --project src/NINA.Polaris --no-build
The macOS development configuration in
src/NINA.Polaris/appsettings.Development.json listens on HTTPS at
https://localhost:5001 and HTTP at http://127.0.0.1:5081. The HTTPS
certificate is generated
automatically under the macOS application data directory on first run; accept
the browser warning for this self-signed development certificate.
Before starting Polaris, check whether either development port is already in use:
lsof -nP -iTCP:5001 -sTCP:LISTEN
lsof -nP -iTCP:5081 -sTCP:LISTEN
An existing Polaris process should be stopped before starting another one. If the ports are occupied by another application, choose alternate ports with configuration environment variables. The port settings belong on the run command, not the build command:
Server__Https__Port=5001 Server__Http__Port=5081 \
dotnet run --project src/NINA.Polaris
Then open https://localhost:5001. If using the configured development ports,
start Polaris with dotnet run --project src/NINA.Polaris after the lsof
checks. The macOS host uses a no-op system resource monitor because the .NET
resource-monitoring provider does not support macOS; process and application
functionality remain available for development.
For a macOS production publish, the deployed
src/NINA.Polaris/appsettings.MacOS.json override selects HTTPS 5001 and
HTTP 5081, because macOS may reserve port 5000. HTTP redirects to HTTPS.
Edit that file to choose different macOS ports. appsettings.Development.json
is used only for local development; the general appsettings.json defaults
remain HTTPS 5000 and HTTP 5080 for other platforms.
The web interface's Settings → Power card includes Stop Polaris, which stops only the Polaris process and leaves the host operating system running. After an intentional stop, the browser does not retry connections and tells the user to start Polaris again from the terminal. An unexpected disconnect continues to use automatic reconnect and reports when Polaris may be down.
On Linux and Raspberry Pi deployments, the existing Reboot device and Shut down device controls remain available. They reboot or power off the host through the service manager; use Stop Polaris when only the server process should be stopped. macOS does not expose host reboot or shutdown controls.
dotnet test
The .deb package (built automatically by GitHub Actions on every
tag push) handles user creation, systemd unit, indi-web venv, apt
dependencies, and self-signed HTTPS cert generation. End-user install:
wget https://github.com/DanWBR/NINA.Polaris/releases/latest/download/polaris_arm64.deb
sudo apt install ./polaris_arm64.deb
# 30 seconds later: Polaris running at https://<hostname>.local:5000
The postinst prints the URL, sets up the service, and starts it. Full breakdown in packaging/README.md. Pi- specific end-to-end recipe (hardware checklist, OS flashing, optional SSD mount) in docs/user-guide/raspberry-pi-setup.md.
Manage the service:
sudo systemctl status polaris # Check status
sudo journalctl -u polaris -f # Follow logs
sudo systemctl restart polaris # Restart
For non-Debian distros (Fedora, Arch, etc) or when you prefer no systemd integration:
wget https://github.com/DanWBR/NINA.Polaris/releases/latest/download/polaris-linux-arm64.tar.gz
tar -xzf polaris-linux-arm64.tar.gz
cd polaris-linux-arm64
./NINA.Polaris # foreground; wire your own service unit if needed
Replace linux-arm64 with linux-x64 for Intel/AMD 64-bit Linux.
Download the portable zip from GitHub Releases:
# x64 (most desktops/laptops):
Invoke-WebRequest -Uri "https://github.com/DanWBR/NINA.Polaris/releases/latest/download/polaris-win-x64.zip" -OutFile polaris.zip
Expand-Archive polaris.zip
cd polaris-win-x64
.\NINA.Polaris.exe
# ARM64 (Surface Pro X, some Copilot+ PCs):
Invoke-WebRequest -Uri "https://github.com/DanWBR/NINA.Polaris/releases/latest/download/polaris-win-arm64.zip" -OutFile polaris.zip
Expand-Archive polaris.zip
cd polaris-win-arm64
.\NINA.Polaris.exe
Open https://localhost:5000 (accept the self-signed cert once).
For unattended Windows installs, wire your own service via sc.exe,
NSSM, or a scheduled task. Build-from-source path:
.\deploy\publish-win-x64.ps1
Multi-stage Dockerfile and docker-compose.yml are checked in. Builds for both linux/amd64 and linux/arm64:
# Single host build (uses your platform)
docker compose up -d --build
# Multi-arch build + push to registry
REGISTRY=ghcr.io/yourname ./deploy/docker-build.sh latest
The default compose file runs in network_mode: host so mDNS and INDI LAN
reach work out of the box. Add --profile indi to also start an
indiserver sidecar with the standard simulators (good for testing with no
hardware).
Persistence:
nina-data volume → profiles + trained-flat exposures./images bind-mount → captured FITS outputThe Web UI is built entirely on a documented REST + WebSocket surface, so
everything it does is scriptable. The complete endpoint list, WebSocket stream
payloads, appsettings.json keys, and environment variables are in:
| Metric | Target | Notes |
|---|---|---|
| Memory | < 500 MB | RPi 4 with 2GB RAM |
| Startup | < 5 seconds | RPi 4 |
| Image relay | ~3-10 MB/frame | LZ4 compressed, fits WiFi 5GHz |
| JPEG preview | ~200-400 KB | For mobile/weak clients |
| Frontend bundle | ~580 KB total | Alpine.js + libs, cacheable |
| WASM live-stack bundle | ~12 MB on disk, ~3 MB gzipped | One-time download per browser |
| Status broadcast | 1 Hz | Equipment + sequence state |
Polaris ships with a one-click button to spawn a fake telescope +
camera + focuser + filter wheel. Open Settings → Equipment simulator
→ Launch. The simulated camera renders real stars from the GSC
catalog at whatever RA/Dec the simulated mount is pointing at,
plate solve, auto-focus, live stacking all work end-to-end against
it. Linux/macOS uses INDI simulators (apt install indi-bin);
Windows uses Alpaca Omni Simulator. See
docs/user-guide/simulator-mode.md.
Live stacking can run in your browser via a WebAssembly module
that reuses the same NINA.Image.Portable algorithms the server
runs. On Pi 2 / Pi 3 hosts this is the only way to keep up, the
Pi just orchestrates equipment + relays raw frames, the browser
does StarDetector + alignment + accumulator. Auto-detected on WS
handshake; per-rig override in the LIVE tab toolbar. See
docs/user-guide/client-side-compute.md.
If Polaris Astro Controller saves you an evening of fiddling with rigs and you want to chip in for hosting / a coffee / dark-sky travel:
Donations are entirely optional, the project stays free and open-source either way. Bug reports and PRs are just as welcome (see below).
Contributions are welcome! This project follows the same coding standards as the main N.I.N.A. repository.
src/NINA.Polaris/Endpoints/, each is an extension method on WebApplicationsrc/NINA.Polaris/Services/, registered as singletons in Program.cssrc/NINA.INDI/Devices/src/NINA.Polaris/wwwroot/, no build step requiredtests/NINA.Polaris.Test/ using NUnitWhen the Photometric Color Calibration (PCC) workflow is enabled,
Polaris uses the AAVSO APASS DR10 star catalog under a CC-BY
4.0 license. The catalog is downloaded by scripts/download-apass.py
to wwwroot/catalogs/apass/apass.db (gitignored). If you publish
images calibrated with PCC, please credit:
Henden, A. A., Levine, S., Terrell, D., Welch, D. L., Munari, U., & Kloppenborg, B. K. (2018). "The APASS Data Release 10." VizieR On-line Data Catalog: II/336. https://www.aavso.org/apass
Polaris Astro Controller stands on the shoulders of a large community of astronomy and
open-source projects. Some we derive code from, some we studied as a reference,
and many ship inside the capture and processing stack. The same list is shown
in-app under HELP -> Credits & acknowledgements. Thank you to every author
below. Per-component license details are in ### Third-party licenses,
the licenses/ folder, and the bundled 3rd-party-licenses notice.
Built on
Guiding & gear simulation
Image processing & AI
Plate solving
Equipment, protocols & camera SDKs
Sky data, catalogs & astrometry
In-browser UI
Server & .NET
nina.local discovery.Plus the wider amateur astronomy and free-software communities. If your work is used here and not listed, it is an oversight, not an intent, please let us know.
Polaris Astro Controller as a whole is licensed under the GNU Affero General Public
License v3.0 (AGPL-3.0). See LICENSE.txt and
NOTICE.
Portions are derived from N.I.N.A. - Nighttime Imaging 'N' Astronomy,
Copyright (C) Stefan Berg and the N.I.N.A. contributors, under the Mozilla
Public License 2.0 (licenses/MPL-2.0.txt). Those
files keep their MPL header; per MPL-2.0 section 3.3 they are combined into
this AGPL-3.0 Larger Work and a recipient may use those specific files under
either the MPL-2.0 or the AGPL-3.0.
A limited additional permission (linking exception) covers proprietary camera
vendor SDKs and dynamically-loaded plugins - see
licenses/LINKING-EXCEPTION.txt.
Because Polaris is a network-served application, AGPL-3.0 section 13 applies: if you run a modified version as a service, you must offer its source to users. Releases published before the relicensing remain available under the MPL-2.0.
NINA.Guider.Portable) ports PHD2's core guiding math (single-star
centroid, calibration, Hysteresis + Resist-Switch algorithms,
camera/mount transforms) to C#. Each ported file carries the PHD2
BSD-3 header; the full license text is in
licenses/PHD2-LICENSE.txt. PHD2 is
Copyright (c) the Open PHD Guiding development team and the Max Planck
Society. See https://openphdguiding.org.NINA.Polaris.dll and answers the Observatory location search
offline. See licenses/GEONAMES-LICENSE.txt
and https://www.geonames.org.wwwroot/data/world-50m.json) draw the offline map picker. See
https://www.naturalearthdata.com.NINA.Polaris.Services.OpenCl). Copyright (c) .NET
Foundation and Contributors. See https://github.com/dotnet/Silk.NET.| Compression | K4os.Compression.LZ4 | Fast image compression (~2GB/s) |
| Equipment drivers | INDI protocol (TCP/XML) + Alpaca (HTTP) | 400+ Linux drivers + ASCOM over network |
| Plate solving | ASTAP / PlateSolve3 / Astrometry.net (online + local) | Strategy dispatcher with primary + blind fallback |
| Guiding | PHD2 (TCP/JSON-RPC, port 4400), fully managed | Profile switch, equipment connect, process launch/shutdown |
| Remote access | NINA.Relay.Server reverse tunnel | Public access without inbound port-forwarding |
| Discovery | Makaretu.Dns.Multicast | mDNS announcer for nina.local |
| Geocoding | Nominatim (OpenStreetMap, proxied) | Address → coordinates for location setup |
| Stellarium sync | HTTP (Remote Control plugin, port 8090) | Pull selected object as target |
| Logging | Serilog | Structured logging to console + file |
| Target framework | .NET 10.0 | Latest LTS, cross-platform |