Skip to content

Commit

Permalink
Version 2023.05.01_01 (#2797)
Browse files Browse the repository at this point in the history
* Improved log messages in install.sh

Improve many of the log messages to make troubleshooting easier.

* Update install.sh: shellcheck fix

* Update install.sh: real shellcheck fix

* Fix install.sh bug when updating settings file

Using "mv" to replace a file removes any hard links it has, so use "cp" instead.

* Changes as requested on #2717

* Correct scl/sda on dew heater circuit #2728

* install.sh: fix bug #2 with unlink of settings files

* README.md: mention Ubuntu and fix links

* Delete WebUI.png - not needed

Using an image of the WebUI in documentation folder.

* capture_ZWO.cpp: initial changes for experimental mode

* Remove "#ifdef HISTOGRAM" - it's always used and will be replaced.
* Do more error checking.
* Add "experimental" exposure mode that uses our auto-exposure algorithm at night.  This works well in limited testing but needs more testing.
* Add "useSnapshotMode" for a future addition that uses ZWO's snapshot mode instead of video mode to take a picture.
* Modify many Log() message for better troubleshooting.
* Change indenting in several places to make code easier to read.
* When ping-ponging, add a percent of the number of ping pongs (basically, a unique amount) to the exposure time.  Not sure it helps, but try anyhow.

* Update allsky_common.h: add useExpirementalExposure

* Update allsky_common.h: fix spelling of Experimental

* Update allsky_common.cpp: add experimentalExposure

* Update capture_ZWO.cpp: use global variable

* Update options.json.repo: add experimentalExposure

* Update ASI_functions.cpp: add experimentalExposure

* Update ASI_functions.cpp: fix bug: %s vs %d

* Update allsky_common.cpp: add useExperimentalExposure

* Update capture_ZWO.cpp: fix name misspelling

* Update allsky_common.cpp: display day/night mean settings for ZWO

Also, move some lines to match the order in the WebUI

* Update ASI_functions.cpp: Allow ModeMean and MeanThreshold for ZWO

* Update allsky_common.cpp: align output

* Update allsky_common.cpp: fix: arguments need to be lowercase

* Update capture_ZWO.cpp: no need to check if histogram is NULL

It's now always the array of ints.

* Update capture_ZWO.cpp: move histogram definition to where it's needed

Also no need for "else" after "continue"

* Update capture_RPi.cpp

No need for "else" after "continue"

* Update options.json.repo: default mean targets should be based on camera

* Update allsky.html: remove "RPi only" for Target Mean

Also mention default gains.

* Update functions.sh: bug fix: don't assume SETTINGS_FILE

* Update allsky_common.h: change ZWO mean defaults to decimal

This matches RPi.

* Update allsky_common.cpp: minor wording change

* Update allsky_common.h: set day target mean values to old values

* Update ASI_functions.cpp: see description

* Split "mean" into "daymean" and "nightmean" since their settings are different.
* "Exposure" output to CC file needs to be in ms to match the WebUI.
* Add day/night entries whose defaults are different.

* Update capture_ZWO.cpp: multiply min/max mean by 255

The WebUI uses 0.0 to 1.0 (just like with RPi), but our current ZWO auto-exposure algorithm uses 0 to 255.

* Update createAllskyOptions.php: major updates

* [a-z]_min/_max/_default/_display no longer have [a-z].  This makes it less error prone when adding settings.  These fields' values are obtained from the fields' CC file entries (if present).
* Values for "day_" and "night_" field values get their values from the setting name's entry in the CC file.  For example, "dayexposure" and "nightexposure" have different defaults: "day_default" and "night_default", whereas their min and max values are the same.

* Update options.json.repo: see description

The "[a-z]_min/_max/_default/_display" values no longer have the "[a-z]" which makes it easier and less error prone when adding settings.
When _min/_max/_default/_display are used with a setting whose name begins with "day" or "night", the day and night values are the same in the CC file.

* Update Makefile: bug fix: "sunwait" needs to depend on "patchsunwait"

* Update allsky.html: "Mean Threshold" is also available on ZWO

* Update changeLog.html: add 3 new ZWO settings

* src/Makefile: temporarily break dependency on patchsunwait

It causes the make to fail.

* allsky_common.cpp: remove unnecessary checks

If the target mean is 0.0, the min/max would also result in 0.0, so don't need the checks.

* Update allsky_common.h: update values

* Update allsky_common.cpp: always display target means

* Update allsky_common.cpp: minor wording change

* Update allsky_common.cpp: don't multiple nightExposure by 1000

* Update ASI_functions.cpp: Set default brightness

* Update capture_ZWO.cpp: set defaults, then grab arguments.

* Remove sunwait patch #2738

* Remove sunwait patch #2738

* Update allskySettings.php

* Update options.json.repo: use "integer", "float", and "boolean"

* Update options.json.repo: put space after ":" for consistency

* Update allskySettings.php: handle "boolean" and "percent"

Change "checkbox" which is an html term, with "boolean" which indicates the type of data.

* Update index.php: don't pass WLAN interface name

* Update dashboard_WLAN.php: add function to display a single interface

Determine all the interfaces, then loop through them displaying each one's information.

* Update changeLog.html: add multiple Wi-Fi interfaces supported.

* functions.php fix: don't assume $result[1] exists

Also, add the interface name to status messages in case there are multiple interfaces.

* index.php: Display messages from functions if needed

If initialize_variables() or another global function called by index.php sets an error message, display it.

* Update functions.php: check if numbers used in math are numeric

Without this check, if a user entered a non-numeric value, the math with fail.

* status_messages.php: add $highlight argument

If a caller wants to highlight the table of messages it can set the new $highlight argument which puts a border around the table and add a line at the top and bottom.

* Update index.php: display messages if needed

If an error was generated by a function that's not for a particular page, display the message(s) in "highlight" mode.

* Update allskySettings.php: validate numbers

* Check for legal numbers.
* Reset $key rather than use $originalName to make it more obvious what's happening.
* Display message more efficiently.

* Update functions.php: set daydelay to -1 instead of delay

bug fix

* Update changeLog.html: mention validating numbers

* Update allskySettings.php: state if fractions are allowed or not

* Update custom.css: make alert-danger class more obvious

* Update install.sh: misc changes

* Use new function update_json_file()
* Quote {} as a best practice
* Change mode and group of thumbnails directories.

* Update functions.sh: add update_json_file()

* Automatically fix broken settings links

* Update options.json.repo

* Update allsky_common.cpp

* Update capture_ZWO.cpp

* Update allsky.html: add New Exposure Algorithm

* Update options.json.repo: rename option

* Update allsky_common.cpp: rename option

* Update installUpgradeFunctions.sh: only save 1st line of branch

* Update install.sh: check for multiple branches in .git/config file

* Update variables.sh: add ALLSKY_ABORTEDSAVEIMAGE

* Update functions.sh: add one_instance()

* Update upload.sh: use one_instance() instead of our own code

* Update upload.sh: remove unused variable

* Update timelapse.sh: use one_instance() instead of our own code

* Update functions.sh: use "ps -fp"

So we get the command-line arguments as well.

* Update saveImage.sh: use one_instance()

* check_settings_link(): use settings()

Also, use the full file name in error output.

* install.sh: get convert_settings() working, plus more

* Get convert_settings() working for v2022.03.01.
* Fix broken prior settings file links.

* Rename PRIOR_ALLSKY values to "newStyle" and "oldStyle".
* Get the prior camera type from the prior settings file if it's a "newStyle" file.
* Several indentation changes to make things easier to read.
* Display settings file list in a couple other places for debugging.

* determineCommandToUse(): send errors to stderr

So they appear in the log file.

* SSL clarifications

* saveImage.sh: bug fix: remove aborted image

* functions.sh: run raspistill to check if it works

* Update variables.sh: rename 3 ABORTED... variables

* Update variables.sh: put aborted files in same directory

* Update allsky.sh: use new directory for aborted info

* Update saveImage.sh: new arguments to one_instance() and timelapse.sh

* Use new "--caused-by" argument to one_instance().
* Specify the time to wait for one_instance() so it doesn't wait too long.
* Set AS_TEMPERATURE_C if not already set and there's a temperature.txt file.
* Only call darkCapture.sh if needed.
* Use new arguments to timelapse.sh.

* Update functions.sh: argument changes

* Accept new "--caused-by" argument.
* Don't bother checking that the process in the PID_FILE is the specified one.  --process-name is no longer needed.
* Use new $ALLSKY_ABORTS_DIR.

* Update saveImage.sh: don't use --process-name

* Update upload.sh: argument changes to one_instance()

* Update saveImage.sh: shellcheck fix

* Update darkCapture.sh: changes due to changes in saveImage.sh

* We're only called if taking dark frames, so no need to check.  This changed indentation.
* saveImage.sh updates AS_TEMPERATURE_C as needed so we don't need to.

* Update timelapse.sh: new arguments

* Accept new --lock, --output, and --images argument.
* Updated usage message.
* Updated usage checks.
* Only check for valid DATE and DATE_DIR is needed.

* Update timelapse.sh: new arguments

* Accept new --lock, --output, and --images argument.
* Updated usage message.
* Updated usage checks.
* Only check for valid DATE and DATE_DIR is needed.

* Update timelapse.sh: Fix/improve determination of input and output directories.

Also, make sure the PID_FILE is removed.

* Update timelapse.sh: redo main loop

The prior way of creating the SEQUENCE_DIR files was to use gawk and a couple sub-shells.  The new way which is simpler (and hopefully faster) uses a "while read" loop.

* Update generateForDay.sh: make_thumbnail() and others

* Pass output timelapse file name to timelapse.sh.
* Use global make_thumbnail() instead of our own version.
* Show preferred "--" arguments instead of "-".
* Change some indentation to make code easier to read.

* Update timelapse.sh: shellcheck fix

* Update endOfNight.sh: use preferred "--" arguments

* Update functions.sh: add make_thumbnail()

* Update saveImage.sh: use make_thumbnail()

* Update install.sh: call check_new_exposure_algorithm()

* install.sh: Support restarting where left off

* Add STATUS_* variables to hold installation status in case we need to restart, e.g., after exiting to change locale.
* Used "local" for local variables so it's more obvious what's global.

* Update save_file.php: Add "config" check

* Update install.sh: Add get_connected_cameras()

* Add get_connected_cameras() and call early on to see if there are any connected cameras.
* Add more STATUS_* messages.

* Update install.sh: better way to update STATUS_VARIABLES

* Update install.sh: shellcheck fix

* Update install.sh

* Update install.sh: rename LOCALE to DESIRED_LOCALE

This better reflects its purpose.

* Update install.sh: minor wording changes.

* timelapse.sh: check for missing or 0-length files.

* Update install.sh: use "git rev-parse --abbrev-ref HEAD" to determine branch

It's faster and handles multiple branches.

* Update install.sh: add extra "MORE_STATUS" argument to exit_installation

* Update install.sh: Add more status lines.

* Save status for every Python dependency installed.
* Don't prompt for locale if the prior Allsky had a valid locale.
* Rename "get_locale()" to "get_desired_local()" since that's it's primary function.

* Update install.sh: skip already performed Python dependency installations

* Update install.sh: hopefully last set of changes for restarting installation

* Update functions.php: check for "" lastChanged

* Update allsky.sh: check for unconfigured settings

* Update install.sh: Reset lastChanged to force users to look at configuration

* Update install.sh: convert a few more old settings to new

* Delete flow-runner.py - accidently added to root

The correct one is in "scripts".

* Update functions.sh: improve jq-related commands

* Check for missing "." as first character.
* Add update value to error message.

* Update install.sh: fix the "sed" line to break .json file into field and value

* Makefile: handle change to uname -m for VMs

See comments in Makefile.

* Update changeLog.html: mention bug fix

* Update install.sh: use $CAMERA instead of $CAMERA_TYPE

* functions.sh: Don't do "ls -l" of FILE

Often the jq fails because FILE doesn't exist, and jq outputs that error so there's no need to do "ls" of the file since it will also fail.

* Update functions.sh: better error messages and return codes

If we can't find or read the file, return with EXIT_ERROR_STOP since that's a fatal problem.

* Update install.sh: 2 bug fixes

* Fix misspelled "STATUS_FILE_TEMP"
* Use PRIOR_SETTINGS_FILE instead of SETTINGS_FILE

* Update install.sh: Save status on interrupt

* Also fix bug saving STATUS_CODE (was called STATUS).

* Update variables.sh: add ALLSKY_UPTIME_SINCE

* Update functions.sh: add check_for_reboot

Returns 0 is use doesn't need to reboot, otherwise 1.

* Update functions.sh: reverse return code

* Update allsky.sh: check if a reboot is needed

* Update installUpgradeFunctions.sh: add get_allsky_branch

It uses a git command to get the branch instead of a file we maintain.

* Update installUpgradeFunctions.sh: shellcheck fix

* Update functions.sh: list invalid field

* Update check_allsky.sh: check for reboot and config

* Also check for errors from settings()

* Update install.sh: indicate when reboot needed.

* Update install.sh: shellcheck fix

* Update functions.php: set lastChanged to "" if not there or blank

* Update allskySettings.php: check for $lastChanged === ""

* Update allsky.sh: fix doExit arguments

* Update functions.sh: output reason for stop

* Update functions.sh: fix variable name

* Update allsky.sh: add system messages

* settings() bug fix

json arrays, e.g., "keys[]" can NOT start with a period, but other fields must.

* removeBadImages.sh: shorten message so it fits in image

The "X consecutive..." message doesn't quite fit in the screen so remove a newline.

* Update variables.sh

* Update install.sh

* Update functions.sh

* Update upgrade.sh

* Update variables.sh: delete ALLSKY_BRANCH_FILE

* Update installUpgradeFunctions.sh: see description

* Remove get_branch() since it used ALLSKY_BRANCH_FILE which is no longer used.
* Rename get_allsky_branch() to get_branch().

* Update install.sh: don't append "/" to PRIOR_WEBSITE

It's no longer needed.

* Update install.sh: use get_branch() instead of get_allsky_branch()

And don't append "/" to directory name

* Update upgrade.sh: use get_branch(), not get_allsky_branch()

* Update check_allsky.sh: use get_branch(), not get_allsky_branch()

* Update check_allsky.sh: shellcheck fix

* Update install.sh

* Update install.sh: improve look of "Restoring prior:" output

* Update allsky_common.h: add variables for next version

* Update allsky_common.h: change night values

* Update mode_mean.h: change two comments

* Update allsky_common.cpp: improve Log() messages

* Update allsky_common.cpp: replace spaces with tab

* Update options.json.repo: "Brightness" is deprecated

* Update ASI_functions.cpp: improve Log() messages

Plus add dayThreshold and nightThreshold for future use

* Update capture_RPi.cpp: better Log() messages

* Update capture_ZWO.cpp: better Log() messages

Also:
* Rename "acceptable" to "acceptableMean" to better reflect what it is.
* Improve indentation to make code easier to read.

* Update allsky_common.h

* Rename and move "meanValue"

* Update capture_RPi.cpp

* Update capture_ZWO.cpp

* Update mode_mean.h: remove meanValue

* Update mode_mean.h: remove mean_threshold

* Update capture_RPi.cpp: remove myModeMeanSetting.mean_threshold

* Update mode_mean.cpp: rename mean_threshold to currentMean_threshold

* Update mode_mean.h: remove mean_p[012]

* Update mode_mean.cpp: use cg->myModeMeanSetting instead of currentModeMeanSetting

* Update capture_RPi.cpp: deleted unneeded lines

* Update allsky.html: Brightness has been deprecated

* install.sh: add a couple log entries

Also, increase the size of a whiptail box so the question is visible.

* Update install.sh: use convert_json_to_tabs

* Update functions.sh: add convert_json_to_tabs()

* Update allsky.sh: use convert_json_to_tabs

This also allows us to replace the "for KEY in" with a grep/sed.

* check_allsky.sh: remove duplicate checks

---------

Co-authored-by: Eric Claeys <[email protected]>
Co-authored-by: Alex Greenland <[email protected]>
Co-authored-by: Alex <[email protected]>
  • Loading branch information
4 people authored Jun 15, 2023
1 parent 1b52fee commit fbae714
Show file tree
Hide file tree
Showing 72 changed files with 5,883 additions and 3,688 deletions.
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# Allsky Camera ![Release](https://img.shields.io/badge/Version-v2023.05.01-green.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MEBU2KN75G2NG&source=url)
# Allsky Camera ![Release](https://img.shields.io/badge/Version-v2023.05.01_01-green.svg) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MEBU2KN75G2NG&source=url)

This is the source code for the Allsky Camera project described [on Instructables](http://www.instructables.com/id/Wireless-All-Sky-Camera/).
&nbsp;
<p align="center">
<img src="https://github.com/thomasjacquin/allsky/blob/master/assets/allsky_camera.png" width="50%" title="Example of an allsky camera">
</p>

> **This README and the [Allsky documentation](https://github.com/thomasjacquin/allsky/wiki) will help get your allsky camera up and running.**
> **This README and the [Allsky documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/index.html) will help get your allsky camera up and running.**
&nbsp;

<!-- =============================================================================== -->
## Requirements

You will need the following hardware:
You will need the following:

* A camera (Raspberry Pi HQ, Module 3 or compatible, or ZWO ASI)
* A Raspberry Pi (2, 3, 4 or Zero 2 W).
* A Raspberry Pi (Zero 2, 2, 3, 4) running Pi OS.
* A camera (Raspberry Pi HQ, Module 3, or RPi compatible, or ZWO ASI)


&nbsp;
> **NOTES:**
> - The ZWO ASI120-series cameras are not recommended due to somewhat poor quality. See the [Troubleshooting --> ZWO Cameras](https://github.com/thomasjacquin/allsky/wiki) documentation for notes on the ASI120-series and related T7 / T7C cameras.
> - The Pi Zero and Pi Zero W, with their limited memory and _very_ limited CPU power (single CPU core), are not recommended. You will likely not be able to create keograms, startrails, or timelapse videos.
> - The Pi Zero 2 and Pi Zero 2 W, with their limited memory and somewhat limited CPU power, are not recommended unless cost is a major concern. Creating keograms, startrails, and timelapse videos may or may not be possible.
> - We have not found any "Pi-compatible" boards that are actually compatible, so buyer beware.
> - Only the Raspberry Pi OS is supported. Other operating systems like Ubuntu are NOT supported.
> - The ZWO ASI120-series cameras are not recommended due to somewhat poor quality. See [Troubleshooting --> ZWO Cameras](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/troubleshooting/ZWOCameras.html) for notes on the ASI120-series and related T7 / T7C cameras.
> - The Pi Zero with its limited memory and _very_ limited CPU power (single CPU core), is not recommended. You will likely not be able to create keograms, startrails, or timelapse videos.
> - The Pi Zero 2 with its limited memory and somewhat limited CPU power, is not recommended unless cost is the only concern. Creating keograms, startrails, and timelapse videos may or may not be possible.
> - The Le Potato is the only "Pi-compatible" board that we've found to actually be compatible, so buyer beware.
---


Expand All @@ -35,7 +36,7 @@ You will need the following hardware:
PatriotAstro created a great [video](https://www.youtube.com/watch?v=7TGpGz5SeVI) describing the installation steps below.
**We highly suggest viewing it before installing the software.**

Detailed installation instructions can be found in the [Installing / Upgrading --> Allsky](https://github.com/thomasjacquin/allsky/wiki) documentation.
Detailed installation instructions can be found at [Installing / Upgrading --> Allsky](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/installations/Allsky.html).

---

Expand All @@ -45,7 +46,7 @@ Detailed installation instructions can be found in the [Installing / Upgrading -
## Web User Interface (WebUI)

<p align="center">
<img src="https://github.com/thomasjacquin/allsky/blob/master/assets/WebUI.png" style="border: 1px solid black">
<img src="https://github.com/thomasjacquin/allsky/blob/master/html/documentation/settings/AllskySettingsPage.png" style="border: 1px solid black">
</p>

The WebUI is now installed as part of Allsky and is used to administer Allsky, and to a lesser extent, your Pi. It can also be used to view the current image as well as all saved images, keograms, startrails, and timelapse videos.
Expand All @@ -67,7 +68,7 @@ If it is behind a firewall consult the documentation for your network equipment

By installling the optional Allsky Website you can display your files on a website on the Pi, on another machine, or on both.

See the [Installation / Upgrading --> Website](https://github.com/thomasjacquin/allsky/wiki) documentation for information on how to install and configure an Allsky Website.
See [Installation / Upgrading --> Website](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/installations/AllskyWebsite.html) for information on how to install and configure an Allsky Website.

---

Expand All @@ -82,7 +83,7 @@ Allsky supports running "modules" after each picture is taken to change the imag

The Overlay Editor lets you easily specify what text and images you want in your overlay, and place them using drag-and-drop. Each field can be formatted however you want (font, color, size, position, rotation, etc.). The only limit is your imagination!!

See the [Explanations / How To -> Overlays](https://github.com/thomasjacquin/allsky/wiki) and [Explanations / How To -> Modules](https://github.com/thomasjacquin/allsky/wiki) documentation for more information.
See [Explanations / How To -> Overlays](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/overlays/overlays.html) and [Explanations / How To -> Modules](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/modules/modules.html) for more information.

---

Expand All @@ -93,7 +94,7 @@ See the [Explanations / How To -> Overlays](https://github.com/thomasjacquin/all

Dark frame subtraction removes hot pixels from images by taking images at different temperatures with a cover on your camera lens and subtracting those images from nighttime images.

See the [Explanations / How To -> Dark frames](https://github.com/thomasjacquin/allsky/wiki) documentation for more information.
See [Explanations / How To -> Dark frames](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/explanations/darkFrames.html) for more information.

---

Expand All @@ -120,7 +121,7 @@ By default, a timelapse video is generated at the end of nighttime from all of t
A **Keogram** is an image giving a quick view of the day's activity.
For each image a central vertical column 1 pixel wide is extracted. All these columns are then stitched together from left to right. This results in a timeline that reads from dawn to the end of nighttime (the image above only shows nighttime data since daytime images were turned off).

See the [Explanations / How To --> Keograms](https://github.com/thomasjacquin/allsky/wiki) documentation.
See [Explanations / How To --> Keograms](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/explanations/keograms.html).


---
Expand All @@ -137,7 +138,7 @@ See the [Explanations / How To --> Keograms](https://github.com/thomasjacquin/al
**Startrails** are generated by stacking all the images from a night on top of each other.
In the image above, Polaris is centered about one-fourth the way from the top.

See the [Explanations / How To --> Startrails](https://github.com/thomasjacquin/allsky/wiki) documentation.
See [Explanations / How To --> Startrails](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/explanations/startrails.html).


---
Expand All @@ -150,7 +151,7 @@ See the [Explanations / How To --> Startrails](https://github.com/thomasjacquin/
You can specify how many days worth of images to keep in order to keep the Raspberry Pi SD card from filling up. If you have the Allsky Website installed on your Pi, you can specify how many days worth of its imags to keep.


See the **DAYS_TO_KEEP** and **WEB_DAYS_TO_KEEP** settings in the [Settings --> Allsky Website](https://github.com/thomasjacquin/allsky/wiki) documentation.
See the **DAYS_TO_KEEP** and **WEB_DAYS_TO_KEEP** settings in [Settings --> Allsky](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/settings/allsky.html).

---

Expand All @@ -161,7 +162,7 @@ See the **DAYS_TO_KEEP** and **WEB_DAYS_TO_KEEP** settings in the [Settings -->
## Share your sky


If you want your allsky camera added to the [Allsky map](http://www.thomasjacquin.com/allsky-map), see the [Put your camera on Allsky Map](https://github.com/thomasjacquin/allsky/wiki) documentation.
If you want your allsky camera added to the [Allsky map](http://www.thomasjacquin.com/allsky-map), see [Put your camera on Allsky Map](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/miscellaneous/AllskyMap.html).

If you know anyone in Greenland or Antartica, send them a camera!!

Expand All @@ -179,7 +180,7 @@ If you know anyone in Greenland or Antartica, send them a camera!!
## Release changes

See the
[Allsky Version Change Log](https://github.com/thomasjacquin/allsky/blob/master/html/documentation/changeLog.html)
[Allsky Version Change Log](https://htmlpreview.github.io/?https://raw.githubusercontent.com/thomasjacquin/allsky/master/html/documentation/changeLog.html)
for a list of changes in this release and all prior releases.

---
Expand Down
57 changes: 42 additions & 15 deletions allsky.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ source "${ALLSKY_CONFIG}/config.sh" || exit ${ALLSKY_ERROR_STOP}
#shellcheck disable=SC2086 source-path=scripts
source "${ALLSKY_SCRIPTS}/installUpgradeFunctions.sh" || exit ${ALLSKY_ERROR_STOP}

# Make sure they rebooted if they were supposed to.
NEEDS_REBOOT="false"
reboot_needed && NEEDS_REBOOT="true"

# Make sure the settings have been configured after an installation or upgrade.
LAST_CHANGED="$( settings ".lastChanged" )"
if [[ ${LAST_CHANGED} == "" || ${LAST_CHANGED} == "null" ]]; then
echo "*** ===== Allsky needs to be configured before it can be used. See the WebUI."
if [[ ${NEEDS_REBOOT} == "true" ]]; then
echo "*** ===== The Pi also needs to be rebooted."
doExit "${EXIT_ERROR_STOP}" "Error" \
"Allsky needs\nconfiguration\nand the Pi needs\na reboot" \
"Allsky needs to be configured then the Pi rebooted."
else
doExit "${EXIT_ERROR_STOP}" "ConfigurationNeeded" "" ""
"${ALLSKY_SCRIPTS}/addMessage.sh" "Error" "Allsky needs to be configured."
fi
elif [[ ${NEEDS_REBOOT} == "true" ]]; then
doExit "${EXIT_ERROR_STOP}" "RebootNeeded" "" ""
"${ALLSKY_SCRIPTS}/addMessage.sh" "Error" "The Pi needs to be rebooted."
fi

SEE_LOG_MSG="See ${ALLSKY_LOG}"
ARGS_FILE="${ALLSKY_TMP}/capture_args.txt"
Expand Down Expand Up @@ -171,6 +192,12 @@ else
"${NOT_STARTED_MSG}<br>${MSG}"
fi

# Make sure the settings file is linked to the camera-specific file.
if ! MSG="$( check_settings_link "${SETTINGS_FILE}" )" ; then
"${ALLSKY_SCRIPTS}/addMessage.sh" "error" "${MSG}"
echo "ERROR: Settings file (${SETTINGS_FILE}) not linked correctly." >&2
fi

# Make directories that need to exist.
if [[ -d ${ALLSKY_TMP} ]]; then
# remove any lingering old image files.
Expand All @@ -186,11 +213,13 @@ else
"${ALLSKY_SCRIPTS}/addMessage.sh" warning "${ME}: ${MSG}"
fi

rm -f "${ALLSKY_BAD_IMAGE_COUNT}" # Start with no bad images

# Clear out these files and allow the web server to write to it.
: > "${ALLSKY_ABORTEDUPLOADS}"
: > "${ALLSKY_ABORTEDTIMELAPSE}"
sudo chgrp "${WEBSERVER_GROUP}" "${ALLSKY_ABORTEDUPLOADS}" "${ALLSKY_ABORTEDTIMELAPSE}"
sudo chmod 664 "${ALLSKY_ABORTEDUPLOADS}" "${ALLSKY_ABORTEDTIMELAPSE}"
rm -fr "${ALLSKY_ABORTS_DIR}"
mkdir "${ALLSKY_ABORTS_DIR}"
sudo chgrp "${WEBSERVER_GROUP}" "${ALLSKY_ABORTS_DIR}"
sudo chmod 775 "${ALLSKY_ABORTS_DIR}"

# Optionally display a notification image.
if [[ $USE_NOTIFICATION_IMAGES -eq 1 ]]; then
Expand Down Expand Up @@ -219,17 +248,12 @@ if [[ -z ${LOCALE} || ${LOCALE} == "null" ]]; then
fi
fi

# shellcheck disable=SC2207
KEYS=( $(settings 'keys[]') )
for KEY in "${KEYS[@]}"
do
K="$(settings ".${KEY}")"
# We must pass "-config ${ARGS_FILE}" on the command line,
# and debuglevel we did above, so don't do them again.
[[ ${KEY} == "config" && ${KEY} == "debuglevel" ]] && continue

echo "-${KEY}=${K}" >> "${ARGS_FILE}"
done
# We must pass "-config ${ARGS_FILE}" on the command line,
# and debuglevel we did above, so don't do them again.
TAB="$( echo -e "\t" )"
convert_json_to_tabs "${SETTINGS_FILE}" |
grep -E -i -v "^config${TAB}|^debuglevel${TAB}" |
sed -e 's/^/-/' -e "s/${TAB}/=/" >> "${ARGS_FILE}"

# When using a desktop environment a preview of the capture can be displayed in a separate window.
# The preview mode does not work if we are started as a service or if the debian distribution has no desktop environment.
Expand All @@ -252,6 +276,9 @@ CAPTURE="capture_${CAMERA_TYPE}"

rm -f "${ALLSKY_NOTIFICATION_LOG}" # clear out any notificatons from prior runs.

# Clear up any flow timings
"${ALLSKY_SCRIPTS}/flow-runner.py" --cleartimings

# Run the main program - this is the main attraction...
# Pass debuglevel on command line so the capture program knows if it should display debug output.
"${ALLSKY_BIN}/${CAPTURE}" -debuglevel "${ALLSKY_DEBUG_LEVEL}" -config "${ARGS_FILE}"
Expand Down
Binary file removed assets/WebUI.png
Binary file not shown.
6 changes: 4 additions & 2 deletions config_repo/config.sh.repo
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ UHUBCTL_PORT=2
# ================ DO NOT CHANGE ANYTHING BELOW THIS LINE ================
ME2="$(basename "${BASH_SOURCE[0]}")"

CAMERA_TYPE="" # Updated during installation
# CAMERA_TYPE is updated during installation
CAMERA_TYPE=""
if [ "${CAMERA_TYPE}" = "" ]; then
echo -e "${RED}${ME2}: ERROR: Please set 'Camera Type' in the WebUI.${NC}"
sudo systemctl stop allsky > /dev/null 2>&1
Expand Down Expand Up @@ -192,6 +193,7 @@ CAMERA_MODEL="$(settings '.cameraModel')"

# So scripts can conditionally output messages.
ALLSKY_DEBUG_LEVEL="$(settings '.debuglevel')"
ALLSKY_VERSION="XX_ALLSKY_VERSION_XX" # Updated during installation
# ALLSKY_VERSION is updated during installation
ALLSKY_VERSION="XX_ALLSKY_VERSION_XX"

CONFIG_SH_VERSION=1
2 changes: 1 addition & 1 deletion config_repo/ftp-settings.sh.repo
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ REMOTE_HOST=""
REMOTE_PORT=""


############### ftp, ftps, and sftp PROTOCOLS only:
############### ftp, ftps, and sftp PROTOCOLS only. REMOTE_USER is also used by the scp PROTOCOL:
# The username of the login on the remote server.
REMOTE_USER=""

Expand Down
1 change: 1 addition & 0 deletions config_repo/lighttpd.conf.repo
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ setenv.add-environment = (

alias.url = ("/current/" => "XX_ALLSKY_HOME_XX/")
alias.url += ("/images/" => "XX_ALLSKY_IMAGES_XX/")
alias.url += ("/config/" => "XX_ALLSKY_CONFIG_XX/")
alias.url += ("/website/" => "XX_ALLSKY_WEBSITE_XX/")
alias.url += ("/documentation" => "XX_ALLSKY_DOCUMENTATION_XX/")
alias.url += ("/overlay" => "XX_ALLSKY_OVERLAY_XX/")
Expand Down
Loading

0 comments on commit fbae714

Please sign in to comment.