Having difficulties with Default State

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
NDR008
Normal user
Posts: 35
Joined: 15 Jan 2018, 09:24

Having difficulties with Default State

#1 Post by NDR008 » 20 Jan 2018, 20:12

So, I have ESP-EASY mega running on a sonoff like clone.

GPIO4 is connected to the relay.
I would like it to always turn on when the board is powered on.

Openhab is controlling this switch via MQTT too.

I tried setting the GPIO 4 default state to Output High but it does not seem to do anything.
I also tried using rules and system#boot, but it also did not work.

If the last message I sent over MQTT was to turn it on, then it will turn on after a power cycle (and around 6 seconds).
If the last message I sent over MQTT was to turn it off, then it will turn off after a power cycle.

It is confusing me since Openhab is not really continuously sending MQTT messages.

Any ideas what am I doing wrong?

Additionally, it is a bit surprising for me, but inside Pin buffer state I find:
Plugin Index/Pin Mode Value/State
1 4 output 0
1 15 output 0

I do not actually use Pin 15....

NDR008
Normal user
Posts: 35
Joined: 15 Jan 2018, 09:24

Re: Having difficulties with Default State

#2 Post by NDR008 » 20 Jan 2018, 20:25

Turns out I had 2 issues:

GPIO 4 is one of the 2 default I2C lines.
Removed that, and it was okay.

Now it turns on virtually instantly after turning on.
But around 5 seconds later, it retrieves the state of the gpio that was requested over MQTT.

Now to figure out why does that happen.

NDR008
Normal user
Posts: 35
Joined: 15 Jan 2018, 09:24

Re: Having difficulties with Default State

#3 Post by NDR008 » 20 Jan 2018, 23:06

Solved the second issue. I had retained messages on my Mqtt broker.

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests