[SOLVED] Camble's Safedown AND Retrogame

Having trouble with your GBZ build? Ask your questions here!
Crick
Posts: 9
Joined: Fri Sep 07, 2018 5:56 pm
Has thanked: 4 times
Been thanked: 1 time

[SOLVED] Camble's Safedown AND Retrogame

Post by Crick » Tue Jan 14, 2020 11:53 pm

Is anyone successfully running:
Retropie >4.3 &
Retrogame &
Cambles safe shutdown?

I'm running direct GPIO button input and I can have either Retrogame OR safe shutdown working but not both.

I scoured here, there and everywhere and tried adjusting the scripts a bit but I'm all out of luck and skill. I'm on my 4th fresh image and almost out of energy.

Next stop is GPIOnext but I'm not holding my breath.

Thanks guys, love the forum, been lurking a while.
Last edited by Crick on Thu Jan 16, 2020 10:18 pm, edited 1 time in total.

User avatar
infinitLoop
Posts: 405
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 176 times
Been thanked: 144 times
Contact:

Re: Camble's Safedown AND Retrogame

Post by infinitLoop » Wed Jan 15, 2020 9:18 am

I have gotten them working together. I’ve never had any luck with gpionext. What problems are hitting?

The instructions in this thread are helpful if it’s camble’s script you are having issues with

viewtopic.php?f=44&t=6611&p=70894


Usually, if one works but the other doesn’t it’s because of a gpio conflict where both scripts are trying to register the same pin.

.

Crick
Posts: 9
Joined: Fri Sep 07, 2018 5:56 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Camble's Safedown AND Retrogame

Post by Crick » Wed Jan 15, 2020 1:40 pm

Thanks, I've checked that in cambles script and Retrogame,cfg and couldn't see a conflict.
I do get kernel panic on shutdown and I tried a fresh flash with gpionext last night and ended up with the same outcome, this time gpionext failed after I installed safe shutdown on a few lines and ends on edge error same as here: https://github.com/mholgatem/GPIOnext/issues/12

I also suspect a assignment conflict or a wrongly assign pull down/up but I just can't see it.

User avatar
infinitLoop
Posts: 405
Joined: Mon Dec 24, 2018 11:46 am
Location: Portland, OR
Has thanked: 176 times
Been thanked: 144 times
Contact:

Re: Camble's Safedown AND Retrogame

Post by infinitLoop » Wed Jan 15, 2020 6:26 pm

Crick wrote:
Wed Jan 15, 2020 1:40 pm
Thanks, I've checked that in cambles script and Retrogame,cfg and couldn't see a conflict.
I do get kernel panic on shutdown and I tried a fresh flash with gpionext last night and ended up with the same outcome, this time gpionext failed after I installed safe shutdown on a few lines and ends on edge error same as here: https://github.com/mholgatem/GPIOnext/issues/12

I also suspect a assignment conflict or a wrongly assign pull down/up but I just can't see it.
well, the "kernel panic" happens when the signal doesn't get sent from the pi to the board to cut the power, so check the one you have at the keep-alive setting (22 by default) and that it's getting set correctly in the config.txt, and also that it's not in there more than once.

i think that "edge" errors are usually because it's trying to check a gpio that's already in use.

triple check the wiring, and that you are using BCM: https://pinout.xyz/

.

Crick
Posts: 9
Joined: Fri Sep 07, 2018 5:56 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Camble's Safedown AND Retrogame

Post by Crick » Wed Jan 15, 2020 10:16 pm

Yep definitely only BCM 22 assigned once & yep it's in config.txt Thanks for replying, I know how it is guiding newbs coming from years in FPV.

At this stage i'm thinking of bailing on the safe shutdown and only using on side of the switch to power up and walking away from it until I get a teensy.

It's honestly driving me crazy mostly because i'm sure it's a problem i'm creating but I can't think how to simplify it any further.
I'm literally only running pi zeio w, powerboost 1000, safe shutdown v1.2 with PB script and a screen & battery. It doesn't get much simpler and all my solders are clean and reacting perfectly.

Like any good problem this will be something simple waiting for my knowledge to catch up.

Crick
Posts: 9
Joined: Fri Sep 07, 2018 5:56 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Camble's Safedown AND Retrogame

Post by Crick » Wed Jan 15, 2020 10:19 pm

In case it triggers any issues here is my button GPIO assignment:

LEFT 21 # Joypad left
RIGHT 13 # Joypad right
UP 4 # Joypad up
DOWN 25 # Joypad down
LEFTCTRL 12 # 'A' button
LEFTALT 23 # 'B' button
Z 19 # 'X' button
X 26 # 'Y' button
SPACE 20 # 'Select' button
ENTER 16 # 'Start' button

User avatar
tinkerBOY
Posts: 709
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 205 times

Re: Camble's Safedown AND Retrogame

Post by tinkerBOY » Thu Jan 16, 2020 1:55 am

Can you paste what you have in your config.txt? Also make sure the script is running.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

Crick
Posts: 9
Joined: Fri Sep 07, 2018 5:56 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Camble's Safedown AND Retrogame

Post by Crick » Thu Jan 16, 2020 3:59 am

Which script? The safeshut down appears to prevent GPIOnext from running and I end up with the errors a few posts up when I run gpionext start

config.txt:

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on
gpu_mem_256=128
gpu_mem_512=256
gpu_mem_1024=256
overscan_scale=1

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

Crick
Posts: 9
Joined: Fri Sep 07, 2018 5:56 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Camble's Safedown AND Retrogame

Post by Crick » Thu Jan 16, 2020 4:04 am

sorry I meant GPIOnext config:

pi@retropie:~ $ gpionext config
Traceback (most recent call last):
File "/home/pi/GPIOnext/config_manager.py", line 315, in <module>
ConfigurationManager(args)
File "/home/pi/GPIOnext/config_manager.py", line 85, in __init__
gpio.setupGPIO( self.args )
File "/home/pi/GPIOnext/config/gpio.py", line 99, in setupGPIO
pins.append( pin(pinNumber, pull, args) )
File "/home/pi/GPIOnext/config/gpio.py", line 59, in __init__
bouncetime = args.debounce)
RuntimeError: Failed to add edge detection
pi@retropie:~ $

Crick
Posts: 9
Joined: Fri Sep 07, 2018 5:56 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Camble's Safedown AND Retrogame

Post by Crick » Thu Jan 16, 2020 4:16 am

Also I can see safe shutdown running in ps aux but not gpionext.

gpionext start results in nothing in command although I can see the error appear in ps as:
root 4102 166 4.1 13784 10216 ? Rs 11:12 0:01 /usr/bin/python3 -u gpionext.py --debounce 1 --combo_delay 50

Sorry for the spammy ps dump:


pi@retropie:~ $ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.7 2.3 27052 5972 ? Ss 11:00 0:06 /sbin/init
root 2 0.0 0.0 0 0 ? S 11:00 0:00 [kthreadd]
root 4 0.0 0.0 0 0 ? I< 11:00 0:00 [kworker/0:0H]
root 6 0.0 0.0 0 0 ? I< 11:00 0:00 [mm_percpu_wq]
root 7 0.1 0.0 0 0 ? S 11:00 0:01 [ksoftirqd/0]
root 8 0.0 0.0 0 0 ? S 11:00 0:00 [kdevtmpfs]
root 9 0.0 0.0 0 0 ? I< 11:00 0:00 [netns]
root 11 0.0 0.0 0 0 ? S 11:00 0:00 [khungtaskd]
root 12 0.0 0.0 0 0 ? S 11:00 0:00 [oom_reaper]
root 13 0.0 0.0 0 0 ? I< 11:00 0:00 [writeback]
root 14 0.0 0.0 0 0 ? S 11:00 0:00 [kcompactd0]
root 15 0.0 0.0 0 0 ? I< 11:00 0:00 [crypto]
root 16 0.0 0.0 0 0 ? I< 11:00 0:00 [kblockd]
root 17 0.0 0.0 0 0 ? I< 11:00 0:00 [watchdogd]
root 18 0.0 0.0 0 0 ? I< 11:00 0:00 [rpciod]
root 19 0.0 0.0 0 0 ? I< 11:00 0:00 [xprtiod]
root 20 0.0 0.0 0 0 ? I 11:00 0:00 [kworker/u2:1]
root 22 0.0 0.0 0 0 ? S 11:00 0:00 [kswapd0]
root 23 0.0 0.0 0 0 ? I< 11:00 0:00 [nfsiod]
root 33 0.0 0.0 0 0 ? I< 11:00 0:00 [kthrotld]
root 34 0.0 0.0 0 0 ? I< 11:00 0:00 [iscsi_eh]
root 35 0.0 0.0 0 0 ? I< 11:00 0:00 [dwc_otg]
root 36 0.0 0.0 0 0 ? I< 11:00 0:00 [DWC Notificatio]
root 37 0.0 0.0 0 0 ? S< 11:00 0:00 [vchiq-slot/0]
root 38 0.0 0.0 0 0 ? S< 11:00 0:00 [vchiq-recy/0]
root 39 0.0 0.0 0 0 ? S< 11:00 0:00 [vchiq-sync/0]
root 40 0.0 0.0 0 0 ? S 11:00 0:00 [vchiq-keep/0]
root 41 0.0 0.0 0 0 ? S< 11:00 0:00 [SMIO]
root 42 0.0 0.0 0 0 ? S 11:00 0:00 [irq/86-mmc1]
root 43 0.0 0.0 0 0 ? I 11:00 0:00 [kworker/0:2]
root 44 0.0 0.0 0 0 ? I 11:00 0:00 [kworker/0:3]
root 45 0.1 0.0 0 0 ? S 11:00 0:01 [mmcqd/0]
root 46 0.0 0.0 0 0 ? S 11:00 0:00 [jbd2/mmcblk0p2-]
root 47 0.0 0.0 0 0 ? I< 11:00 0:00 [ext4-rsv-conver]
root 48 0.0 0.0 0 0 ? I< 11:00 0:00 [ipv6_addrconf]
root 61 0.4 2.0 18160 5088 ? Ss 11:00 0:03 /lib/systemd/systemd-journald
root 112 0.1 1.2 14252 3232 ? Ss 11:00 0:01 /lib/systemd/systemd-udevd
root 128 0.0 0.0 0 0 ? I 11:00 0:00 [kworker/u2:2]
root 158 0.0 0.0 0 0 ? I< 11:00 0:00 [cfg80211]
root 160 0.0 0.0 0 0 ? I< 11:00 0:00 [brcmf_wq/mmc1:0]
root 161 0.0 0.0 0 0 ? S 11:00 0:00 [brcmf_wdog/mmc1]
systemd+ 190 0.0 1.5 17268 3920 ? Ssl 11:00 0:00 /lib/systemd/systemd-timesyncd
avahi 219 0.0 1.2 6388 3188 ? Ss 11:00 0:00 avahi-daemon: running [retropie.local]
root 230 0.0 0.9 5284 2408 ? Ss 11:00 0:00 /usr/sbin/cron -f
nobody 233 0.0 1.0 5280 2508 ? Ss 11:00 0:00 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket
avahi 234 0.0 0.6 6388 1556 ? S 11:00 0:00 avahi-daemon: chroot helper
root 248 0.0 0.5 27592 1368 ? SLsl 11:00 0:00 /usr/sbin/rngd -r /dev/hwrng
message+ 255 0.1 1.3 6508 3324 ? Ss 11:00 0:01 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd
root 265 0.0 1.7 7372 4324 ? Ss 11:00 0:00 /lib/systemd/systemd-logind
root 266 0.0 1.6 9988 4156 ? Ss 11:00 0:00 /sbin/wpa_supplicant -u -s -O /run/wpa_supplicant
root 268 0.0 1.1 22856 2952 ? Ssl 11:00 0:00 /usr/sbin/rsyslogd -n
root 342 0.0 0.0 0 0 ? I< 11:00 0:00 [kworker/u3:0]
root 343 0.0 0.2 2076 668 ? S 11:00 0:00 /usr/bin/hciattach /dev/serial1 bcm43xx 3000000 flow - b8:27:eb:7b:52:b6
root 344 0.0 0.0 0 0 ? I< 11:00 0:00 [kworker/u3:1]
root 348 0.0 1.5 7068 3980 ? Ss 11:00 0:00 /usr/lib/bluetooth/bluetoothd
root 792 0.0 1.1 5868 2860 tty1 Ss 11:01 0:00 /bin/login -f
root 795 0.0 2.1 10196 5344 ? Ss 11:01 0:00 /usr/sbin/sshd -D
root 796 0.0 0.0 0 0 ? I< 11:01 0:00 [kworker/0:1H]
root 823 0.0 2.0 26524 5096 ? Ss 11:01 0:00 /usr/sbin/nmbd
pi 875 0.0 2.2 9648 5568 ? Ss 11:01 0:00 /lib/systemd/systemd --user
pi 878 0.0 1.1 11300 2872 ? S 11:01 0:00 (sd-pam)
pi 886 0.0 1.1 5052 2864 tty1 S+ 11:01 0:00 -bash
pi 891 0.0 1.0 4568 2536 tty1 S+ 11:01 0:00 bash /opt/retropie/configs/all/autostart.sh
pi 892 0.0 2.4 17764 6044 tty1 Sl+ 11:01 0:00 python /home/pi/Safe-Power-Monitor/safe_power_monitor.py
pi 893 0.0 1.0 4576 2540 tty1 S+ 11:01 0:00 /bin/bash /usr/bin/emulationstation
pi 926 0.0 0.4 1880 1060 tty1 S+ 11:01 0:00 /bin/sh /opt/retropie/supplementary/emulationstation/emulationstation.sh
pi 941 1.4 9.5 101452 23820 tty1 Sl+ 11:01 0:09 /opt/retropie/supplementary/emulationstation/emulationstation
pi 1202 0.0 0.4 1880 1160 tty1 S+ 11:01 0:00 sh -c sudo /home/pi/RetroPie-Setup/retropie_packages.sh retropiemenu launch /ho
root 1203 0.0 1.3 7208 3416 tty1 S+ 11:01 0:00 sudo /home/pi/RetroPie-Setup/retropie_packages.sh retropiemenu launch /home/pi/
root 1207 0.5 4.2 12576 10672 tty1 S+ 11:01 0:03 bash /home/pi/RetroPie-Setup/retropie_packages.sh retropiemenu launch /home/pi/
root 1527 0.1 2.8 14276 7204 tty1 S+ 11:01 0:00 /usr/bin/python /home/pi/RetroPie-Setup/scriptmodules/supplementary/runcommand/
root 2006 0.0 1.5 10592 3976 ? Ss 11:02 0:00 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,w
root 2203 0.0 0.6 2864 1632 ? Ss 11:02 0:00 /sbin/dhcpcd -q -w
root 2230 0.0 3.8 12576 9632 tty1 S+ 11:02 0:00 bash /home/pi/RetroPie-Setup/retropie_packages.sh retropiemenu launch /home/pi/
root 2231 0.0 0.9 4776 2356 tty1 S+ 11:02 0:00 dialog --backtitle retropie.org.uk - RetroPie Setup. Installation folder: /opt/
root 2232 0.0 5.4 40704 13620 ? Ss 11:02 0:00 /usr/sbin/smbd
root 2233 0.0 2.2 38700 5548 ? S 11:02 0:00 /usr/sbin/smbd
root 2234 0.0 1.8 38692 4732 ? S 11:02 0:00 /usr/sbin/smbd
root 2239 0.0 2.2 40704 5588 ? S 11:02 0:00 /usr/sbin/smbd
root 2341 0.0 2.3 11516 5764 ? Ss 11:02 0:00 sshd: pi [priv]
pi 2437 0.0 1.6 11516 4156 ? S 11:02 0:00 sshd: pi@pts/0
pi 2440 0.1 1.6 6260 4224 pts/0 Ss 11:02 0:00 -bash
root 3661 0.0 0.0 0 0 ? I 11:09 0:00 [kworker/0:0]
root 3986 0.7 0.0 0 0 ? I 11:12 0:00 [kworker/u2:0]
root 4102 166 4.1 13784 10216 ? Rs 11:12 0:01 /usr/bin/python3 -u gpionext.py --debounce 1 --combo_delay 50
pi 4103 0.0 1.1 7732 2960 pts/0 R+ 11:12 0:00 ps aux

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest