-
Notifications
You must be signed in to change notification settings - Fork 23
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
Experiment: Using gpiod
for driving pins
#271
Conversation
gpiod
for driving pinsgpiod
for driving pins
e2fc545
to
b5f8192
Compare
@@ -35,7 +35,7 @@ def get_version_and_cmdclass(pkg_path): | |||
|
|||
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin | |||
# module | |||
plugin_description = """A plugin that adds buttons to the navbar for toggling GPIO on the RPi. It can be used for turning relays on and off.""" | |||
plugin_description = """A plugin that adds buttons to the navbar for toggling GPIO on Raspberry Pi. It can be used for turning relays on and off.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not only Raspberry Pi now
|
||
def xor(left: bool, right: bool) -> bool: | ||
return left is not right | ||
|
||
class Relay(): | ||
def __init__(self, pin: int, inverted: bool): | ||
self.request = request_lines( | ||
"/dev/gpiochip0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 5.0.0a1 🆗 It does some relay switching on startup. ❌ Revealed issues:
|
🚀 5.0.0a2 ❌ not fixed (initial state)
|
It seems that this library won't work with existing code implementation treating each switch as a standalone operation. |
I also found out, that there is a mode |
Alternatively, there is a much better documented library And more |
7a555a3
to
5a0ca35
Compare
🚀 5.0.0a3 🆗 Fixed initial state |
Won't work without much greater refactoring |
Probably closes #270 and maybe will help with #255