Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix boot trigger of relay #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gouldner
Copy link

I fixed the issue I was reporting ( #35 ) and wanted to share my solution.

I found that the call to GPIO.setup(self.relay_pin, GPIO.OUT) starts with the GPIO sending the signal to the relay and turns off a few lines down when GPIO.output(self.relay_pin, self.invert_relay) is called.

So I moved GPIO.output(self.relay_pin, self.invert_relay) right after the setup and the trigger no longer happens.

@alastaid
Copy link

Hi, I had the same issue and this fixed it, thanks for posting.

@craigInTx
Copy link

There is still a moment (although more brief now) that the output would be toggled.
better solution: change:
GPIO.setup(self.relay_pin, GPIO.OUT)
to:
GPIO.setup(self.relay_pin, GPIO.OUT, initial=self.invert_relay)
to properly set the initial state on output setup.

I created a new pull request with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants