Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord
    1. Home
    2. Kevin Mathis
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by Kevin Mathis

    • Control LED Strip With Relay And Startup Script

      Hello there, my name is Kevin. Long time reader of the forums first time poster. Ive been building some cabinets and bartops for friends and family and wanted to take my builds to the next level by adding some lights. I wanted these lights to turn on and off upon boot and shutdown of the pi to keep things simple and organized without the need of doing anything else other than just powering on the pi.

      Ive gotten this to work on my own, but what id like to change is when the lights turn on. right now the lights turn on right when the ES screen pops up after the recalbox splash. What id like is for the LED to come on right when the pi gets power. before the actual recalbox splash screen. Ive included a video of what I mean. https://www.youtube.com/watch?v=B7rZnrQ61iY&frags=pl%2Cwn

      what I have so far is a Led strip connected to a 5v relay connected to the pi via gpio and a script that runs at startup from /recalbox/share/system/ called custom.sh

      heres the script im using, feel free to add any changes I should be making.

      #!/usr/bin/python
      # GPIO lib import
      import RPi.GPIO as GPIO
      import time
      
      channel = 18
      
      # GPIO setup
      GPIO.setmode(GPIO.BCM)
      GPIO.setup(channel, GPIO.OUT)
      

      I also have this script posted in /etc/init.d with no luck. but maybe im also not using the correct script.

      posted in Recalbox General
      Kevin Mathis
      Kevin Mathis