aceinnolab / Inkycal

Create awesome e-paper dashboards within minutes! Modularity? Check! Python3? Check? Works on Raspberry Pi Zero W? Check! Support for own modules? Check!
https://aceinnolab.github.io/Inkycal/
GNU General Public License v3.0
1.19k stars 126 forks source link

Issue: Fix cron for auto-restart of Inkycal #240

Closed AndBosta closed 1 year ago

AndBosta commented 1 year ago

TL;DR - Crontab is not auto launching InkyCal on boot on a RasPi.

I recently updated my Inky Cal to 2.0.2... Everything is mostly back to correct, but the steps to setup the cron found on "Running on each boot" are no longer working for me (it was good on one of the previous versions of InkyCal).

Attached is what I see when I SSH into the RasPi and run 'crontab -e' Screenshot 2023-01-22 at 7 40 37 PM

If I SSH into the RasPi after startup, I don't see the correct process when running 'htop' (process viewer).

From the terminal, I can manually start InkyCal with the following commands, and it updates the display and runs as expected: cd $HOME/Inkycal source venv/bin/activate python3 inky_run.py

Thanks for looking into this!

zAm1987 commented 1 year ago

Today I realized the same after a reboot. Crontab solution is not working in my case, too. I think had not noticed this before because I started inkycal manually a lot the last days while tinkering with it.

aceisace commented 1 year ago

@AndBosta @zAm1987 Thanks for your feedback and this info. Indeed, switching to virtual environment did break the crontab which previously used to work. I've found a fix for this, which basically boils down to running the following:

# reset crontab
crontab -r
# add updated command
(crontab -l ; echo "@reboot sleep 60 && cd $HOME/Inkycal && venv/bin/python inky_run.py &")| crontab -

Please let me know if this works for you as well. Then this issue can be closed 👍

AndBosta commented 1 year ago

@aceisace - Yes, this looks to have worked. Display has updated on boot and at the top of the hour after I implemented the change. Thank you!