diff --git a/README.md b/README.md index aae53af67..5510db5e6 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ git clone https://github.com/aaronwmorris/indi-allsky.git ``` 1. Navigate to the indi-allky sub-directory ``` -cd indi-allsky.git +cd indi-allsky/ ``` 1. Run setup.sh to install the relevant software ``` @@ -76,7 +76,7 @@ systemctl --user start indiserver systemctl --user start indi-allsky ``` 1. Login to the indi-allsky web application -https://raspberrypi/ +https://raspberrypi.local/ * Note: The web server is configured with a self-signed certificate. ### Manual operation @@ -243,8 +243,8 @@ All configuration is read from /etc/indi-allsky/config.json . You can find conf | IMAGE_FOLDER | | (string) Base folder to save images | | IMAGE_DEBAYER | Auto detected | (string) OpenCV debayering algorithm | | IMAGE_GRAYSCALE | false | Convert image to grayscale | -| IMAGE_FLIP_V | false | (bool) Flip images vertically | -| IMAGE_FLIP_H | false | (bool) Flip images horizontally | +| IMAGE_FLIP_V | true | (bool) Flip images vertically | +| IMAGE_FLIP_H | true | (bool) Flip images horizontally | | IMAGE_SCALE | 100 | (percent) Image scaling factor | | IMAGE_CROP_ROI | [] | (array) Region of interest to crop image (x1, y1, x2, y2) | | IMAGE_SAVE_RAW | false | (bool) Save raw image file | diff --git a/config.json_template b/config.json_template index 5c72db9d7..4cb25da8d 100644 --- a/config.json_template +++ b/config.json_template @@ -70,8 +70,8 @@ "comment_IMAGE_DIR" : "local base folder for images, empty for current dir", "IMAGE_FOLDER" : "/var/www/html/allsky/images", "IMAGE_CROP_ROI" : [], - "IMAGE_FLIP_V" : false, - "IMAGE_FLIP_H" : false, + "IMAGE_FLIP_V" : true, + "IMAGE_FLIP_H" : true, "IMAGE_SCALE" : 100, "IMAGE_SAVE_RAW" : false, "IMAGE_GRAYSCALE" : false, diff --git a/indi_allsky/flask/forms.py b/indi_allsky/flask/forms.py index 6623413c3..edb265233 100644 --- a/indi_allsky/flask/forms.py +++ b/indi_allsky/flask/forms.py @@ -319,6 +319,9 @@ def FFMPEG_BITRATE_validator(form, field): def TEXT_PROPERTIES__FONT_FACE_validator(form, field): + if not field.data: + return + fonts = ( 'FONT_HERSHEY_SIMPLEX', 'FONT_HERSHEY_PLAIN', @@ -508,6 +511,7 @@ class IndiAllskyConfigForm(FlaskForm): ('FONT_HERSHEY_COMPLEX_SMALL', 'Serif (small)'), ('FONT_HERSHEY_SCRIPT_SIMPLEX', 'Script'), ('FONT_HERSHEY_SCRIPT_COMPLEX', 'Script (complex)'), + ('', 'Disabled'), ) FILETRANSFER__CLASSNAME_choices = ( @@ -577,7 +581,7 @@ class IndiAllskyConfigForm(FlaskForm): IMAGE_EXPIRE_DAYS = IntegerField('Image expiration (days)', validators=[DataRequired(), IMAGE_EXPIRE_DAYS_validator]) FFMPEG_FRAMERATE = IntegerField('FFMPEG Framerate', validators=[DataRequired(), FFMPEG_FRAMERATE_validator]) FFMPEG_BITRATE = StringField('FFMPEG Bitrate', validators=[DataRequired(), FFMPEG_BITRATE_validator]) - TEXT_PROPERTIES__FONT_FACE = SelectField('Font', choices=TEXT_PROPERTIES__FONT_FACE_choices, validators=[DataRequired(), TEXT_PROPERTIES__FONT_FACE_validator]) + TEXT_PROPERTIES__FONT_FACE = SelectField('Font', choices=TEXT_PROPERTIES__FONT_FACE_choices, validators=[TEXT_PROPERTIES__FONT_FACE_validator]) TEXT_PROPERTIES__FONT_HEIGHT = IntegerField('Font Height Offset', validators=[DataRequired(), TEXT_PROPERTIES__FONT_HEIGHT_validator]) TEXT_PROPERTIES__FONT_X = IntegerField('Font X Offset', validators=[DataRequired(), TEXT_PROPERTIES__FONT_X_validator]) TEXT_PROPERTIES__FONT_Y = IntegerField('Font Y Offset', validators=[DataRequired(), TEXT_PROPERTIES__FONT_Y_validator]) diff --git a/indi_allsky/flask/templates/config.html b/indi_allsky/flask/templates/config.html index 4d7fbb048..e3c16fa6a 100644 --- a/indi_allsky/flask/templates/config.html +++ b/indi_allsky/flask/templates/config.html @@ -475,7 +475,7 @@ {{ form_config.IMAGE_FILE_COMPRESSION__JPG(class='form-control bg-secondary') }} -
Compression factor for JPEG images
+
[1-100] Compression factor for JPEG images. Higher numbers increase quality and file sizes. Default: 90
@@ -486,14 +486,14 @@ {{ form_config.IMAGE_FILE_COMPRESSION__PNG(class='form-control bg-secondary') }}
-
Compression factor for PNG images
+
[1-9] Compression factor for PNG images. Higher numbers increase quality and file sizes. Default: 9
{{ form_config.IMAGE_FOLDER.label(class='col-form-label') }}
-
+
{{ form_config.IMAGE_FOLDER(class='form-control bg-secondary') }}
diff --git a/indi_allsky/flask/views.py b/indi_allsky/flask/views.py index bf9653f09..56af200b0 100644 --- a/indi_allsky/flask/views.py +++ b/indi_allsky/flask/views.py @@ -603,8 +603,8 @@ def get_context(self): 'IMAGE_FILE_COMPRESSION__JPG' : indi_allsky_config.get('IMAGE_FILE_COMPRESSION', {}).get('jpg', 90), 'IMAGE_FILE_COMPRESSION__PNG' : indi_allsky_config.get('IMAGE_FILE_COMPRESSION', {}).get('png', 9), 'IMAGE_FOLDER' : indi_allsky_config.get('IMAGE_FOLDER', '/var/www/html/allsky/images'), - 'IMAGE_FLIP_V' : indi_allsky_config.get('IMAGE_FLIP_V', False), - 'IMAGE_FLIP_H' : indi_allsky_config.get('IMAGE_FLIP_H', False), + 'IMAGE_FLIP_V' : indi_allsky_config.get('IMAGE_FLIP_V', True), + 'IMAGE_FLIP_H' : indi_allsky_config.get('IMAGE_FLIP_H', True), 'IMAGE_SCALE' : indi_allsky_config.get('IMAGE_SCALE', 100), 'IMAGE_SAVE_RAW' : indi_allsky_config.get('IMAGE_SAVE_RAW', False), 'IMAGE_GRAYSCALE' : indi_allsky_config.get('IMAGE_GRAYSCALE', False), diff --git a/indi_allsky/image.py b/indi_allsky/image.py index 696c3c83b..a636a6729 100644 --- a/indi_allsky/image.py +++ b/indi_allsky/image.py @@ -584,6 +584,10 @@ def debayer(self, scidata): def image_text(self, data_bytes, exposure, exp_date, exp_elapsed): + if not self.config['TEXT_PROPERTIES'].get('FONT_FACE'): + logger.warning('Image labels disabled') + return + image_height, image_width = data_bytes.shape[:2] utcnow = datetime.utcnow() # ephem expects UTC dates diff --git a/indi_allsky/keogram.py b/indi_allsky/keogram.py index f5eff5705..405af28f5 100644 --- a/indi_allsky/keogram.py +++ b/indi_allsky/keogram.py @@ -137,8 +137,7 @@ def finalize(self, outfile): keogram_resized = cv2.resize(keogram_trimmed, (new_width, new_height), interpolation=cv2.INTER_AREA) # apply time labels - if self.config.get('KEOGRAM_LABEL'): - self.applyLabels(keogram_resized) + self.applyLabels(keogram_resized) logger.warning('Creating keogram: %s', outfile) cv2.imwrite(str(outfile), keogram_resized, [cv2.IMWRITE_JPEG_QUALITY, self.config['IMAGE_FILE_COMPRESSION'][self.config['IMAGE_FILE_TYPE']]]) @@ -223,6 +222,14 @@ def trimEdges(self, image): def applyLabels(self, keogram): + if not self.config.get('KEOGRAM_LABEL'): + logger.warning('Keogram labels disabled') + return + + if not self.config['TEXT_PROPERTIES'].get('FONT_FACE'): + logger.warning('Image labels disabled') + return + height, width = keogram.shape[:2] # starting point diff --git a/indi_allsky/wsgi.py b/indi_allsky/wsgi.py index 24b683bf9..51fb7029c 100644 --- a/indi_allsky/wsgi.py +++ b/indi_allsky/wsgi.py @@ -3,7 +3,7 @@ # This file is monitored for changes via inotify # Updates should restart gunicorn automatically # -# Version 00003 +# Version 00004 # import logging diff --git a/requirements_alpha.txt b/requirements_alpha.txt index 83ffd460e..0b4d1dd30 100644 --- a/requirements_alpha.txt +++ b/requirements_alpha.txt @@ -1,5 +1,6 @@ # This file is targeted to Raspbian/Debian 10 and Python 3.7 -pyindi-client +#pyindi-client +git+https://github.com/indilib/pyindi-client.git@d5dbe80#egg=pyindi-client astropy #https://www.piwheels.org/project/numpy/ numpy==1.21.4 diff --git a/requirements_bravo.txt b/requirements_bravo.txt index ed0f28f71..88dc3b481 100644 --- a/requirements_bravo.txt +++ b/requirements_bravo.txt @@ -1,7 +1,6 @@ # This file is targeted to Raspbian/Debian 11 and Python 3.9 #pyindi-client -# temporarily use my fork for Raspbian 11 -git+https://github.com/aaronwmorris/pyindi-client.git#egg=pyindi-client +git+https://github.com/indilib/pyindi-client.git@d5dbe80#egg=pyindi-client astropy #https://www.piwheels.org/project/numpy/ numpy==1.22.2 diff --git a/setup.sh b/setup.sh index bb632d4c3..43c339000 100755 --- a/setup.sh +++ b/setup.sh @@ -168,6 +168,7 @@ if [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "11" ]]; then python3-pip \ virtualenv \ git \ + avahi-daemon \ apache2 \ libapache2-mod-php \ php-sqlite3 \ @@ -228,6 +229,7 @@ elif [[ "$DISTRO_NAME" == "Raspbian" && "$DISTRO_RELEASE" == "10" ]]; then python3-pip \ virtualenv \ git \ + avahi-daemon \ apache2 \ libapache2-mod-php \ php-sqlite3 \ @@ -299,6 +301,7 @@ elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "11" ]]; then python3-pip \ virtualenv \ git \ + avahi-daemon \ apache2 \ libapache2-mod-php \ php-sqlite3 \ @@ -352,6 +355,7 @@ elif [[ "$DISTRO_NAME" == "Debian" && "$DISTRO_RELEASE" == "10" ]]; then python3-pip \ virtualenv \ git \ + avahi-daemon \ apache2 \ libapache2-mod-php \ php-sqlite3 \ @@ -407,6 +411,7 @@ elif [[ "$DISTRO_NAME" == "Ubuntu" && "$DISTRO_RELEASE" == "20.04" ]]; then python3-pip \ virtualenv \ git \ + avahi-daemon \ apache2 \ libapache2-mod-php \ php-sqlite3 \ @@ -463,6 +468,7 @@ elif [[ "$DISTRO_NAME" == "Ubuntu" && "$DISTRO_RELEASE" == "18.04" ]]; then python3-pip \ virtualenv \ git \ + avahi-daemon \ apache2 \ libapache2-mod-php \ php-sqlite3 \ @@ -902,9 +908,9 @@ echo " (You may have to manually access by IP)" echo if [[ "$ASTROBERRY" == "true" ]]; then - echo " https://$(hostname -s):444/" + echo " https://$(hostname -s).local:444/" else - echo " https://$(hostname -s)/" + echo " https://$(hostname -s).local/" fi echo