METADATA not saving - Favorites will never remain tagged
-
@cyperghost I know! Our frustration is real. I mean it works as it should with Yahmez's script. And just to be sure I am following your instructions immaculately, yours is the ONLY script I'm running on this fresh image.
Geez it was embarrassing you guys telling me to use Notepad++ and how to invoke the script LOL. but I do appreciate all your efforts to walk me through it. I'm just thinking you guys must be getting as frustrated with me as I'm getting frustrated with this not working - I'm yelling at this damn box like "you're making an idiot out of me in front of the community, damn you!" haha
-
@cyperghost
I am late to the game here but if my script works as intended (minus saving metadata which was never implemented) and cypherghost's script is not seeing the button presses then the logical thing would be to compare the two scripts and see how they are being handled differently. -
@yahmez ;)
Thank you for stepping in my friend.
So let's compare ;)#!/usr/bin/python import RPi.GPIO as GPIO import os, time GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP) #Reset switch GPIO.setup(24, GPIO.IN, pull_up_down=GPIO.PUD_UP) #Power switch GPIO.setup(25, GPIO.OUT) #ON control GPIO.output(25, GPIO.HIGH) while True: if (GPIO.input(24)): time.sleep(0.25) else: print ("Shutting down...") os.system("sudo shutdown -h now") break if (GPIO.input(23)): time.sleep(0.25) else: print ("Resetting...") os.system("sudo reboot now") break
and
script version from here
I did not implent reset handling here ;) -
@cyperghost Maybe the wires are connected to other pins ?
-
-
If it just cuts power upon turning off the power switch it means that the on control pin is not going high on boot.
-
@cyperghost Python is a sneaky snake...
-
-
@cyperghost I will give it a try this weekend if I can but I have relatives coming to stay so I'm not 100% sure I'll be able to till next week.
-
@Semper-5
Can you try gpio readall to verify that the on control pin is high? -
@yahmez No problem... I would be glad to hear your outfindings but take your time.
-
@cyperghost I am no coding guy. Does your BASH script enable the internal pullup on 25?
-
@yahmez No! I don't use wiringpi.... or raspi-gpio.
But would be possible with bash, too
raspi-gpio set $trigger_pin ip pu echo "monitoring BCM $trigger_pin" pin_state() { raspi-gpio get $trigger_pin | grep -c "level=0 fsel=0 func=INPUT" } shutdown_trigger() { if [ `pin_state` = 1 ]; then echo "BCM $trigger_pin asserted low" ....
-
@cyperghost That is the problem then, at least part of it.
-
@yahmez afaik this should work without the pullup. As I said, I sadly have no POLOLU switch available. Is there no connection to ground from the POLOLU to the GPIO?
-
sorry for the late reply. I'm trying to get out of work.
my GPIO config is exactly as configured in Yahmez's tutorial.
23 reset
24 power
25 power (ON)my GPIO readall with cyperghost's script
but as we see here, its not looking very live.just as a reminder, I can get Yahmez's to fire up with no problem - just to rule out the possibility of bad wiring and I did confirm that my wiring looked good to a few other people who are VERY familiar with this mod.
EDIT: SORRY I didn't run the gpio readall with the script running. GPIO 25 has a difference now
-
@cyperghost No. It will absolutely not work without the pullup. There is a reason I put it in my script :p
-
-
@semper-5 Looks like the script is not setting GPIO 25 high according to your GPIO readall
-
@Semper-5 Use
sudo
command for thisecho "$GPIOpin2" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio$GPIOpin2/direction echo "1" > /sys/class/gpio/gpio$GPIOpin2/value
With GPIOpin2=25 it will be a self runner ;)
@Yahmez Ah so you tried out without using the pullups? That's interesting. So I should investigate this ;) As I said: No POLOLU switch, no testing area.
So I say thank you to both of you! You should integrate a small 3,3V regulator. Then it's no problem to generate this. So intead of
python
os.system("sudo shutdown -h now")
hook to a stripped down script with
sudo
command# Detect PID or EMULATOR NAMES emucall="$(sed '4!d; s/\([\\"]\|[[:alnum:]_]\+=[^ ]* \)//g; s/[][(){}^$*.|+? ]/\\&/g' /dev/shm/runcommand.info)" espid="$(pgrep -f "/opt/retropie/supplementary/.*/emulationstation([^.]|$)")" # Handle calls and send TERM signal if [[ -n "$emucall" ]]; then emupid="$(pgrep -f "$emucall" | tr '\n' ' ')" pkill -P "$(echo $emupid | tr ' ' ',')" kill -9 "$emupid" sleep 4 fi if [[ -n "$espid" ]]; then touch /tmp/es-shutdown && chown pi:pi /tmp/es-shutdown kill "$espid" exit fi poweroff
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.