Skip to content

Commit 32b1f00

Browse files
Merge branch 'v2025.xx.xx' of github.com:AllskyTeam/allsky into v2025.xx.xx
2 parents 043d86c + e5ab954 commit 32b1f00

6 files changed

Lines changed: 28 additions & 13 deletions

File tree

config_repo/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ VENVDIR = ${HOMEDIR}/venv
66
SCRIPTSDIR = ${HOMEDIR}/scripts
77
UTILITIESDIR = ${SCRIPTSDIR}/utilities
88
# TODO: get from variables.sh
9-
NORESTARTCODES = 100 101
9+
NORESTARTCODES = 100 101 102
1010
LIBSYSTEMDIR = /lib/systemd/system
1111

1212
.DEFAULT_GOAL := all

scripts/installUpgradeFunctions.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ function display_msg()
258258
if [[ ! -f ${DISPLAY_MSG_LOG} ]]; then
259259
mkdir -p "$( dirname "${DISPLAY_MSG_LOG}" )"
260260
touch "${DISPLAY_MSG_LOG}"
261+
elif [[ ! -w ${DISPLAY_MSG_LOG} ]]; then
262+
# A user had a problem where the log file was owned by the web server,
263+
# so make sure it's owned by the user.
264+
sudo chown "${ALLSKY_OWNER}:${ALLSKY_GROUP}" "${DISPLAY_MSG_LOG}"
261265
fi
262266

263267
# Assume if GREEN isn't defined then no colors are defined.
@@ -2005,6 +2009,7 @@ function update_allsky_common()
20052009
-e "s;XX_EXIT_RESET_USB_XX;${ALLSKY_EXIT_RESET_USB};" \
20062010
-e "s;XX_EXIT_ERROR_STOP_XX;${ALLSKY_EXIT_ERROR_STOP};" \
20072011
-e "s;XX_EXIT_NO_CAMERA_XX;${ALLSKY_EXIT_NO_CAMERA};" \
2012+
-e "s;XX_EXIT_STOP_XX;${ALLSKY_EXIT_STOP};" \
20082013
"${DOT_H}.repo" \
20092014
> "${DOT_H}"
20102015

src/allsky_common.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ void displayHelp(config cg)
752752
printf(" -%-*s - 'true' enables saving of daytime images [%s].\n", n, "savedaytimeimages b", yesNo(cg.daytimeSave));
753753
printf(" -%-*s - 'true' enables daytime auto-exposure [%s].\n", n, "dayautoexposure b", yesNo(cg.dayAutoExposure));
754754
printf(" -%-*s - Maximum daytime auto-exposure in ms.\n", n, "daymaxexposure n");
755-
printf(" -%-*s - Daytime exposure in us [%'ld].\n", n, "dayexposure n", cg.dayExposure_us);
755+
printf(" -%-*s - Daytime exposure in ms [%'ld].\n", n, "dayexposure n", cg.dayExposure_us / 1000);
756756
printf(" -%-*s - Daytime mean target brightness [%.2f].\n", n, "daymean", cg.myModeMeanSetting.dayMean);
757757
printf(" -%-*s - Daytime mean target threshold [%.2f].\n", n, "daymeanthreshold n", cg.myModeMeanSetting.dayMean_threshold);
758758
if (cg.ct == ctRPi) {
@@ -781,7 +781,7 @@ void displayHelp(config cg)
781781
printf(" -%-*s - 'true' enables saving of nighttime images [%s].\n", n, "savenighttimeimages b", yesNo(cg.nighttimeSave));
782782
printf(" -%-*s - 'true' enables nighttime auto-exposure [%s].\n", n, "nightautoexposure b", yesNo(cg.nightAutoExposure));
783783
printf(" -%-*s - Maximum nighttime auto-exposure in ms.\n", n, "nightmaxexposure n");
784-
printf(" -%-*s - Nighttime exposure in us [%'ld].\n", n, "nightexposure n", cg.nightExposure_us);
784+
printf(" -%-*s - Nighttime exposure in ms [%'ld].\n", n, "nightexposure n", cg.nightExposure_us / 1000);
785785
printf(" -%-*s - Nighttime mean target brightness [%.2f].\n", n, "nightmean n", cg.myModeMeanSetting.nightMean);
786786
if (cg.ct == ctRPi) {
787787
printf(" %-*s NOTE: Enable nighttime auto-gain and auto-exposure for best results.\n", n, "");
@@ -880,6 +880,7 @@ void displayHelp(config cg)
880880
printf(" %-*s Bullseye: libcamera-still\n", n, "");
881881
printf(" %-*s Bookworm and newer: rpicam-still\n", n, "");
882882
}
883+
printf(" -%-*s - Max images to take before exiting (0 takes all) [%d].\n", n, "maximages n", cg.maxImages);
883884
/* These are too advanced for anyone other than developers.
884885
printf(" -%-*s - Be careful changing these values, ExposureChange (Steps) = p0 + (p1*diff) + (p2*diff)^2 [%.1f].\n", n, "mean-p0 n", cg.myModeMeanSetting.dayMean_threshold);
885886
printf(" -%-*s - [%.1f].\n", n, "mean-p1 n", cg.myModeMeanSetting.mean_p1);
@@ -1002,6 +1003,9 @@ void displaySettings(config cg)
10021003
printf(" ZWO Exposure Type: %s\n", getZWOexposureType(cg.ZWOexposureType));
10031004
}
10041005
printf(" Preview: %s\n", yesNo(cg.preview));
1006+
if (cg.maxImages > 0) {
1007+
printf(" Maximum images to take before exiting: %d\n", cg.maxImages);
1008+
}
10051009
printf(" Focus mode: %s\n", yesNo(cg.focusMode));
10061010
printf(" Calculate focus metric: %s\n", yesNo(cg.determineFocus));
10071011
printf(" Taking Dark Frames: %s\n", yesNo(cg.takeDarkFrames));
@@ -1275,6 +1279,7 @@ bool getCommandLineArguments(config *cg, int argc, char *argv[], bool readConfig
12751279
{
12761280
char *a = argv[i];
12771281
if (*a == '-') a++; // skip leading "-"
1282+
if (*a == '-') a++; // skip second leading "-"
12781283

12791284
Log(4, "%s >>> Parameter [%-*s] Value: [%s]\n", b, n, a, argv[i+1]);
12801285

@@ -1292,7 +1297,7 @@ bool getCommandLineArguments(config *cg, int argc, char *argv[], bool readConfig
12921297
return(false);
12931298
}
12941299
}
1295-
else if (strcmp(a, "-help") == 0)
1300+
else if (strcmp(a, "help") == 0)
12961301
{
12971302
cg->help = true;
12981303
cg->quietExit = true; // we display the help message and quit
@@ -1337,6 +1342,10 @@ bool getCommandLineArguments(config *cg, int argc, char *argv[], bool readConfig
13371342
{
13381343
cg->preview = getBoolean(argv[++i]);
13391344
}
1345+
else if (strcmp(a, "maximages") == 0)
1346+
{
1347+
cg->maxImages = atoi(argv[++i]);
1348+
}
13401349

13411350
// daytime settings
13421351
else if (strcmp(a, "takedaytimeimages") == 0)

src/include/allsky_common.h.repo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#define EXIT_RESET_USB XX_EXIT_RESET_USB_XX // Need to reset USB bus; cannot continue
7575
#define EXIT_ERROR_STOP XX_EXIT_ERROR_STOP_XX // Got an unrecoverable ERROR
7676
#define EXIT_NO_CAMERA XX_EXIT_NO_CAMERA_XX // Could not find a camera - is unrecoverable
77+
#define EXIT_STOP XX_EXIT_STOP_XX // Stop services with no error
7778

7879
enum extType {
7980
isJPG,
@@ -280,6 +281,7 @@ struct config { // for configuration variables
280281
char const *ASIversion = "UNKNOWN"; // calculated value
281282
bool videoOffBetweenImages = true;
282283
ZWOexposure ZWOexposureType = ZWOsnap;
284+
int maxImages = 0; // Exit after this many exposure if > 0.
283285

284286
struct myModeMeanSetting myModeMeanSetting;
285287
struct HB HB; // Histogram Box, ZWO only

upgrade.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ done
202202

203203
cd || exit "${ALLSKY_EXIT_ERROR_STOP}"
204204

205-
if [[ ! -d ${ALLSKY_CONFIG} ]]; then
205+
if [[ ! -d ${ALLSKY_BIN} ]]; then
206206
MSG="Allsky does not appear to be installed; cannot continue."
207-
MSG2="Directory '${ALLSKY_CONFIG}' does not exist."
207+
MSG2="Directory '${ALLSKY_BIN}' does not exist."
208208
display_msg --log error "${MSG}" "${MSG2}"
209209
echo
210210
exit 2
@@ -293,14 +293,10 @@ if [[ ${ACTION} == "upgrade" ]]; then
293293
fi
294294

295295
if [[ ${CHOSEN_METHOD} == "${METHOD_IN_PLACE}" ]]; then
296-
display_msg --log progress "Stopping Allsky"
297-
stop_Allsky
298-
299296
cd "${ALLSKY_HOME}" || exit "${ALLSKY_EXIT_ERROR_STOP}"
300297

301298
display_msg --log progress "Getting new files from GitHub"
302-
X="$( git pull 2>&1 )"
303-
if [[ $? -ne 0 ]]; then
299+
if ! X="$( git pull 2>&1 )" ; then
304300
if echo "${X}" | grep -i --silent -n "would be overwritten" ; then
305301
FILES="$( echo -e "${X}" | grep "^ " )" # TAB
306302
MSG="You have un-checked out files, cannot continue:\n${FILES}"
@@ -314,12 +310,14 @@ if [[ ${ACTION} == "upgrade" ]]; then
314310
# If no files were retrieved, let the user know and exit.
315311
if echo "${X}" | grep -i --silent "already up to date" ; then
316312
echo
317-
MSG="No new files, restarting Allsky and existing upgrade.\n"
313+
MSG="No new files; existing upgrade.\n"
318314
display_msg --log progress "" "${MSG}"
319-
start_Allsky
320315
exit 0
321316
fi
322317

318+
display_msg --log progress "Stopping Allsky"
319+
stop_Allsky
320+
323321
# Get a list of all files downloaded. They have a " | " in their line.
324322
echo "${X}" | sed --silent -e 's/^ //' -e '/ | /s/ *| *.*//p' > "${FILES_DOWNLOADED_FILE}"
325323
NUM="$( wc -l < "${FILES_DOWNLOADED_FILE}" )"

variables.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ if [[ -z "${ALLSKY_VARIABLE_SET}" || ${1} == "--force" ]]; then
297297
# Anything at or above EXIT_ERROR_STOP is unrecoverable and the service must be stopped
298298
ALLSKY_EXIT_ERROR_STOP=100 # unrecoverable error - need user action so stop service
299299
ALLSKY_EXIT_NO_CAMERA=101 # cannot find camera
300+
ALLSKY_EXIT_STOP=102 # Stop, but no error
300301

301302
# Name of the Pi's OS in lowercase.
302303
ALLSKY_PI_OS="$( grep VERSION_CODENAME /etc/os-release )"

0 commit comments

Comments
 (0)