Camble safe shutdown script help

Having trouble with your GBZ build? Ask your questions here!
JDMDingo
Posts: 18
Joined: Wed Dec 26, 2018 1:53 am
Has thanked: 4 times
Been thanked: 2 times

Re: Camble safe shutdown script help

Post by JDMDingo » Wed Dec 26, 2018 2:12 am

I finally received my battery and well I am having the same issue that Alesch, Old man and gambino37 are having. I shot all the voltages before I sealed up my GBZ. Here's what I got (even though I don't think it's a hardware issue), also checked the soldered pins 10 times (they were correct every time).

Switch OFF, GBZ OFF:
3v -> 0.0v
Off -> 0.0v
Low -> 0.0v
On -> 0.0v

Switch ON, BGZ ON:
3v -> 3.3v
Off -> 0.0v
Low -> 0.0v
On -> 3.3v

Switch OFF, GBZ ON:
3v -> 3.3v
Off -> 3.3v
Low -> 0.0v
On -> 3.3v

Switch will not shutdown the GBZ while it in on.

Go to shutdown in RetroPie with switch ON:
Shuts down like normal, at the end there a bunch of errors that are too small to read but deal with shutdown and the Pi stays on. Moving the switch turns it off immediately.

Go to shutdown in RetroPie with switch OFF:
Immediately powers off without shutting down.

I would really love to get this finished up as it's one of the coolest things I have ever made.

JDMDingo
Posts: 18
Joined: Wed Dec 26, 2018 1:53 am
Has thanked: 4 times
Been thanked: 2 times

Re: Camble safe shutdown script help

Post by JDMDingo » Wed Dec 26, 2018 4:52 am

I got it to work, first SSH into your GBZ:

type "sudo nano /etc/rc.local"

scroll down to the bottom, then ABOVE "Exit 0" add "sudo python /home/pi/Safe-Power-Monitor/safe_power_monitor.py &"

CTRL-X, Y, enter

Next using WINSCP, I went to the "root" folder and added the directory "Safe-Power-Monitor" and inside added the file "log.txt". When you create the log file type anything and then delete it and save.

That's it. My GBZ now starts and shuts down using the switch.
Last edited by JDMDingo on Thu Jan 17, 2019 6:24 pm, edited 1 time in total.

Ziploc99
Posts: 36
Joined: Sun Jun 17, 2018 10:02 am
Has thanked: 26 times
Been thanked: 11 times

Re: Camble safe shutdown script help

Post by Ziploc99 » Sun Jan 13, 2019 12:14 pm

JDMDingo wrote:
Wed Dec 26, 2018 4:52 am
I got it to work, first SSH into your GBZ:

type "sudo nano /etc/rc.local"

scroll down to the bottom, then ABOVE "Exit 0" add "sudo python /home/pi/Safe-Power-Monitor/safe_power_monitor.py &"

CTRL-X, Y, enter

Next using WINSCP, I went to the "root" folder and added the directory "Safe-Power-Monitor" and inside added the file "log.txt". When you create the log file type anything and then delete it and save.

That's it. My GBZ now starts and shuts down using the switch.
I could kiss you for this. I won't, but you know what I mean.

JDMDingo
Posts: 18
Joined: Wed Dec 26, 2018 1:53 am
Has thanked: 4 times
Been thanked: 2 times

Re: Camble safe shutdown script help

Post by JDMDingo » Thu Jan 17, 2019 6:21 pm

Ziploc99 wrote:
Sun Jan 13, 2019 12:14 pm
I could kiss you for this. I won't, but you know what I mean.
Glad I could help. Luckily I was taking an intro to Python class at Uni last semester so I got a better understanding of what was going on. Now if I could get the battery monitor to work. I do know when my battery gets lows though because the GBZ slows down to a couple frames a second.....Time to save state and plug her in.

User avatar
Refusor
Posts: 6
Joined: Mon Feb 25, 2019 12:42 pm
Has thanked: 2 times
Been thanked: 6 times

Re: Camble safe shutdown script help

Post by Refusor » Mon Feb 25, 2019 2:54 pm

Hi everyones,

I've managed it, with the following solution (working on retropie 4.4 with Camble Safe Shutdown for Adafruit 1000c) :

Connect with SSH

cd ~;git clone https://github.com/Camble/Safe-Power-Monitor.git

Make your changes to the variables at the top of the script and press Ctrl+X to quit. Press 'Y' to save


sudo nano /opt/retropie/configs/all/autostart.sh

Insert the line

python ~/Safe-Power-Monitor/safe_power_monitor.py &
then update

emulationstation #auto

with

emulationstation

press Ctrl+X to quit. Press 'Y' to save

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

Re: Camble safe shutdown script help

Post by Old man » Sat Jun 01, 2019 8:42 am

JDMDingo, I salute you. :D No way would I have realised this was the glitch. Your solution works a treat and is definitely the fix for those having similar trouble. It turns out I had a missing / in my rc.local file but what made it all work was the installation of a new directory and log file in the root directory. For those without Winscp, I just used ssh and typed “sudo su” to get root privileges, cd to root and then mkdir Safe-Power-Monitor, followed by creating the blank log.txt file.

Can’t convey how happy I am at this finally working. I’d given up on this for months and really glad I check back to the website today. Cheers!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest