Can only get things to work with a test program I found. The program sets all channels to high (off) and then sets each individual channel to low (on) in a sequence. Setting up the channels in both Xlights and FPP makes no sense to me, so I am sure this is where the problem is. Played around with different settings today and still nothing. If you could explain setting up these programs to simply turn lights on and off using an 8 channel relay and explain it in simple terms for someone like me who does not understand it would be greatly appreciated. I am sure it is here somewhere, but cannot find it.
I think some diagrams and specifics are required. Some detail will help people understand your setup. Maybe some links to the code you have that works.
Mac computer running Xlights, Raspberry Pi running FPP, SainSmart 8 Channel DC 5V Relay Module for Arduino, mechanical relay, not ssr. I hooked up the Pi to the relay board using the GPIO's on the PI. Gpio 2 on pin 3 wired to relay 1, gpio 3 on pin 5 wired to relay 2, gpio 4 on pin 7 wired to relay 3, gpio 17 on pin 11 wired to relay 4, gpio 27 on pin 13 wired to relay 5, gpio 22 on pin 15 wired to relay 6, gpio 10 on pin 19 wired to relay 7, gpio 9 on pin 21 wired to relay 8. Pin 4 is the 5v power supply for the relay board and pin 6 is the ground for the board.
Following is the program that works.
#!/usr/bin/python
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
# init list with pin numbers
pinList = [2, 3, 4, 17, 27, 22, 10, 9]
# loop through pins and set mode and state to 'low'
for i in pinList:
GPIO.setup(i, GPIO.OUT)
GPIO.output(i, GPIO.HIGH)
# time to sleep between operations in the main loop
SleepTimeL = 2
# main loop
try:
GPIO.output(2, GPIO.LOW)
print "ONE"
time.sleep(SleepTimeL);
GPIO.output(3, GPIO.LOW)
print "TWO"
time.sleep(SleepTimeL);
GPIO.output(4, GPIO.LOW)
print "THREE"
time.sleep(SleepTimeL);
GPIO.output(17, GPIO.LOW)
print "FOUR"
time.sleep(SleepTimeL);
GPIO.output(27, GPIO.LOW)
print "FIVE"
time.sleep(SleepTimeL);
GPIO.output(22, GPIO.LOW)
print "SIX"
time.sleep(SleepTimeL);
GPIO.output(10, GPIO.LOW)
print "SEVEN"
time.sleep(SleepTimeL);
GPIO.output(9, GPIO.LOW)
print "EIGHT"
time.sleep(SleepTimeL);
GPIO.cleanup()
print "Good bye!"
# End program cleanly with keyboard
except KeyboardInterrupt:
print " Quit"
# Reset GPIO settings
GPIO.cleanup()
# find more information on this script at
#
I didn't think fpp supported this sort of gpio output. I know you can add a Pi hat to run pixels but I have never heard or anyone controlling relays this way directly. As I said before I think you need an arduino.
Ignore everything except the FPP (PI plus Player software) for now. If you cannot get the FPP to work, then the rest does not matter. On the FPP, how have you configured your output channels (a picture is needed).
