RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Does the RetroFlag MEGAPi work with the Raspberry Pi 1?

    Scheduled Pinned Locked Moved Help and Support
    helpretroflagcasescript
    19 Posts 2 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sage FrekeS
      Sage Freke @cyperghost
      last edited by

      @cyperghost Sorry but I have no idea, if there is one I didn't make it. I'm using just the vanilla image, downloaded from here: https://github.com/RetroPie/RetroPie-Setup/releases/download/4.4/retropie-4.4-rpi1_zero.img.gz

      This is the 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=1000
      
      # Uncomment some or all of these to enable the optional hardware interfaces
      dtparam=i2c_arm=off
      #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
      core_freq=500
      sdram_freq=600
      over_voltage=6
      enable_uart=1
      

      I took this config from the FAT partition, and while I was navigating the SD I noticed an "overlays" folder.

      These are the files inside it:

      "J:\overlays\ads1115.dtbo"
      "J:\overlays\ads7846.dtbo"
      "J:\overlays\akkordion-iqdacplus.dtbo"
      "J:\overlays\allo-boss-dac-pcm512x-audio.dtbo"
      "J:\overlays\allo-digione.dtbo"
      "J:\overlays\allo-piano-dac-pcm512x-audio.dtbo"
      "J:\overlays\allo-piano-dac-plus-pcm512x-audio.dtbo"
      "J:\overlays\applepi-dac.dtbo"
      "J:\overlays\at86rf233.dtbo"
      "J:\overlays\audioinjector-addons.dtbo"
      "J:\overlays\audioinjector-wm8731-audio.dtbo"
      "J:\overlays\audremap.dtbo"
      "J:\overlays\bmp085_i2c-sensor.dtbo"
      "J:\overlays\dht11.dtbo"
      "J:\overlays\dionaudio-loco.dtbo"
      "J:\overlays\dionaudio-loco-v2.dtbo"
      "J:\overlays\dpi18.dtbo"
      "J:\overlays\dpi24.dtbo"
      "J:\overlays\dwc2.dtbo"
      "J:\overlays\dwc-otg.dtbo"
      "J:\overlays\enc28j60.dtbo"
      "J:\overlays\enc28j60-spi2.dtbo"
      "J:\overlays\exc3000.dtbo"
      "J:\overlays\fe-pi-audio.dtbo"
      "J:\overlays\goodix.dtbo"
      "J:\overlays\googlevoicehat-soundcard.dtbo"
      "J:\overlays\gpio-ir.dtbo"
      "J:\overlays\gpio-ir-tx.dtbo"
      "J:\overlays\gpio-key.dtbo"
      "J:\overlays\gpio-poweroff.dtbo"
      "J:\overlays\gpio-shutdown.dtbo"
      "J:\overlays\hifiberry-amp.dtbo"
      "J:\overlays\hifiberry-dac.dtbo"
      "J:\overlays\hifiberry-dacplus.dtbo"
      "J:\overlays\hifiberry-digi.dtbo"
      "J:\overlays\hifiberry-digi-pro.dtbo"
      "J:\overlays\hy28a.dtbo"
      "J:\overlays\hy28b.dtbo"
      "J:\overlays\i2c0-bcm2708.dtbo"
      "J:\overlays\i2c1-bcm2708.dtbo"
      "J:\overlays\i2c-bcm2708.dtbo"
      "J:\overlays\i2c-gpio.dtbo"
      "J:\overlays\i2c-mux.dtbo"
      "J:\overlays\i2c-pwm-pca9685a.dtbo"
      "J:\overlays\i2c-rtc.dtbo"
      "J:\overlays\i2c-rtc-gpio.dtbo"
      "J:\overlays\i2c-sensor.dtbo"
      "J:\overlays\i2s-gpio28-31.dtbo"
      "J:\overlays\iqaudio-dac.dtbo"
      "J:\overlays\iqaudio-dacplus.dtbo"
      "J:\overlays\iqaudio-digi-wm8804-audio.dtbo"
      "J:\overlays\justboom-dac.dtbo"
      "J:\overlays\justboom-digi.dtbo"
      "J:\overlays\lirc-rpi.dtbo"
      "J:\overlays\mbed-dac.dtbo"
      "J:\overlays\mcp23s17.dtbo"
      "J:\overlays\mcp2515-can0.dtbo"
      "J:\overlays\mcp2515-can1.dtbo"
      "J:\overlays\mcp3008.dtbo"
      "J:\overlays\mcp3202.dtbo"
      "J:\overlays\mcp23017.dtbo"
      "J:\overlays\media-center.dtbo"
      "J:\overlays\midi-uart0.dtbo"
      "J:\overlays\midi-uart1.dtbo"
      "J:\overlays\mmc.dtbo"
      "J:\overlays\mpu6050.dtbo"
      "J:\overlays\mz61581.dtbo"
      "J:\overlays\papirus.dtbo"
      "J:\overlays\pi3-act-led.dtbo"
      "J:\overlays\pi3-disable-bt.dtbo"
      "J:\overlays\pi3-disable-wifi.dtbo"
      "J:\overlays\pi3-miniuart-bt.dtbo"
      "J:\overlays\pibell.dtbo"
      "J:\overlays\piscreen.dtbo"
      "J:\overlays\piscreen2r.dtbo"
      "J:\overlays\pisound.dtbo"
      "J:\overlays\pitft22.dtbo"
      "J:\overlays\pitft28-capacitive.dtbo"
      "J:\overlays\pitft28-resistive.dtbo"
      "J:\overlays\pitft35-resistive.dtbo"
      "J:\overlays\pps-gpio.dtbo"
      "J:\overlays\pwm.dtbo"
      "J:\overlays\pwm-2chan.dtbo"
      "J:\overlays\pwm-ir-tx.dtbo"
      "J:\overlays\qca7000.dtbo"
      "J:\overlays\README"
      "J:\overlays\rotary-encoder.dtbo"
      "J:\overlays\rpi-backlight.dtbo"
      "J:\overlays\rpi-cirrus-wm5102.dtbo"
      "J:\overlays\rpi-dac.dtbo"
      "J:\overlays\rpi-display.dtbo"
      "J:\overlays\rpi-ft5406.dtbo"
      "J:\overlays\rpi-proto.dtbo"
      "J:\overlays\rpi-sense.dtbo"
      "J:\overlays\rpi-tv.dtbo"
      "J:\overlays\rra-digidac1-wm8741-audio.dtbo"
      "J:\overlays\sc16is750-i2c.dtbo"
      "J:\overlays\sc16is752-i2c.dtbo"
      "J:\overlays\sc16is752-spi1.dtbo"
      "J:\overlays\sdhost.dtbo"
      "J:\overlays\sdio.dtbo"
      "J:\overlays\sdio-1bit.dtbo"
      "J:\overlays\sdtweak.dtbo"
      "J:\overlays\smi.dtbo"
      "J:\overlays\smi-dev.dtbo"
      "J:\overlays\smi-nand.dtbo"
      "J:\overlays\spi0-cs.dtbo"
      "J:\overlays\spi0-hw-cs.dtbo"
      "J:\overlays\spi1-1cs.dtbo"
      "J:\overlays\spi1-2cs.dtbo"
      "J:\overlays\spi1-3cs.dtbo"
      "J:\overlays\spi2-1cs.dtbo"
      "J:\overlays\spi2-2cs.dtbo"
      "J:\overlays\spi2-3cs.dtbo"
      "J:\overlays\spi-gpio35-39.dtbo"
      "J:\overlays\spi-rtc.dtbo"
      "J:\overlays\superaudioboard.dtbo"
      "J:\overlays\sx150x.dtbo"
      "J:\overlays\tinylcd35.dtbo"
      "J:\overlays\uart0.dtbo"
      "J:\overlays\uart1.dtbo"
      "J:\overlays\upstream.dtbo"
      "J:\overlays\upstream-aux-interrupt.dtbo"
      "J:\overlays\vc4-fkms-v3d.dtbo"
      "J:\overlays\vc4-kms-v3d.dtbo"
      "J:\overlays\vga666.dtbo"
      "J:\overlays\w1-gpio.dtbo"
      "J:\overlays\w1-gpio-pullup.dtbo"
      "J:\overlays\wittypi.dtbo"
      "J:\overlays\adau1977-adc.dtbo"
      "J:\overlays\adau7002-simple.dtbo"
      "J:\overlays\ads1015.dtbo"
      
      cyperghostC 1 Reply Last reply Reply Quote 0
      • cyperghostC
        cyperghost @Sage Freke
        last edited by

        @Sage-Freke you can try to use the Multi Switch Shutdown script because this will initiate the GPIOs but that should also do the original script. He you use multi switch script you need to follow the instructions step by step

        Sage FrekeS 1 Reply Last reply Reply Quote 1
        • Sage FrekeS
          Sage Freke @cyperghost
          last edited by Sage Freke

          @cyperghost This one? https://github.com/crcerror/retroflag-picase That's the first one I tried.

          A few messages ago you said that "Pi 1B+, 2, 3B, 3B+, 3A+ got all the same GPIO layout". Does this mean that the Pi Zero has a different layout? If this is the case then that's the problem, because the image I downloaded is for the Pi1 and Pi Zero.

          Isn't there a way to manually set pin 7 and pin 8 to OUT, instead of what they're set now?

          cyperghostC 1 Reply Last reply Reply Quote 0
          • cyperghostC
            cyperghost @Sage Freke
            last edited by cyperghost

            @Sage-Freke All RPi (expect the first series of the Raspberry Pie) have the same GPIO layout for sure. If you installed wPi then try to set GPIO3 to high and set GPIO7 to output (that's mandentory!)

            If I compare the python script that is used by RetroPie and the one for Recalbox/Batocera then RetroPie script does not initialze the GPIOs and that maybe the reason why the script is not working on your device.

            So I think it is worth to use the MultiSwitch Shutdown Script because this inits the GPIOs, too. You can follow the instructions here - Step by Step.I tested the RetroFlag script on a 1B+ and it worked but I lost that unit.

            You downloaded the correct image.... Pi1 and Pi0 is the right choice.

            Sage FrekeS 2 Replies Last reply Reply Quote 1
            • Sage FrekeS
              Sage Freke @cyperghost
              last edited by

              @cyperghost It sort of works but ON and OFF seem swapped, so let's say that the Pi is powered off:
              -when I switch to ON nothing happens, but
              -when I switch to OFF again the Pi powers it on and then immediately starts the shutdown script and powers it off again.

              While If the Pi is already powered on (by manually connecting the power cord): reset works, and the power off switch works correctly, but at the next start it does what I described above.

              P.S. now pin7 and pin8 are correctly set to OUT

              1 Reply Last reply Reply Quote 0
              • Sage FrekeS
                Sage Freke @cyperghost
                last edited by Sage Freke

                @cyperghost P.S. I didn't uninstall the previous scripts.

                First I installed this: https://github.com/crcerror/retroflag-picase
                When I saw it wasn't working I installed this: https://github.com/RetroFlag/retroflag-picase

                And then I installed yours, maybe they're interfering in some way?

                cyperghostC 1 Reply Last reply Reply Quote 0
                • cyperghostC
                  cyperghost @Sage Freke
                  last edited by cyperghost

                  @Sage-Freke said in Does the RetroFlag MEGAPi work with the Raspberry Pi 1?:

                  First I installed this: https://github.com/crcerror/retroflag-picase
                  When I saw it wasn't working I installed this: https://github.com/RetroFlag/retroflag-picase

                  It does not matter which of these scripts you install. In the base they all work equal. Power button shuts down the Pie and Reset button is doing some action....

                  Please edit rc.local with sudo nano /etc/rc.local and remove or comment the line with python /opt/Retroflag..... and do a reboot.
                  Then the script is disabled and the multi switch script will works standalone. It could happen that those scripts interfering with each other (but not the two python script mentioned above)

                  Sage FrekeS 1 Reply Last reply Reply Quote 1
                  • Sage FrekeS
                    Sage Freke @cyperghost
                    last edited by

                    @cyperghost I tried a fresh install on a new SD card (I just enabled SSH and set up the controller).

                    After that I

                    • 1-Installed your script and rebooted: nothing happened, the switch doesn't work.
                    • 2-Installed raspi-gpio, now the switch works but badly as I described before.
                    1 Reply Last reply Reply Quote 0
                    • cyperghostC
                      cyperghost
                      last edited by cyperghost

                      @Sage-Freke I provide a modified version for this issue. I think about the power on/off issue this looks very strange.

                      1. If you edit config.txt with sudo nano /boot/config.txt and add
                        1.1 a line dtoverlay=gpio-poweroff,gpiopin=4,active_low=1,input=1 to it
                        1.2 and reboot
                        Does this change some behaviour?

                      Annother approach... if first will fail (then please remove the changes made to config.txt)
                      2. If you use the modified script I can provide here
                      2.1 Please remove or comment old version in autostart.sh
                      2.2 Follow instructions I've posted here
                      2.3 Download with wget https://raw.githubusercontent.com/crcerror/ES-generic-shutdown/master/multi_switch086.sh
                      2.4 Remeber the filename change to multi_switch086.sh

                      I hope that this helps now

                      Sage FrekeS 1 Reply Last reply Reply Quote 1
                      • Sage FrekeS
                        Sage Freke @cyperghost
                        last edited by Sage Freke

                        @cyperghost With the first solution the mechanical behaviour is the same, with the only difference that it freezes at shutdown (Kernel panic):
                        alt text

                        With multi_switch086.sh it finally works (thanks!) but ON and OFF are indeed swapped: the pi powers on with OFF and shuts-down with ON.
                        I'm wondering if it's possible just a quick swap of the on and off functions in the script, but if it's too much of a hassle I'll just leave as it is. You've done more than enough, thank you :)

                        cyperghostC 1 Reply Last reply Reply Quote 0
                        • cyperghostC
                          cyperghost @Sage Freke
                          last edited by cyperghost

                          @Sage-Freke Well that is not the problem....
                          Go to SSH and what is the output of raspi-gpio get 3
                          it should look like level=1 fsel=0 func=INPUT (maybe there are some values changed)

                          Then you take your output and edit this line in the script with your output then it should work.

                          With multi_switch086.sh it finally works (thanks!) but ON and OFF are indeed swapped: the pi powers on with OFF and shuts-down with ON.

                          That's strange! But that is the reason why the python scripts never seems to work.

                          Sage FrekeS 1 Reply Last reply Reply Quote 1
                          • Sage FrekeS
                            Sage Freke @cyperghost
                            last edited by Sage Freke

                            @cyperghost The output of my raspi-gpio get 3 was "level=0 fsel=0 func=INPUT", but if I put it in line 322 the Pi always turns off as soon as emulationstation loads, even if completely disconnected from the case.

                            However, I just realised something... the power socket on the MEGAPi case it's not just a cutout, like the HDMI port, but it has its own little board, I didn't notice until now, I just mindlessly plugged the power directly to the Pi, and that was the problem, the multi_switch.sh now works perfectly. Sorry for wasting your time :( (however, the fact that multiswitch086.sh almost worked without using the power board was in itself impressive).

                            As a partial way to make amends I'll correct an error on the installation instructions of the script:

                            Here you have to add a sudo before chmod, otherwise it gives you "permission denied"

                            wget https://raw.githubusercontent.com/crcerror/ES-generic-shutdown/master/multi_switch.sh && chmod +x multi_switch.sh
                            
                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post

                            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.