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

Auto-startup not working with RPi Zero WH #256

Open
ghostkills12 opened this issue Jan 19, 2024 · 8 comments
Open

Auto-startup not working with RPi Zero WH #256

ghostkills12 opened this issue Jan 19, 2024 · 8 comments

Comments

@ghostkills12
Copy link

ghostkills12 commented Jan 19, 2024

Hi,

I've made the wordclock and is fully functional when booted from a laptop via ssh. However, when I change the crontab to get wordclock.py to start automatically on boot nothing happens. I still need to boot the wordclock manually via ssh. I've also tried other ways like cron, rc.local, or systemd service, but I am not familiar with any of those techniques and can't get them to work either.
I am using a Raspberry Pi Zero WH.

@MichaelSeitz98
Copy link

Hi ghostkills12,

i had similar issues, but I just forgot the "sudo" in sudo crontab -e and @reboot sudo python3 /home/pi/rpi_wordclock/wordclock.py. I just activated a "non-sudo" crontab, which resulted in nothing...Did you check that already?

@ghostkills12
Copy link
Author

HI Michael! I made sure to use sudo in crontab (and booting it via ssh), so that is not the issue. Thanks for your quick response though!

Cheers,
Jurre

@FrankX0
Copy link
Contributor

FrankX0 commented Jan 21, 2024

Please check #172.
Maybe it helps.

@ghostkills12
Copy link
Author

Thanks for the reply FrankXO! Unfortunately, the solution you suggested didn't work. I've looked into the crontab logs, which shows the following:

  git config --global --add safe.directory /home/wordclock/rpi_wordclock

Traceback (most recent call last):
File "/home/wordclock/rpi_wordclock/wordclock.py", line 201, in
word_clock = wordclock()
File "/home/wordclock/rpi_wordclock/wordclock.py", line 31, in init
self.currentGitHash = subprocess.check_output(["git", "describe", "--tags"], cwd=self.basePath).strip().decode()
File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'describe', '--tags']' returned non-zero exit status 128.

@FrankX0
Copy link
Contributor

FrankX0 commented Jan 22, 2024

It looks like the code is trying to read the version from the git information, but it cannot find it (exit code 128).
Can you comment-out lines 31 and 32 in wordclock.py and try again?

@ghostkills12
Copy link
Author

That did the trick! Awesome FrankXO, your help is much appreciated :D

@oxivanisher
Copy link
Contributor

oxivanisher commented Jan 22, 2024

This will happen more and more to all new installs. Please see this PR with a fix: #250

Your problem is with the new git version and a "not so clean way" to start the wordclock trough cron as root when it gets installed as user. See my comments in #245, they will help you with your current problem.

@ghostkills12
Copy link
Author

ghostkills12 commented Jan 22, 2024

Thank you for the tip oxivanisher. I completely agree that running the wordclock as root is not a clean way and that the issues with this quick fix may rise again in future updates. I'll have a good look at those PR's tomorrow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants