Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] keeps crashing/freezing after timelapse each morning. #4193

Open
clambert24 opened this issue Jan 8, 2025 · 21 comments
Open

[BUG] keeps crashing/freezing after timelapse each morning. #4193

clambert24 opened this issue Jan 8, 2025 · 21 comments
Assignees
Labels
Being investigated Working with user to understand problem

Comments

@clambert24
Copy link

clambert24 commented Jan 8, 2025

Camera model

rpi hd

Operating System

Buster

Allsky version

v2024.12.06

Pi and amount of memory (512 MB, 1, 2, 4, or 8 GB)

Raspberry Pi 4 Model B Rev 1.5 (2 GB) (1TB SD card)

Bug Description

every day after its completed its timelapse the video feed crashes/freezes and i have to reboot the system to get the live feed back again and for it to start recording again. i did notice when i ran cat /var/log/allsky.log | less towards the end it was producing ALLOT of extra info i have never seen before, in this case (added extra data field)

Log and configuration files (ATTACH files, do NOT copy/paste them)

I dont know how to do that. (sorry)

@clambert24
Copy link
Author

20250108_190803

@EricClaeys
Copy link
Collaborator

All the extra log entries are because you have Debug Level set to 4. Try using 3.

We can't do much without the log file. If you have the Pi desktop you can use it's browser and drag and drop the file.
You can also run allsky-config and pick the option to easily share files with a PC. You can then copy /var/log/allsky.log to your PC or mac and upload it.

@clambert24
Copy link
Author

Ok that makes sense.
Yes i do have the pi desktop. Where would I find the file?

@EricClaeys
Copy link
Collaborator

Which file?

The Pi browser is on the Pi's Taskbar - on mine it's a blue globe.

The "log" file is /var/log/allsky.log.

@clambert24
Copy link
Author

im so sorry, im so confused.
i clicked on the Pi browser, then what? i dont see anything about the file /var/log/allsky.log????

@EricClaeys
Copy link
Collaborator

On the Pi desktop, open the Pi browser and go to the Allsky GitHub page and log in, just like you do on your PC. Click on the Issues link then open your Issue.
Start a reply but don't type anything.

Click on the File Explorer icon on the Pi desktop (I think it looks like a folder, similar to Windows). In that window, go to /var/log. You should see several files, including allsky.log.
Drag the allsky.log icon onto your GitHub reply, then submit your reply.

@clambert24
Copy link
Author

I'm sorry, but I literally can't find /var/log anywhere.
The closest I can find anything to do with log is in /allsky/config/logs.
20250112_135843

@EricClaeys
Copy link
Collaborator

@clambert24,
I strongly recommend reading the Basics -> Linux documentation page. The few minutes it takes will save you a lot of time and frustration going forward. And it explains pathnames which is a confusing concept for many new users.

Eric

@clambert24
Copy link
Author

ok. so think i have managed to work out how to do the log etc. does this help?

settings.json.txt
allsky.log

@EricClaeys
Copy link
Collaborator

@clambert24, perfect. Thanks for attaching the files. Did the Linux Basics page help?

Did the Pi crash or freeze after the last entry in the log file "Posting camera details to Allsky map" ?
When you say "freeze", what freezes? Allsky, your terminal window, the Pi desktop, etc.?

FYI, Support for Buster is going away soon, so I suggest upgrading to Bookworm 64-bit when you can. I still have to upgrade one of my Pi's.

@clambert24
Copy link
Author

yes it did help, but was still a little confusing as i do like a step by step guide.

the picture freezes in the morning after the timelapse/sunrise has happened. i can still login remotely afterwards etc, but if i leave it, it doesn't start recording again at night etc, so i have to go into settings and reboot pi for it to continue doing what it should.

FYI. i am running on Bookworm 64-bit as iv just checked.

@EricClaeys EricClaeys self-assigned this Jan 13, 2025
@EricClaeys EricClaeys added the Being investigated Working with user to understand problem label Jan 13, 2025
@EricClaeys
Copy link
Collaborator

Did the "picture freeze" after the last entry in the log file "Posting camera details to Allsky map" ? For example, if you did nothing after the freeze, and waited an hour, then looked at the end of the log file, it would have been identical?

At the next freeze, please do the following:

tail -f /var/log/allsky.log
# It will display the last 10 or so lines from the log file.
# Wait 5 minutes to see if it displays anything else.
# If it does NOT, in a NEW terminal window:
ps -fuadmin > /tmp/ps.txt
# attach /tmp/ps.txt to your GitHub reply.

sudo systemctrl status allsky
sudo systemctrl stop allsky
# Did any new lines appear in the "tail -f" window?
sudo systemctrl start allsky
# Did any new lines appear in the "tail -f" window?

A reboot is rarely needed in Linux. For Allsky problems, stopping and starting Allsky usually works.

@clambert24
Copy link
Author

ok thank you.
yes its exactly the same as i had left it most of the day "frozen" until i got home from work and thats all the info it provided.

ok so i shall give that a go and i will see tomorrow what happens, its just very confusing thats all because it was working fine with no problems.

@EricClaeys
Copy link
Collaborator

I don't think this is an Allsky bug. I'm pretty sure other people have had this problem and it was caused by Linux killing Allsky because it was using "too much" CPU.
We will see tomorrow.

@aaronwmorris
Copy link

@clambert24 Assuming you are using a Raspi HQ camera. The reason your system is hanging is most likely due to running out of memory. If you are trying to generate a timelapse at the native resolution of 4056x3040, ffmpeg will require ~2.5GB of memory (more than your 2GB available).

The amount of memory needed by ffmpeg is relative to the output resolution of the video (not the input images). You could try adding --vf scale=-2:1080 or --vf scale=-2:2160 to your ffmpeg command to reduce the vertical height of your videos to 1080p or 2160p. These would only require 0.6GB and 1.7GB of memory respectively.

I would also suggest setting up the watchdog function on your Pi. This will automatically reboot the system if it hangs.

@clambert24
Copy link
Author

Hi. Ok that is good information thank you.
Yes i am using that camera.
I shall try adding one of those commands to see if that helps.
Where would I find info for setting up the watchdog function?

@aaronwmorris
Copy link

I could not find anything using a quick search of the allsky docs. I have a pretty easy guide in the indi-allsky wiki:

https://github.com/aaronwmorris/indi-allsky/wiki/Raspberry-Pi-Watchdog

@rodobie
Copy link

rodobie commented Jan 16, 2025

I had a similar timelapse issue which I root caused back to the USB C power supply.

Was using a spare USB plug which I had for charging mobiles, to run my PI 5 8Gb and it was fine for everything except when the PI was on at full load for extended duration. It could not supply the necessary power and would cause a crash at a random point during the timelapse creation.

Bought the recommended Raspberry PI5 27W USB-C power supply and have never had a timelapse creation crash since installing it.

Hope this helps you out.

@clambert24
Copy link
Author

@clambert24 Assuming you are using a Raspi HQ camera. The reason your system is hanging is most likely due to running out of memory. If you are trying to generate a timelapse at the native resolution of 4056x3040, ffmpeg will require ~2.5GB of memory (more than your 2GB available).

The amount of memory needed by ffmpeg is relative to the output resolution of the video (not the input images). You could try adding --vf scale=-2:1080 or --vf scale=-2:2160 to your ffmpeg command to reduce the vertical height of your videos to 1080p or 2160p. These would only require 0.6GB and 1.7GB of memory respectively.

I would also suggest setting up the watchdog function on your Pi. This will automatically reboot the system if it hangs.

Ok, so I applied the setting --vf scale=-2:2160 and now it's not generating a timelapse 😕.

Image

@aaronwmorris
Copy link

Inspect the log to see what error is being generated. You should be able to attempt to generate the timelapse manually, but I do not recall the command to do so with allsky.

@EricClaeys
Copy link
Collaborator

@clambert24,
You should NEVER change an Allsky script and almost never manually change a configuration file. Configuration changes are done via the WebUI. Please undo whatever you did.

To change the size of the timelapse video update the Timelapse Width and Height settings in the WebUI.
For my RPi HQ camera I set them to half the width and height of the sensor (4056x3040) since that keeps the same aspect ratio.

Going forward, please remember that the Allsky Documentation is your friend. It describes every setting and explains what most things are and how to use them, like timelapse. There's also a ton of troubleshooting info in the Documentation.
If you find something that's confusing or missing, please let us know.

I'm curious what the "Images" screenshot is supposed to tell us?
The Explanations -> Timelapse documentation page tells you when timelapses are automatically created and how to manually create them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Being investigated Working with user to understand problem
Projects
None yet
Development

No branches or pull requests

4 participants