How thoclabs/nightwatch works
NIGHTWATCH is a locally controlled, voice-operated autonomous observatory. The principal workflow turns spoken requests into telescope actions or spoken answers: voice input is processed by the pipeline and local-first LLM, tool calls are executed through the orchestrator, and results are formatted for speech. Observatory capabilities also cover safety and weather, telescope operation and imaging, observing support, meteor monitoring, and resilience. The README documents these capabilities; sampled source supports several integrations, while unsampled service wiring is not inferred.
Main entry points: orchestrator.py Orchestrator · voice_pipeline.py Voice pipeline · monitor.py Safety monitor · lx200.py Mount control
Components 26
Voice interaction
- Voice pipeline
nightwatch/voice_pipeline.py - Whisper STT
voice/stt/whisper_service.py - Piper TTS
voice/tts/piper_service.py - LLM client
nightwatch/llm_client.py - Voice tools
voice/tools/telescope_tools.py
Command and safety
- Orchestrator
nightwatch/orchestrator.py - Tool executor
nightwatch/tool_executor.py - Safety monitor
services/safety_monitor/monitor.py - Safety interlock
nightwatch/safety_interlock.py - Weather monitoring
services/weather/unified.py - Roof controller
services/enclosure/roof_controller.py
Observatory devices
- Mount control
services/mount_control/lx200.py - Camera and analysis
services/camera/frame_analyzer.py - Focuser
services/focus/focuser_service.py - PHD2 guiding
services/guiding/phd2_client.py
Observing support
- Ephemeris
services/ephemeris/skyfield_service.py - Target catalog
services/catalog/catalog.py - Observing scheduler
services/scheduling/scheduler.py - Meteor monitoring
services/meteor_tracking/meteor_service.py
Operations and alerts
- Alerts
services/alerts/alert_manager.py - Power manager
services/power/power_manager.py
Other components
- Observer
- OnStepX controller
firmware/onstepx_config/Config.h - PHD2 service
- Audio device
- Weather hardware
Connections 29
- Observer → Voice pipeline: speaks to
- Voice pipeline → Whisper STT: transcribes with
- Voice pipeline → LLM client: submits request
- LLM client → Voice pipeline: returns tool calls
- Voice pipeline → Tool executor: executes calls
- Tool executor → Orchestrator: dispatches commands
- Orchestrator → Safety monitor: checks safety
- Safety monitor → Weather monitoring: reads conditions
- Orchestrator → Mount control: controls mount
- Mount control → OnStepX controller: controls
- Orchestrator → Roof controller: controls enclosure
- Roof controller → Weather monitoring: checks conditions
- Roof controller → Mount control: checks park state
- Orchestrator → Camera and analysis: requests imaging
- Orchestrator → Focuser: controls focus
- Focuser → Camera and analysis: measures focus
- Orchestrator → PHD2 guiding: controls guiding
- PHD2 guiding → PHD2 service: uses socket service
- Orchestrator → Observing scheduler: requests schedule
- Observing scheduler → Target catalog: uses targets
- Observing scheduler → Ephemeris: uses sky data
- Orchestrator → Meteor monitoring: manages watches
- Meteor monitoring → Alerts: sends notifications
- Safety monitor → Safety interlock: applies safeguards
- Safety monitor → Alerts: raises alerts
- Power manager → Mount control: supports safe shutdown
- Weather hardware → Weather monitoring: provides readings
- Voice pipeline → Piper TTS: synthesizes response
- Piper TTS → Audio device: plays audio