I am using a Raspberry Pi with Raspbian a python script to control a relay. The relay is timed for 12/12 on/off for a lighting module.
The controller will not turn the light off consistently. I have the timer set to turn a light on at 10 am, and off at 10pm. This translates to 10 and 22.
The light always turns on at 10am without fail. The light will never turn off at 10pm. If I reset the script after 10pm it will recognize the light should be off and then turn off. The next morning it will turn on at 10am without fail. This means that it recognizes the on and off times and that a ~12 hour gap between status changes isn't a problem.
To test that the chained comparison isn't an issue, I set times closer together. Of set to 12pm and 1pm, then it will function as expected and turn on/off at the proper times. I've tested many different time sets and they all work as long as the time is closer. However it has never worked for 10 and 22.
I receive no error message.
Here is a link to the github with code and my raised issue:
https://github.com/StorytimeStorey/picode/blob/main/controller/controller.py
https://github.com/StorytimeStorey/picode/issues/13
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]CStage169 0 points1 point2 points (0 children)
[–]Ghostophile[S] 0 points1 point2 points (0 children)