-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[gpio] Set UP value on startup when inverted #13376
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
Conversation
Signed-off-by: Martin Steiger <git@martin-steiger.de>
| } | ||
| this.gpio = new GPIO(jPigpio, gpioId, JPigpio.PI_OUTPUT); | ||
| if (configuration.invert) { | ||
| updateStatus.accept(OnOffType.ON); |
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.
Should this line be added ? Because inverted means that pin should be by default in state 1, but this means OFF not ON, because it is inverted .
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.
Good point, I'm not sure on this on either. Maybe not setting updateStatus would be the correct thing to do. What do you think @nils-bauer ?
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.
As 6 months have passsed, is this properly addressed ?
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.
I was hoping that this entire PR could be replaced with #13643 and still keep my fingers crossed that it will be merged over the next days.
|
Could someone review this, please? |
As I can see, this was already reviewed and there is still an open point. We need the feedback from the binding maintainer @nils-bauer . I have myself not the response to the opened question. |
|
Hi all together, |
|
Any chance you could review this soon? |
|
Hopefully end of October/start of November. |
|
Hi Nils,
Over the last few weeks I have been working on the documentation and
cleanup of the work I did. I really want to get it submitted as it fixes,
in my opinion, the most glaring issue with the gpio binding. Hopefully I
can get you a pull request before you sit down and test it.
Regards,
Jeremy
…On Wed, Oct 19, 2022 at 7:15 AM Nils Bauer ***@***.***> wrote:
Hopefully end of October/start of November.
—
Reply to this email directly, view it on GitHub
<#13376 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATUYTTPXJ6BYYVFIGUWJE2TWD7J3TANCNFSM6AAAAAAQJW427A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…ality. * Add the ability to recover from network disconnects to pigpiod. * Provide actions to what the binding does on pigpiod connect/disconnect/reconnect. * Provide the ability to pulse outputs in a one-shot/momentary fashion. * Provide edge level configuration for gpio outputs. Workaround: openhab#11039 Fixes: openhab#11038 Fixes: openhab#13376
…ality. * Add the ability to recover from network disconnects to pigpiod. * Provide actions to what the binding does on pigpiod connect/disconnect/reconnect. * Provide the ability to pulse outputs in a one-shot/momentary fashion. * Provide edge level configuration for gpio outputs. Workaround: openhab#11039 Fixes: openhab#11038 Fixes: openhab#13376 Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
|
Hey guys, any updates on this one? It would be great to have this issue fixed. Maybe even better to fully replace the implementation with that of @jeremyrumpf but that seems to be a bigger project. |
|
The pull request has been submitted, awaiting review:
#13643
You can run the updated plugin if you are willing to manually install it.
If you need assistance, let me know. A build is at:
https://github.com/jeremyrumpf/jeremyrumpf/tree/main/files
The updated documentation is here:
https://github.com/jeremyrumpf/openhab-addons/tree/main/bundles/org.openhab.binding.gpio
…On Wed, Dec 21, 2022 at 3:09 AM Martin Steiger ***@***.***> wrote:
Hey guys, any updates on this one? It would be great to have this issue
fixed.
Maybe even better to fully replace the implementation with that of
@jeremyrumpf <https://github.com/jeremyrumpf> but that seems to be a
bigger project.
—
Reply to this email directly, view it on GitHub
<#13376 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATUYTTK3AAHVIA2W2S6XIB3WOK3KDANCNFSM6AAAAAAQJW427A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Looks good to me! There seems to be a merge conflict which needs to be resolved before it can be integrated. |
|
I will say learning the continuous integration and workflows has been pretty fun. I believe i have the conflicts resolved against 4.0.0-SNAPSHOT. |
openhab#13643) * [GPIO] Update the GPIO binding to fix issues and provide new functionality. * Add the ability to recover from network disconnects to pigpiod. * Provide actions to what the binding does on pigpiod connect/disconnect/reconnect. * Provide the ability to pulse outputs in a one-shot/momentary fashion. * Provide edge level configuration for gpio outputs. * Fix automated style checks. * Attempt to squash jenkins build warnings/errors. * Correct Null annotations and adjust log levels in certain areas. * Fix bracing per checkstyle review. * Normalize gpiod/pigpiod to pigpiod. openhab/openHAB normalized to OpenHAB. * Fix a copy/paste error. Output channels should not be referred as input. Attempt to clarify plurals. * Convert strings to defined constants. * Convert pulse command strings to binding constants. * Java17 instanceof pattern matching. * Nit, fix missed pulse command string to binding constant. * Add missing quotes in demo.things file definition. Workaround openhab#11039 Fixes openhab#11038 Fixes openhab#13376 Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
openhab#13643) * [GPIO] Update the GPIO binding to fix issues and provide new functionality. * Add the ability to recover from network disconnects to pigpiod. * Provide actions to what the binding does on pigpiod connect/disconnect/reconnect. * Provide the ability to pulse outputs in a one-shot/momentary fashion. * Provide edge level configuration for gpio outputs. * Fix automated style checks. * Attempt to squash jenkins build warnings/errors. * Correct Null annotations and adjust log levels in certain areas. * Fix bracing per checkstyle review. * Normalize gpiod/pigpiod to pigpiod. openhab/openHAB normalized to OpenHAB. * Fix a copy/paste error. Output channels should not be referred as input. Attempt to clarify plurals. * Convert strings to defined constants. * Convert pulse command strings to binding constants. * Java17 instanceof pattern matching. * Nit, fix missed pulse command string to binding constant. * Add missing quotes in demo.things file definition. Workaround openhab#11039 Fixes openhab#11038 Fixes openhab#13376 Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Description
By default, the GPIO output pins are OFF. Using the "invert" flag, the behavior is changed so that the default state is ON. This works fine unless the service is restarted. On startup, the GPIO values are not set to ON despite the inverted flag being set.
This PR fixes that problem by setting the value in the constructor.
Maybe @nils-bauer or @SloCompTech could review and/or test a bit?
This might also be a fix for issue #11296.