这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jeremyrumpf
Copy link
Contributor

@jeremyrumpf jeremyrumpf commented Nov 2, 2022

Attempting to improve the reliability and usefulness of the GPIO binding in OpenHAB

  • 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 mode configuration for gpio outputs.

This should provide a workaround for #11039 by allowing the user to configure the output channels to refresh/sync their channel state with pigpiod upon connect/reconnect.

#11038 is corrected. The binding now polls the remote pigpiod instance to determine connectivity and reconnects on connection loss.

This should also provide the same corrective action as PR #13376

Fixes #11038

@lolodomo
Copy link
Contributor

lolodomo commented Nov 3, 2022

PR does not compile and is not properly signed.

@jeremyrumpf
Copy link
Contributor Author

jeremyrumpf commented Nov 3, 2022 via email

@lolodomo lolodomo added invalid and removed invalid labels Nov 5, 2022
@lolodomo
Copy link
Contributor

lolodomo commented Nov 5, 2022

The PR is now building. But not yet properly signed off.

Jeremy Rumpf and others added 5 commits November 5, 2022 12:03
…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>
Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
Signed-Off-By: Jeremy Rumpf <rumpf.99@gmail.com>
Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
@wborn wborn added the enhancement An enhancement or new feature for an existing add-on label Nov 5, 2022
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typo and codestyle. looks good

}

protected void setChannelJPigpio(@Nullable JPigpio jPigpio) throws PigpioException {
if (this.channelHandlers.isEmpty())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor checkstyle, please add braces

Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
…nHAB.

Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
…ut. Attempt to clarify plurals.

Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
conflicts.

Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
@jeremyrumpf jeremyrumpf requested a review from a team as a code owner January 19, 2023 21:57
Signed-off-by: Jeremy Rumpf <rumpf.99@gmail.com>
@msteiger
Copy link

Can we merge this one?

@Hilbrand Hilbrand requested a review from lsiepel February 20, 2023 12:30
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I left some questions and some suggestions. Mainly logging and style.
Please don't forget to run the mvn i18n:generate-default-translations

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes and improvements. In addition to @lsiepel's comments I have added a few minor ones.

@msteiger
Copy link

Hi, any news here? Can I help?

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have provided some additional feedback after going through changed files, since I didn't remember how I left it in last iteration. I think this can be merged soon, but especially the formatting of the documentation looks strange, so it would be nice if you could have a look here.

@jlaur jlaur added the awaiting feedback Awaiting feedback from the pull request author label Jul 13, 2023
@lsiepel
Copy link
Contributor

lsiepel commented Aug 25, 2023

Gentle ping @jeremyrumpf hope you can address the last review comments so this can be merged?

@msteiger
Copy link

It would be really great to get this one merged. Anything I can do to help?

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel
Copy link
Contributor

lsiepel commented Oct 29, 2023

As the requested changes are mainly documentation layout and logging related, i took the oppertunity to add some commits and address these. @jeremyrumpf i hope you are okay with that.
Hopefully we can proceed merging this.

@lsiepel lsiepel removed the awaiting feedback Awaiting feedback from the pull request author label Oct 29, 2023
@lsiepel lsiepel requested a review from jlaur October 29, 2023 14:39
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel lsiepel requested a review from jlaur October 29, 2023 16:23
@jeremyrumpf
Copy link
Contributor Author

As the requested changes are mainly documentation layout and logging related, i took the oppertunity to add some commits and address these. @jeremyrumpf i hope you are okay with that. Hopefully we can proceed merging this.

I believe they were mostly formatting related. I'm not most creative using markdown, so anything you think is appropriate will be welcome. The two logging level messages can be moved to debug. I do not really have a preference, if that is more inline with OpenHAB's best practices.

If there's anything else you need, let me know.

@lsiepel
Copy link
Contributor

lsiepel commented Oct 30, 2023

As the requested changes are mainly documentation layout and logging related, i took the oppertunity to add some commits and address these. @jeremyrumpf i hope you are okay with that. Hopefully we can proceed merging this.

I believe they were mostly formatting related. I'm not most creative using markdown, so anything you think is appropriate will be welcome. The two logging level messages can be moved to debug. I do not really have a preference, if that is more inline with OpenHAB's best practices.

If there's anything else you need, let me know.

In that case this PR is ready to be merged from my perspective

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @jeremyrumpf - thanks for your contribution, and thank you @lsiepel for helping getting this to the finish line.

@jlaur jlaur merged commit b24f3a2 into openhab:main Oct 30, 2023
@jlaur jlaur added this to the 4.1 milestone Oct 30, 2023
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Nov 26, 2023
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>
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An enhancement or new feature for an existing add-on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[gpio] lost connection is never detected/recovered

6 participants