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

Fixed update of led bug and GPIO16 support #2110

Merged
merged 4 commits into from
Jan 20, 2020
Merged

Conversation

foxman69
Copy link
Contributor

I bought ZSP-001 Device
https://templates.blakadder.com/ZSP-001.html

When I tried to configure it, I couldn't, because Espurna ignored GPIO16 on setup (which caused the led (LED2) not to function on that specific device).
I also saw that Xose noticed this issue before (#376) but didn't change anything about it.
Anyhow I have added support for the GPIO16.

What I also noticed is that when I choose "Follow Switch#" on LED configuration tab it didn't function at all, as far as I saw the only function that supposed to update the led status according to the relay status is ledUpdate and its not being called anywhere but from MQTT, so I have added a call to it after every relay status change. that solved the problem for me.

@foxman69 foxman69 changed the title Fixed update of led bug and 16th PIN support Fixed update of led bug and GPIO16 support Jan 15, 2020
@mcspr
Copy link
Collaborator

mcspr commented Jan 16, 2020

Do you build with BROKER_SUPPORT disabled? See StatusBroker line just above in the processing. On the other side, led module will do ledUpdate() each time it receives a callback with RELAY topic

GPIO16 stuff is useful, but I am not seeing LED actually checking anything via gpio... methods.

@foxman69
Copy link
Contributor Author

I do compile with BROKER_SUPPORT disabled, probably that's why it didn't work for me.

About the gpio, you are right, it just took me time to make the led work, I got confused and thought its the gpio change that solved it, but the gpio change just helped me debug it in the terminal because without that change I was not able to control the 16th pin.

@@ -383,7 +383,7 @@ void _relayProcess(bool mode) {
if (_relay_sync_locked && needs_unlock && changed) {
_relaySyncUnlock();
}

ledUpdate(true);
Copy link
Collaborator

@mcspr mcspr Jan 16, 2020

Choose a reason for hiding this comment

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

I'd remove this.
LED_SUPPORT can hard-depend on BROKER_SUPPORT then? see dependencies.h & led mode (which can actually be disabled, removing ledUpdate symbol)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats correct, just making it depend on BROKER would solve the problem👍.
its ok to remove this line...

@mcspr mcspr self-requested a review January 20, 2020 11:20
@mcspr mcspr merged commit ac2f9c2 into xoseperez:dev Jan 20, 2020
@mcspr mcspr added this to the 1.14.2 milestone Mar 13, 2020
@foxman69 foxman69 deleted the dev9 branch June 9, 2023 18:49
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.

None yet

3 participants