Skip to content

Commit 171b15c

Browse files
authored
Merge pull request #4776 from AllskyTeam/v2024.12.06_06
V2024.12.06_06
2 parents 24fbed3 + 8ca2693 commit 171b15c

15 files changed

Lines changed: 253 additions & 52 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Allsky Camera ![Release](https://img.shields.io/badge/Version-v2024.12.06_05-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)
1+
# Allsky Camera ![Release](https://img.shields.io/badge/Version-v2024.12.06_06-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)
22

33

44
This is the source code for the Allsky Camera project. <!-- described [on Instructables](http://www.instructables.com/id/Wireless-All-Sky-Camera/). -->

html/documentation/changeLog.html

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
</p>
3737

3838
<!-- =========================================== -->
39+
<!--
3940
<h2>v2025.xx.xx</h2>
4041
<details open> <summary></summary>
42+
-->
4143

4244
<!--
4345
<h3>v2025.xx.xx_01 - Point Release # 1</h3>
@@ -48,7 +50,7 @@ <h3>v2025.xx.xx_01 - Point Release # 1</h3>
4850
<h3>v2025.xx.xx - Base Release</h3>
4951
-->
5052

51-
53+
<!--
5254
<h4>Deleted capabilities</h4>
5355
<ul>
5456
<li>The Buster operating system is no longer supported.
@@ -63,6 +65,10 @@ <h4>Enhancements / Changes</h4>
6365
<ul>
6466
<li>Updated to ZWO SDK v1.38 which supports the
6567
ASI582MC and Seestar 585MC cameras.
68+
<li>Added a
69+
<a external="true" allsky="true"
70+
href="/documentation/troubleshooting/troubleshootingTools.html">Troubleshooting Tools</a>
71+
Documentation page to list tools to aid in troubleshooting.
6672
</ul>
6773
6874
<h4>Bug Fixes</h4>
@@ -88,11 +94,53 @@ <h4>New Settings</h4>
8894
8995
<hr class="separator">
9096
</details>
97+
-->
9198

9299
<!-- =========================================== -->
93100

94101
<h2>v2024.12.06</h2>
95-
<details> <summary></summary>
102+
<details open> <summary></summary>
103+
104+
<h3>v2024.12.06_06 - Point Release # 6</h3>
105+
<details open sub> <summary></summary>
106+
<h4 style="color: red">IMPORTANT NOTES:</h4>
107+
<ul>
108+
<li>This is the LAST major release that supports Buster.
109+
<li>This is the LAST major release that contains the "legacy"
110+
overlay method.
111+
</ul>
112+
113+
<h4>Enhancements / Changes</h4>
114+
<ul>
115+
<li>When 4 consecutive errors occur while capturing images
116+
with an RPi camera, the last error is now shown
117+
in the WebUI's "System Messages" section.
118+
</ul>
119+
120+
<h4>Bug Fixes</h4>
121+
<ul>
122+
<li>Fixed an issue where downloading the support log from the
123+
<span class="WebUILink">Getting Support</span>
124+
page would hang the page.
125+
<li>Fixed an issue with WebUI "System Messages":
126+
<ol>
127+
<li>Some messages were displayed hundreds or thousands
128+
of times rather than being displayed once with a
129+
number of occurrences greater than 1.
130+
<li>A message was truncated when unable to download the
131+
<span class="fileName">de421.bsp</span> file.
132+
</ol>
133+
<li>Fixed a rare situation where the
134+
<span class="managerName">Module Manager</span>
135+
will fail to display any modules due to corruption in
136+
a module's metaData.
137+
</ul>
138+
139+
<h4>New Settings</h4>
140+
<ul>
141+
<li>None
142+
</ul>
143+
</details>
96144

97145
<h3>v2024.12.06_05 - Point Release # 5</h3>
98146
<details sub> <summary></summary>

html/documentation/sidebar.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
</ol>
4545
<li>Troubleshooting:
4646
<ol type="i">
47-
<li><a allsky="true" href="/documentation/troubleshooting/reportingProblems.html"><b>Reporting Problems</b></a>
47+
<li><a allsky="true" href="/documentation/troubleshooting/reportingProblems.html"><b>Reporting problems</b></a>
48+
<li><a allsky="true" href="/documentation/troubleshooting/troubleshootingTools.html">Troubleshooting tools</a>
4849
<li><a allsky="true" href="/documentation/troubleshooting/uploads.html">Uploads (FTP, scp, etc.)</a>
4950
<li><a allsky="true" href="/documentation/explanations/startrails.html#troubleshooting">Startrails</a>
5051
<li><a allsky="true" href="/documentation/troubleshooting/timelapse.html">Timelapse</a>

html/documentation/troubleshooting/timelapse.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<link href="../css/documentation.css" rel="stylesheet">
1818
<link href="../css/custom.css" rel="stylesheet">
1919
<link href="../documentation-favicon.ico" rel="shortcut icon" type="image/png">
20+
<script src="../js/all.min.js" type="application/javascript"></script>
2021
<title>Timelapse Problems</title>
2122
</head>
2223
<body>
@@ -129,7 +130,7 @@ <h2>Timelapse video is not created</h2>
129130
<h2 id="poorquality">Timelapse video is poor quality and/or "blocky"</h2>
130131
<details><summary></summary>
131132
<p>
132-
If you timelapse videos have poor quality,
133+
If your timelapse videos have poor quality,
133134
typically more noticable in fast-moving areas like clouds,
134135
and/or the videos are "blocky", as seen in the image blow,
135136
try the steps below.
@@ -147,7 +148,7 @@ <h2 id="poorquality">Timelapse video is poor quality and/or "blocky"</h2>
147148
<li>If you have a high-resolution camera like the RPi HQ (4056 x 3040 pixels)
148149
or many ZWO cameras, try decreasing the resolution of the video.
149150
Many people have "High Definition" monitors with a width of 1920 pixels,
150-
so you can probably reduce your video to that around that size without anyone noticing.
151+
so you can probably reduce your video without anyone noticing.
151152
Using half the camera's resolution is a good place to start
152153
(2028 x 1520 for the RPi HQ).
153154
Make sure to reduce the width and height by the same <em>percent</em>,
@@ -173,7 +174,7 @@ <h2 id="poorquality">Timelapse video is poor quality and/or "blocky"</h2>
173174
in the <span class="settingsHeader">Timelapse Settings</span>
174175
section of the WebUI.
175176
This has no impact on the resolution of each individual image.
176-
<li>Add a
177+
<li>Add a
177178
<a external="true"
178179
href="https://en.wikipedia.org/wiki/Advanced_Video_Coding#Levels">
179180
Video Coding Level</a>
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<script src="../js/documentation.js" type="application/javascript"></script>
8+
<link href="../css/light.css" rel="stylesheet">
9+
<link href="../bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
10+
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
11+
<script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
12+
<style>
13+
#pageTitle::before {
14+
content: "Troubleshooting Tools";
15+
}
16+
</style>
17+
<link href="../css/documentation.css" rel="stylesheet">
18+
<link href="../documentation-favicon.ico" rel="shortcut icon" type="image/png">
19+
<title>Troubleshooting Tools</title>
20+
</head>
21+
<body>
22+
<div w3-include-html="/documentation/pageHeader.html" id="pageHeader"></div>
23+
<div class="Layout">
24+
<div class="Layout-sidebar" w3-include-html="/documentation/sidebar.html" id="sidebar"></div>
25+
<div class="Layout-main markdown-body" id="mainContents">
26+
27+
<p>
28+
This pages lists some tools and techniques to aid in troubleshooting Allsky.
29+
If you have any other tools, please submit a GitHub Discussion and let the
30+
Allsky developers know.
31+
</p>
32+
33+
34+
<h2><code>allsky-config</code> command</h2>
35+
<p>
36+
The <code>allsky-config</code> command performs various actions.
37+
Some let you easily configure a feature
38+
(like the ability to share files between your Pi and a PC or Mac),
39+
while other actions let you view various types of information
40+
which is often used to troubleshoot.
41+
<br>
42+
The list of actions grows often so is not shown here but you can
43+
enter <code>allsky-config --help</code> to see the list.
44+
45+
<blockquote>
46+
The Allsky developers may ask you to run <code>allsky-config</code>
47+
to provide additional information.
48+
In most cases you can simply copy and paste the command you are asked to run into
49+
a terminal window on the Pi.
50+
</blockquote>
51+
</p>
52+
<p>
53+
<code>allsky-config</code> can be used two different ways:
54+
<ol>
55+
<li><strong>Menu-driven</strong>
56+
<br>
57+
In this mode you simply type <code>allsky-config</code> and
58+
are presented with a menu of actions you can perform.
59+
Use the up and down arrow keys to navigate the list
60+
and the left right arrow keys to go to the choices at the end of the list.
61+
After selecting an action,
62+
if additional information is needed you are prompted for it.
63+
The action you selected is then executed and its output displayed.
64+
<br>
65+
You can then enter <code>q</code> to quit <code>allsky-config</code> or
66+
press return to be shown the menu of actions again.
67+
68+
<p>
69+
When viewing the menu, the name of the action that will be taken
70+
is listed at the end of every entry.
71+
That action name is used in the next mode of <code>allsky-config</code>
72+
- see below.
73+
</p>
74+
<li><strong>Action-specific</strong>
75+
<br>
76+
In this mode, you type <code>allsky-config ACTION</code>
77+
where "ACTION" is the name of an actions to execute, optionally followed by arguments.
78+
<br>
79+
For example: <code>allsky-config show_supported_cameras --zwo</code>.
80+
<p>
81+
Most actions only output information but a few first prompt for something
82+
then perform the action.
83+
</p>
84+
</ol>
85+
</p>
86+
<p>
87+
To see what an action does and what, if any arguments it takes,
88+
enter <code>allsky-config ACTION --help</code>,
89+
replacing "ACTION" with an action name shown in the command above.
90+
</p>
91+
92+
93+
<h2><code>htop</code></h2>
94+
<p>
95+
If your Pi seems very slow you can run the Linux <code>htop</code> command which
96+
displays the usage of all the CPUs and the amount of memory and swap in use,
97+
as well as the processes using the most CPU.
98+
The display is updated roughly every second.
99+
</p>
100+
<p>
101+
You will probably first need to install <code>htop</code> by executing
102+
<code>sudo apt install htop</code>.
103+
</p>
104+
105+
<h2>Other troubleshooting tools</h2>
106+
<p>
107+
More to come...
108+
</p>
109+
110+
111+
</div><!-- Layout-main -->
112+
</div><!-- Layout -->
113+
</body>
114+
</html>
115+
<script> includeHTML(); </script>

html/includes/functions.php

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -899,19 +899,21 @@ function runCommand($cmd, $onSuccessMessage, $messageColor, $addMsg=true, $onFai
899899
// Update a file.
900900
// Files should be writable by the web server, but if they aren't, use a temporary file.
901901
// Return any error message.
902-
function updateFile($file, $contents, $fileName, $toConsole) {
902+
function updateFile($file, $contents, $fileName, $toConsole, $silent=false) {
903903
if (@file_put_contents($file, $contents) == false) {
904904
$e = error_get_last()['message'];
905905

906-
// $toConsole tells us whether or not to use console.log() or just echo.
907-
if ($toConsole) {
908-
$cl1 = '<script>console.log("';
909-
$cl2 = '");</script>';
910-
} else {
911-
$cl1 = "<br>";
912-
$cl2 = "";
906+
if (! $silent) {
907+
// $toConsole tells us whether or not to use console.log() or just echo.
908+
if ($toConsole) {
909+
$cl1 = '<script>console.log("';
910+
$cl2 = '");</script>';
911+
} else {
912+
$cl1 = "<br>";
913+
$cl2 = "";
914+
}
915+
echo "${cl1}Note: Unable to update $file 1st time: ${e}${cl2}\n";
913916
}
914-
echo "${cl1}Note: Unable to update $file 1st time: ${e}${cl2}\n";
915917

916918
// Assumed it failed due to lack of permissions,
917919
// usually because the file isn't grouped to the web server group.
@@ -927,15 +929,17 @@ function updateFile($file, $contents, $fileName, $toConsole) {
927929
$c = 0;
928930
if ($ret === false || $c > 0 || $retval !== 0) {
929931
$err = implode("\n", $return);
930-
return "Unable to update settings: $err";
932+
return "Unable to update '$file': $err";
931933
}
932934

933935
if (@file_put_contents($file, $contents) == false) {
934-
$e = error_get_last()['message'];
935-
$err = "Failed to save settings: $e";
936-
echo "${cl1}Unable to update file for 2nd time: ${e}${cl2}";
937-
$x = str_replace("\n", "", shell_exec("ls -l '$file'"));
938-
echo "${cl1}ls -l returned: ${x}${cl2}";
936+
if (! $silent) {
937+
$e = error_get_last()['message'];
938+
$err = "Failed to save '$file': $e";
939+
echo "${cl1}Unable to update file for 2nd time: ${e}${cl2}";
940+
$x = str_replace("\n", "", shell_exec("ls -l '$file'"));
941+
echo "${cl1}ls -l returned: ${x}${cl2}";
942+
}
939943

940944
// Save a temporary copy of the file in a place the webserver can write to,
941945
// then use sudo to "cp" the file to the final place.

html/includes/moduleutil.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,31 @@ private function readModuleData($moduleDirectory, $type, $event) {
106106
}
107107

108108
$decoded = json_decode($metaData);
109-
if (in_array($event, $decoded->events)) {
110-
if (isset($decoded->experimental)) {
111-
$experimental = strtolower($decoded->experimental) == "true"? true: false;
112-
} else {
113-
$experimental = false;
109+
if ($decoded !== null) {
110+
if (in_array($event, $decoded->events)) {
111+
if (isset($decoded->experimental)) {
112+
$experimental = strtolower($decoded->experimental) == "true"? true: false;
113+
} else {
114+
$experimental = false;
115+
}
116+
117+
$arrFiles[$entry] = [
118+
'module' => $entry,
119+
'metadata' => $decoded,
120+
'type' => $type
121+
];
122+
$arrFiles[$entry]['metadata']->experimental = $experimental;
114123
}
115-
124+
} else {
125+
$decoded = new stdClass();
126+
$decoded->name = "Module " . $entry . " is currupted";
127+
$decoded->description = "The metadata in the module file is invalid. Please contact Allsky support.";
128+
$decoded->events = ["day", "night", "periodic", "daynight", "nightday"];
116129
$arrFiles[$entry] = [
117130
'module' => $entry,
118131
'metadata' => $decoded,
119132
'type' => $type
120-
];
121-
$arrFiles[$entry]['metadata']->experimental = $experimental;
133+
];
122134
}
123135
}
124136
}
@@ -252,7 +264,9 @@ private function readModules() {
252264
$selectedResult = [];
253265
foreach($configData as $selectedName=>$data) {
254266
$moduleName = "allsky_" . $selectedName . ".py";
255-
// TODO: check if $allModules[$moduleName] exists.
267+
if (!isset($allModules[$moduleName])) {
268+
continue;
269+
}
256270
$moduleData = $allModules[$moduleName];
257271

258272
if (isset($data->metadata->arguments)) {
@@ -402,3 +416,4 @@ public function getReset() {
402416

403417
$overlayUtil = new MODULEUTIL();
404418
$overlayUtil->run();
419+

html/js/allsky-support/allsky-support.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class ALLSKYSUPPORT {
122122
})
123123

124124
$(document).on('click', '.as-support-log-download', (event) => {
125+
var logId = $(event.currentTarget).data('logid')
125126
$('.as-support-loading').LoadingOverlay('show', {
126127
background: 'rgba(0, 0, 0, 0.5)',
127128
imageColor: '#a94442'

scripts/addMessage.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,10 @@ while [[ $# -gt 0 ]]; do
101101
;;
102102
"--msg")
103103
MESSAGE="$( convert_string "${2}" )"
104-
# If ${MESSAGE} contains "*" it hoses up the grep and sed regular expression,
105-
# so escape it.
104+
# If ${MESSAGE} contains "*" or "[" it hoses up the grep and sed regular expression,
105+
# so escape them.
106106
ESCAPED_MESSAGE="${MESSAGE//\*/\\*}"
107+
ESCAPED_MESSAGE="${ESCAPED_MESSAGE//\[/\\[}"
107108
shift
108109
;;
109110
"--url")

0 commit comments

Comments
 (0)