Skip to content

Commit

Permalink
initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinkler committed Aug 4, 2022
1 parent 6ea43d4 commit 9fb1f3a
Show file tree
Hide file tree
Showing 20 changed files with 4,764 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.vscode
__pycache__
config
fits
images
.gitignore
*.sh
Dockerfile
LICENSE
README.md
186 changes: 186 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@

# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# Support for Project snippet scope

# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
.vscode
fits
certs
build_and_push.sh
publish.sh
astrolive/default.cfg.yaml
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.10.0-slim-bullseye

RUN mkdir -p /usr/src/app/astrolive

ADD run.py /usr/src/app
ADD requirements.txt /usr/src/app
ADD astrolive /usr/src/app/astrolive

WORKDIR /usr/src/app

RUN pip3 install --no-cache-dir -r requirements.txt

CMD ["python", "./run.py"]
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ AstroLive uses the nice ALPACA client implementation of the [OCA Box](https://gi
- [My Personal Setup](#my-personal-setup)
- [Usage](#usage)
- [Installation and Configuration of ASCOM Remote Server](#installation-and-configuration-of-ascom-remote-server)
- [Configure AstroLive](#configure-astrolive)
- [Get and Configure AstroLive](#get-and-configure-astrolive)
- [Run](#run)
- [Run with Python](#run-with-python)
- [Build & Run as a container](#build--run-as-a-container)
- [Integrate with Home Assistant](#integrate-with-home-assistant)
- [Devices and Sensors](#devices-and-sensors)
- [Sending Commands](#sending-commands)
Expand Down Expand Up @@ -116,9 +114,19 @@ Links:
- [ASCOM Alpaca Device API](https://ascom-standards.org/api/)
- [Swagger](https://github.com/ASCOMInitiative/ASCOMRemote/blob/master/Swagger/ASCOMInitiative_ASCOMDeviceAPI_1.0.1-oas3_swagger.yaml)

### Configure AstroLive
### Get and Configure AstroLive

Modify the supplied default.cfg.yaml to your needs. The yaml should be pretty self explanatory :-)
Clone AstroLive

```sh
git clone https://github.com/mawinkler/astrolive
```

Now, create a `default.cfg.yaml` based on the supplied `default.cfg.yaml.sample` and modify it to your needs. The yaml should be pretty self explanatory :-)

```sh
cp astrolive/default.cfg.yaml.sample astrolive/default.cfg.yaml
```

> ***Note:*** If you are using drivers provided with the sequencer software, using ASCOM remote in parallel will mess up the imaging session when accessing the camera API. Tested with QHY and N.I.N.A./PHD2. For that reason, I'm always using the `camera_file` component witch checks for the latest FITS-file published within a given directory tree.
Expand Down Expand Up @@ -235,21 +243,25 @@ backyard:
### Run
AstroLive checks recursively within the configured directory for new FITS files. By default it checks within the directory `/fits`.
AstroLive checks recursively within the configured directory for new FITS files if you configured `camera_file`. By default it checks within the directory `/fits`.

If you want to use TLS for the connection to the MQTT broker you need to provide the certificate of the certification authority which signed the MQTT server certificate (defaults to `/certs/ca.crt`).

#### Run with Python
**Run with Python**

Ensure to have the dependencies installed

```sh
pip3 install -r requirements.txt
```

Start AstroLive

```sh
python3 run.py
```

#### Build & Run as a container
**Build & Run as a container**

This is the way :-).

Expand Down
1 change: 1 addition & 0 deletions astrolive/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Communicates with ASCOM Alpaca using REST"""
Loading

0 comments on commit 9fb1f3a

Please sign in to comment.