#!/bin/bash # NOTES: # - Variable names must start at the beginning of a line. # - There should be nothing after a variable's value, i.e., no comments on the same line. # - Values can optionally be quoted with double quotes, NOT single quotes. # - If a variable occurs multiple times, only the last value is used. # Choose between "ZWO" or "RPiHQ". Note that "auto" is no longer allowed. CAMERA="ZWO" ########## Images # Set to "true" to upload the current image to your website. IMG_UPLOAD="true" # If UPLOAD_IMG is "true", upload images every IMG_UPLOAD_FREQUENCY frames, e.g., every 5 frames. # 1 uploades every frame. IMG_UPLOAD_FREQUENCY=1 # The websites look in IMG_DIR for the current image. # When using the Allsky website from the "allsky-website" packge, # "current" is an alias for "/home/pi/allsky". # If you use the default IMG_DIR and have the Allsky website, set "imageName" in # /var/www/html/allsky/config.js to: # imageName: "/current/tmp/image.jpg", # This avoids copying the image to the website. # Only change IMG_DIR if you know what you are doing. IMG_DIR="current/tmp" # Resize images before cropping, stretching, and saving. # Adjust IMG_WIDTH and IMG_HEIGHT according to your camera's sensor ratio. IMG_RESIZE="false" IMG_WIDTH=2028 IMG_HEIGHT=1520 # Crop images before stretching and saving. # This is useful to remove some of the black border when using a fisheye lens. # If you crop an image you may need to change the "Text X" and/or "Text Y" settings in the WebUI. CROP_IMAGE="false" CROP_WIDTH=640 CROP_HEIGHT=480 CROP_OFFSET_X=0 CROP_OFFSET_Y=0 # Auto stretch images saved at night. AUTO_STRETCH="false" AUTO_STRETCH_AMOUNT=10 AUTO_STRETCH_MID_POINT="10%" # Resize uploaded images. Change the size to fit your sensor. RESIZE_UPLOADS="false" RESIZE_UPLOADS_SIZE="962x720" # Create thumbnails of images. If you are not running the WebUI consider changing this to "false". IMG_CREATE_THUMBNAILS="true" # Remove corrupt images before generating keograms, startrails, and timelapse videos. # This only adds a few seconds per image as it's being processed. REMOVE_BAD_IMAGES="false" # If REMOVE_BAD_IMAGES is "true", images whose mean brightness is # less than THRESHOLD_LOW or greater than THRESHOLD_HIGH percent (max: 100) will be removed. # Set to 0 to disable the brightness checks. REMOVE_BAD_IMAGES_THRESHOLD_LOW=1 REMOVE_BAD_IMAGES_THRESHOLD_HIGH=90 # Additional Capture parameters. Run "capture_RPiHQ -h" to see the options. # e.g. activate autoexposure algorithm "mean" for RPiHQ: "-mean-value 0.3 -autoexposure 1" CAPTURE_EXTRA_PARAMETERS="" ########## Timelapse # Set to "true" to generate a timelapse video at the end of each night. TIMELAPSE="true" # Set the image width and height for timelapse video (sizes must be divisible by 2). TIMELAPSEWIDTH=0 TIMELAPSEHEIGHT=0 # Bitrate of the timelapse video. Higher numbers will produce higher quality but larger files. TIMELAPSE_BITRATE="2000k" # Timelapse video Frames Per Second. FPS=25 # Encoder for timelapse video. May be changed to use a hardware encoder or different codec. VCODEC="libx264" # FFLOG determines the amount of log information displayed while creating a timelapse video. # Set to "info" to see additional information if you are tuning the algorithm. FFLOG="warning" # While creating a timelapse video, a sequence of links to the images is created. # Set to "true" to keep that sequence; set to "false" to have it deleted when done. KEEP_SEQUENCE="false" # Any additional timelapse parameters. Run "ffmpeg -?" to see the options. TIMELAPSE_EXTRA_PARAMETERS="" # Set to "true" to upload timelapse video to your website at the end of each night. UPLOAD_VIDEO="true" ########## Keogram # Set to "true" to generate a keogram at the end of each night. KEOGRAM="true" # Additional Keogram parameters. Run "keogram --help" to see the options. # Keograms work best if North is at the top of the image. If this is not the case you can # rotate the image; for example, if North is straight down in your image, rotate it 180 degrees. # Rotation is anticlockwise. 0 disables rotation. KEOGRAM_EXTRA_PARAMETERS="--rotate 0 --font-size 1.0 --font-line 1 --font-color '255 255 255'" # Set to "true" to upload the keogram to your website at the end of each night. UPLOAD_KEOGRAM="true" ########## Startrails # Set to "true" to generate a startrails image of each night. STARTRAILS="true" # Images with a brightness higher than this threshold will be skipped for # startrails image generation. Values are 0.0 to 1.0. BRIGHTNESS_THRESHOLD=0.1 # Any additional startrails parameters. Run "startrails --help" to see the options. STARTRAILS_EXTRA_PARAMETERS="" # Set to "true" to upload the startrails image to your website at the end of each night. UPLOAD_STARTRAILS="true" ########## Other # Size of thumbnails. THUMBNAIL_SIZE_X=100 THUMBNAIL_SIZE_Y=75 # Set to "true" to enable automatic deletion of archived data (images + videos). AUTO_DELETE="true" # If AUTO_DELETE="true", set this value to the number of archived nights you want to keep. NIGHTS_TO_KEEP=14 # Set to "true" to upload data to your server at the end of each night. # This is needed if you are running the Allsky Website. POST_END_OF_NIGHT_DATA="true" # Set to "true" if you want to enable dark frame subtraction on your night-time images. # You must first create dark frames - see the README.md file for instructions. DARK_FRAME_SUBTRACTION="true" # Set to "false" to disable daytime capture. DAYTIME_CAPTURE="true" # Night images are always taken and saved to disk. # Setting DAYTIME_SAVE to "true" also saves daytime images to disk. # Will only save daytime images if DAYTIME_CAPTURE="true". DAYTIME_SAVE="true" # The uhubctl command can reset the USB bus if the camera isn't found and you know it's there. # Allsky.sh uses this to try and fix "missing" cameras. # Specify the path to the command and the USB bus number (on a Pi 4, bus 1 is USB 2.0 and # bus 2 is the USB 3.0 ports). If you don't have 'uhubctl' installed set UHUBCTL_PATH="". UHUBCTL_PATH="" UHUBCTL_PORT=2 # Path to the camera settings (exposure, gain, delay, overlay, etc) files. # Do not change unless you know what you are doing. CAMERA_SETTINGS_DIR="/etc/raspap" if [ "${CAMERA}" = "" ]; then echo "${RED}ERROR: Please set CAMERA in config/config.sh${NC}" exit 1 elif [ "${CAMERA}" = "auto" ]; then echo "${RED}ERROR: 'auto' is no longer a valid CAMERA type. Please reset CAMERA in config/config.sh${NC}" exit 1 fi # This is needed in case the user changed the default location the current image is saved to. if [ "${IMG_DIR}" = "current/tmp" ]; then CAPTURE_SAVE_DIR="${ALLSKY_TMP}" else CAPTURE_SAVE_DIR="${IMG_DIR}" fi # !!! The next few lines are for backwards compatibility and will be removed in the future - do not change !!! UPLOAD_IMG="${IMG_UPLOAD}" # UPLOAD_IMG is th eold name for IMG_UPLOAD if [ "${DAYTIME_CAPTURE}" = "true" ]; then DAYTIME=1 # DAYTIME is the old name for DAYTIME_CAPTURE else DAYTIME=0 fi CAPTURE_24HR=${DAYTIME_SAVE} # CAPTURE_24HR is the old name for DAYTIME_SAVE if [[ ${CAMERA} == "auto" ]]; then # Restore currently saved autodiscovered camera type, if any. source "${ALLSKY_CONFIG}/autocam.sh" # May reset ${CAMERA} fi if [[ ${CAMERA} != "auto" ]]; then CAMERA_SETTINGS="${CAMERA_SETTINGS_DIR}/settings_${CAMERA}.json" # So scripts can conditionally ouput messages; DO NOT CHANGE NEXT LINES. ALLSKY_DEBUG_LEVEL=$(jq -r '.debuglevel' "${CAMERA_SETTINGS}") fi ALLSKY_DEBUG_LEVEL=${ALLSKY_DEBUG_LEVEL:-0}