Camble safe shutdown script help

Having trouble with your GBZ build? Ask your questions here!
Post Reply
Slimpreaper
Posts: 13
Joined: Fri May 11, 2018 11:26 pm

Camble safe shutdown script help

Post by Slimpreaper » Fri Sep 14, 2018 12:55 am

Hi everyone im after some help.
Command prompt stuff is new to me and i am having some issues running the script for the generic safe shutdown. Ive edited the script and im up to the following step:

echo "@reboot /usr/bin/nice -n 19 /usr/bin/python ~/Safe-Power-Monitor/safe_power_monitor.py" >> mycron; crontab mycron;rm mycron
If you would prefer to test the script first, run it once without adding to startup.

Note: if you chose to let the script alter /boot/config.txt for you, it will still reboot at this point, but will not run on startup.

python ~/Safe-Power-Monitor/safe_power_monitor.py

Are all the characters nominated physically entered? For example " or >>
Where it says to put " it shows up as @ and where it says to put @ it shows up as "

I've typed exactly as it says and it just puts me back to the retro pie command prompt.

Thanks for your help

Slimpreaper
Posts: 13
Joined: Fri May 11, 2018 11:26 pm

Re: Camble safe shutdown script help

Post by Slimpreaper » Fri Sep 14, 2018 4:17 pm

Never mind.
I used ssh and copy paste from github rather than direct type at command prompt on pi.
I also swapped to the GBZ monitor instead.

Now I've discovered my GBZ no longer powers up through the gearbest booster :/

Old man
Posts: 4
Joined: Mon Sep 17, 2018 7:42 am

Re: Camble safe shutdown script help

Post by Old man » Mon Sep 17, 2018 7:54 am

Hi, I'm also a software newbie and beating my head against a wall at getting Camble's safeshutdown script to autostart on boot.

For some reason it just won't start on boot - or, if it is, it isn't working! I've uninstalled and reinstalled the script from GitHub but still no joy. If I ssh in and run the safe power monitor py file then it works a charm but only that one time, obviously.

This is my first, and likely only, Gameboy zero build (for my kids) and everything else is running fine, much to my shock. Camble's board and software is great-if only I could get it to autostart each time! Any help greatly appreciated. Cheers.

User avatar
YaYa
Posts: 2042
Joined: Mon Jun 26, 2017 12:42 pm
Location: brittany - France
Has thanked: 984 times
Been thanked: 839 times
Contact:

Re: Camble safe shutdown script help

Post by YaYa » Mon Sep 17, 2018 9:55 am

Does the script loads or not, let’s start from here !

After boot, type top in the command line to see running processes.... tell us if the script is running

Old man
Posts: 4
Joined: Mon Sep 17, 2018 7:42 am

Re: Camble safe shutdown script help

Post by Old man » Wed Sep 19, 2018 2:05 pm

Thanks! I just tried that and the script isn’t showing.

My /boot/config.txt file has the following line in it:

dtoverlay=gpio-poweroff:gpiopin="22",active_low="y"

And the most recent entries in the log.txt file are:

2018-09-17 14:13:33 [80] Reading /boot/config.txt took 0.2353 seconds.
2018-09-17 14:13:33 [30] Adafruit PowerBoost is selected.
2018-09-17 15:27:35 [11] Safe Power Monitor script running.
2018-09-17 15:27:35 [80] Reading /boot/config.txt took 0.7256 seconds.
2018-09-17 15:27:35 [30] Adafruit PowerBoost is selected.

My crontab file just has this one entry:

@reboot /usr/bin/nice -n 19 /usr/bin/python ~/Safe-Power-Monitor/safe_power_monitor.py

I just don’t know what else to do to get this to the script to start on boot. I can run it from the command line and it works like a charm then.

Thanks

alesch
Posts: 5
Joined: Tue Oct 16, 2018 7:25 am
Been thanked: 1 time

Re: Camble safe shutdown script help

Post by alesch » Tue Oct 16, 2018 7:30 am

I have the exact same problem: When starting the script manually everthing works perfect. But I don't get it to start automaticaly when booting up the pi.
Anyone an idea what to do?

Old man
Posts: 4
Joined: Mon Sep 17, 2018 7:42 am

Re: Camble safe shutdown script help

Post by Old man » Thu Oct 18, 2018 11:57 am

Wahey, I’m not alone! If anyone can help with this then it’d let me regard the build as finished. My kids have learned to manually shutdown using the menu system but it’d be so much simpler if they could just use the switch; darent let their pals near it meantime...

alesch
Posts: 5
Joined: Tue Oct 16, 2018 7:25 am
Been thanked: 1 time

Re: Camble safe shutdown script help

Post by alesch » Fri Oct 19, 2018 7:09 am

So what happens, if you turn use the switch? Does it turn the system off?
Because when I use the switch, nothing happens. I then can shutdown the pi and after that I hear the sound of the power beeing disconected. If i shut the pi down without using the switch first, it ends in a screen with text. In that stage I can use the switch to turn the thing off.

Old man
Posts: 4
Joined: Mon Sep 17, 2018 7:42 am

Re: Camble safe shutdown script help

Post by Old man » Fri Oct 19, 2018 8:41 am

Hi Alesch, when I use the switch it turns on and boots normally - but it doesn’t auto run Camble’s python script. If I want to switch it off then the manual switch does nothing unless I've gone through the RetroPie menus and selected shutdown - at that point it will shutdown but keep the screen going unless I then turn it off using the switch. In other words, it does exactly the same as yours does.

Whereas if I boot up, ssh in and manually run the python script and then use the manual switch, it commences a software shutdown, just as it should. The problem for me is that I can’t seem to get the script to auto run on boot. It works fine once it’s up and running in the background. I’ve done fresh installs from Camble’s github but it hasn’t fixed the auto run issue.

Cheers
Andrew

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests