-
Notifications
You must be signed in to change notification settings - Fork 528
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
rpi-retroflag-AdvancedSafeShutdown failing on GPIO.wait_for_edge #12953
Comments
I changed the code in the script like this to replace the wait_for_edge calls with loops checking the pin states, so it runs for now. I don't think this would be the ideal solution, but I'm not experienced with RPi programming so I didn't look any further. def poweroff():
while True:
### New:
while GPIO.input(powerPin) == GPIO.LOW:
time.sleep(0.1)
while GPIO.input(powerPin) == GPIO.HIGH:
time.sleep(0.01)
###Orig:
# GPIO.wait_for_edge(powerPin, GPIO.FALLING)
output = int(subprocess.check_output(['batocera-es-swissknife', '--espid']))
if output:
os.system("batocera-es-swissknife --shutdown")
else:
os.system("shutdown -h now")
#blinks the LED to signal button being pushed
def ledBlink():
while True:
GPIO.output(ledPin, GPIO.HIGH)
### New:
while GPIO.input(powerPin) == GPIO.HIGH:
time.sleep(0.01)
###Orig:
# GPIO.wait_for_edge(powerPin, GPIO.FALLING)
start = time.time()
while GPIO.input(powerPin) == GPIO.LOW:
GPIO.output(ledPin, GPIO.LOW)
time.sleep(0.2)
GPIO.output(ledPin, GPIO.HIGH)
time.sleep(0.2)
#resets the pi
def reset():
while True:
### New:
while GPIO.input(resetPin) == GPIO.LOW:
time.sleep(0.1)
while GPIO.input(resetPin) == GPIO.HIGH:
time.sleep(0.01)
###Orig:
# GPIO.wait_for_edge(resetPin, GPIO.FALLING)
output = int(subprocess.check_output(['batocera-es-swissknife', '--espid']))
output_rc = int(subprocess.check_output(['batocera-es-swissknife', '--emupid'])) |
please come on Discord to discuss & do some testing. The later kernel requires a change of library |
I'm happy to run any tests you give me whenever I have a moment, but I won't be available for any live discussion for the next two weeks. |
Batocera build version
40 2024/08/02 00:36
Your architecture
Raspberry Pi 4
Your Graphic Processor Unit(s) (GPU)
Raspberry Pi 4
Issue description
Trying o get the buttons on a SUPERPI 4 case working. As they did nothing I checked the PID stored in /tmp/rpi-retroflag-AdvancedSafeShutdown.pid and it always points to a non-existant process.
So I tried running the respective script
rpi-retroflag-AdvancedSafeShutdown
directly but it always fails with this output:This is a fresh installation of Batocera, running
/etc/init.d/S92switch setup
was the only thing I did trying to get this working.Detailed reproduction steps
Raspberry Pi 4 in a SUPERPI 4 case.
Fresh installation of Batocera.
Buttons not working (as expected) so ran
/etc/init.d/S92switch setup
and selected RETROFLAG_ADV.Rebooted, still not working.
Checked if
rpi-retroflag-AdvancedSafeShutdown
was running - not the case but pid-file exists.Tried running it manually - error as above.
Details of any attempts to fix this yourself
Nothing yet, only searched google and issues here for others having the problem but couldn't find anything specific to these scripts. Only general Raspberry + Python hints on this method no longer being supported.
Details of any modifications you have made to Batocera.
None
Logs and data
No response
The text was updated successfully, but these errors were encountered: