Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Control gpio at boot for relays

    GamePad/GPIO/USB encoder
    control gpio boot relays
    2
    4
    1696
    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.
    • paul-mcmaster
      paul-mcmaster last edited by

      I have added a nice 12v led marque style bar to by bartop. I'm trying to use a sainsmart 4 relay board to turn the leds and speakers on and off with the pi. I have the reset on/off led setup wired now. I read that wiringpi was added in 4.0.0 beta 1. following the wiringpi examples for a simple blink script returns gcc command not found. how can I pull a gpio to ground on boot?   Thanks as always. attached is pic of the fake coin door I 3d printed. the onoffresetled worked perfect with it thank you

      1 Reply Last reply Reply Quote 0
      • paul-mcmaster
        paul-mcmaster last edited by

        ok I've had time to think about this problem more and I believe I have a solution though I havent tested it yet.

        Since I have the onoff switch which toggles a pin to ground AND I have a 4 relay module I should be able to do it all.

        I'll have the onoff switch toggle ground to all 4 relays, then use one relay to toggle ground to the onoff gpio pin. the other three will operate the speakers, led lighting, and power to the monitor.

        I'll report back with results in case it is helpful to others

        1 Reply Last reply Reply Quote 0
        • Substring
          Substring last edited by

          I won't say i understand everything crystal clear but :

          • wiringpi returns a gcc error : no gcc on recalbox and anyway afair wiringpi is in python but i can be wrong
          • once again, python is the easiest language to play around with gpio. If you want to set gpio values at boot, you will need to write a script in /etc/init.d

          Former dev - Please reply with @substring so that i am notified when you answer me
          Ex dev - Merci de me répondre en utilisant @substring pour que je sois notifé

          paul-mcmaster 1 Reply Last reply Reply Quote 0
          • paul-mcmaster
            paul-mcmaster @Substring last edited by

            @subs thank you. I'm new to python so just knowing thats the route is a big help. So far using one relay to toggle the power state of the pi is working very well. it's nice to have all my custom lighting and speaker/monitor turn fully off while operating the pi with the same switch.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Want to support us ?

            59
            Online

            98.6k
            Users

            28.1k
            Topics

            187.0k
            Posts

            Copyright © 2021 recalbox.com