pageauc / pi-timolo

Raspberry PI-TIMOLO ( PI-TImelapse, MOtion, LOwLight ) uses RPI picamera and OpenCV for Remote Headless Security Monitoring using Motion Tracking, Rclone Auto Sync files with remote storage services. Auto Twilight Transitions and Low Light Camera Settings. Panoramic images using PanTiltHat and More. This project is featured on GitHub Awesome software.
MIT License
548 stars 101 forks source link

Daemon is crashing #116

Closed tibaultbordeaux closed 3 years ago

tibaultbordeaux commented 3 years ago

Dear Claude,

I tried pi-timolo again after a long time, but without success. I'm on a Raspberry Zero W with a fresh RaspberryPi OS Buster Full sudo apt-get update/upgrade was done then installed latest version of pi-timolo

I also did this:

sudo chown -R pi:pi /home/pi/pi-timolo/*

pi-timolo.py and webserver.py are working fine. But when using *.sh to start the daemons, the background tasks are crashing immediately:

pi@rpi-zero:~/pi-timolo$ ./pi-timolo.sh start
./pi-timolo.sh ver 1.1 written by Claude Pageau
-----------------------------------------------
START   - Start /home/pi/pi-timolo/pi-timolo.py in Background
STATUS  - Waiting 10 seconds ....
STATUS  - pi-timolo.py is Running ...
STATUS  - PID is 2345
INFO    - To Stop pi-timolo.py execute command below
INFO    - ./pi-timolo.sh stop
pi@rpi-zero:~/pi-timolo$ ./pi-timolo.sh status
./pi-timolo.sh ver 1.1 written by Claude Pageau
-----------------------------------------------
STATUS  - pi-timolo.py is Not Running ...
INFO    - To Start pi-timolo.py execute command below
INFO    - ./pi-timolo.sh start

Do you have any hints for me?

[Update] It seems to work for me after editing *.sh. Adding "python" in front of the command did the trick:

python $progpath/$progname >/dev/null 2>&1 &

Is this a proper way of solving the issue? [/Update]

pageauc commented 3 years ago

run pi-timolo.py directly and see what log messages appear. This will allow you to diagnose the problem. May be due to a library issue or camera problem

cd ~/pi-timolo

./pi-timolo.py

If you cannot diagnose problem from log messages then send me log and I will help

Claude ...

On Fri, Mar 12, 2021 at 4:38 PM Tibault Bordeaux @.***> wrote:

Dear Claude,

I tried pi-timolo again after a long time, but without success. I'm on a Raspberry Zero W with a fresh RaspberryPi OS Buster Full sudo apt-get update/upgrade was done then installed latest version of pi-timolo

pi-timolo.py and webserver.py are working fine. But when using *.sh to start the daemons, the background tasks are crashing immediately:

@.***:~/pi-timolo$ ./pi-timolo.sh start ./pi-timolo.sh ver 1.1 written by Claude Pageau

START - Start /home/pi/pi-timolo/pi-timolo.py in Background STATUS - Waiting 10 seconds .... STATUS - pi-timolo.py is Running ... STATUS - PID is 2345 INFO - To Stop pi-timolo.py execute command below INFO - ./pi-timolo.sh stop @.***:~/pi-timolo$ ./pi-timolo.sh status ./pi-timolo.sh ver 1.1 written by Claude Pageau

STATUS - pi-timolo.py is Not Running ... INFO - To Start pi-timolo.py execute command below INFO - ./pi-timolo.sh start

Do you have any hints for me?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pageauc/pi-timolo/issues/116, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZDDGQWRKNNCDJFPKVDTDKCTVANCNFSM4ZC75PAQ .

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc

tibaultbordeaux commented 3 years ago

Dear Claude, thanks for your fast reply! I did try running pi-timolo.py before and it works flawlessly. I do not get any error messages. Same with webserver.py.

Probably it wasn't a good idea to update my original post, as you might not have seen the update:

Adding "python" in front of the command in pi-timolo.sh like this ...

python $progpath/$progname >/dev/null 2>&1 &

is a working solution for me. However, this does not seem to work within webserver.sh. It's wierd.

tibaultbordeaux commented 3 years ago

Ok, maybe I'm getting closer. When starting ./pi-timolo.py within the directory pi-timolo everything is working fine.

But when starting from outside of this directory, i.e. by using /home/pi/pi-timolo/pi-timolo.py

I get this error:

[Errno 2] No such file or directory: 'media/shortl'
tibaultbordeaux commented 3 years ago

Ok, here is my next update. I got rid of the above error message when using the full path in config-file, i.e. /home/pi/pi-timolo/media/shortl

Next step was adding "python3" instead of "python" in webserver.sh.

The situation now is like this: I still get

STATUS  - pi-timolo.py is Not Running ...

but: pi-timolo is working now.

pageauc commented 3 years ago

If you change the location of the pi-timolo install directory you will need to change some bash script variables eg in pi-timolo.sh. In order for bash scripts to run pi-timolo.py in the background it needs an absolute path since background shell may not have a path variable. That means some of the shell scripts would need the progpath variable edited. This is the default for pi-timilo.sh where progpath variable would need to be edited. Note the quotes must be included and no space after the =

progpath="/home/pi/pi-timolo"

progname="pi-timolo.py"

Here is the default for webserver.sh where progpath variable would need to be edited

progpath="/home/pi/pi-timolo"

progname="webserver.py".

Note these scripts are only used to start background tasks.

For more info on absolute vs relative paths see https://www.computerhope.com/issues/ch001708.htm https://www.computerhope.com/issues/ch001708.htm

If you think things are really messed up, you may want to consider deleting your current installation and do a fresh install. and run from default location. If you want to run pi-timolo from a mounted hard disk or thumb drive see wiki https://github.com/pageauc/pi-timolo/wiki/How-to-Run-Pi-Timolo-from-Another-Directory-Path https://github.com/pageauc/pi-timolo/wiki/How-to-Run-Pi-Timolo-from-Another-Directory-Path Let me know how you are doing. Stay Safe Claude ...

On Sat, Mar 13, 2021 at 4:39 AM Tibault Bordeaux @.***> wrote:

Ok, here is my next update. I got rid of the above error message when using the full path in config-file, i.e. /home/pi/pi-timolo/media/shortl

Next step was adding "python3" instead of "python" in webserver.sh.

The situation now is like this: I still get

STATUS - pi-timolo.py is Not Running ...

but: pi-timolo is working now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pageauc/pi-timolo/issues/116#issuecomment-798035353, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZH32VYBTSXQG7RFW4TTDMXD7ANCNFSM4ZC75PAQ .

-- YouTube Channel at https://www.youtube.com/user/pageaucp http://www.youtube.com/user/pageaucp GitHub Repository at https://github.com/pageauc