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

power off after two minutes #22

Open
naturenergy opened this issue Jan 23, 2022 · 1 comment
Open

power off after two minutes #22

naturenergy opened this issue Jan 23, 2022 · 1 comment

Comments

@naturenergy
Copy link

naturenergy commented Jan 23, 2022

Hello!

I have an issue where the Pi (Arm 6 Model A rev2) using Dietpi 8.02 OS which I understand is based on Bullseye Debian.

Switch LED doesn't light up when Pi fully booted, then powers off after about 2 minutes (sudden off no gentle shutdown - so risk of card corruption).

I installed the code and switch as per instructions and it has worked fine previously on raspberry OS lite (headless)

Keen to use DietPi however, and like its functionality.

I used the default pins 7 and 11, and tried again changing to pins 11,15 (editing the script) same result. Also tried changing the power lead and have a good 2A supply which is ample for model A.

Ran the service status diagnostic (with switch attached) :-

● piswitch.service - Starts softshut for Pi Switch
Loaded: loaded (/etc/systemd/system/piswitch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2022-01-23 09:32:20 GMT; 3min 34s ago
Process: 182 ExecStart=/opt/piswitch/softshut.py (code=exited, status=127)
Main PID: 182 (code=exited, status=127)
CPU: 33ms

Jan 23 09:32:19 RPi1PV systemd[1]: Started Starts softshut for Pi Switch.
Jan 23 09:32:20 RPi1PV softshut.py[182]: /usr/bin/env: ‘python’: No such file or directory
Jan 23 09:32:20 RPi1PV systemd[1]: piswitch.service: Main process exited, code=exited, status=127/n/a
Jan 23 09:32:20 RPi1PV systemd[1]: piswitch.service: Failed with result 'exit-code'.

Then I tested it without the switch and the OS remains stable and on for a long time.

Looking at above - perhaps python hasn't been installed correctly by default in Dietpi? Any ideas? Thanks!

@tvoverbeek
Copy link
Contributor

I have no experience with DietPi, but from your status output it is obvious that the 'python' command is not defined.
In a terminal window (with switch not attached) try to run the command python which will most likely fail.
I guess only python3 is installed. To check this, try to run the command python3 in the terminal window.
If that works change the first line in softshut.py to /usr/bin/env python3.
If that does not work you will have to install python (preferably python3, since python2 is not maintained any more).

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

2 participants