[Solved] Plobrem with GPIO after reset/reboot.

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Sturgeon
Normal user
Posts: 13
Joined: 23 Apr 2018, 20:18

[Solved] Plobrem with GPIO after reset/reboot.

#1 Post by Sturgeon » 23 Apr 2018, 21:24

Hello everyone!
I have a question. I connected relay module with 2 relays to wemos D1 with ESPEASY firmware. Created two switches. Connected to GPIO - 13 and 14. Manage through MQTT. Everything works fine. But i have a problem. After reboot/reset, one of the pins automaticaly set to "LOW". And after 1-2 seconds the relay starts working, but I don`t want it. I try enable internal pull-up, but is not usefull.
The first picture from MQTT-SPY. It shows how 2 second later reset pin 13 turn the value "0". Why is this happening? What am I doing wrong?

Hardware settings in the second image. The 3 and 4 image shows the device settings. GIT version: mega-20180323. I don't use rules .
2.jpg
2.jpg (149.86 KiB) Viewed 5670 times
3.jpg
3.jpg (89.26 KiB) Viewed 5670 times
4.jpg
4.jpg (124.9 KiB) Viewed 5670 times
1.jpg
1.jpg (72.53 KiB) Viewed 5666 times
Last edited by Sturgeon on 04 May 2018, 12:47, edited 1 time in total.

Sturgeon
Normal user
Posts: 13
Joined: 23 Apr 2018, 20:18

Re: Plobrem with GPIO after reset/reboot.

#2 Post by Sturgeon » 29 Apr 2018, 08:05

I try to update firmware. I try to change pin to gpio-4 and -5. I try to use internal pullup resistor. But problem stil is not solved.
I want to use 2-channel relay module through MQTT. All works fine. But after reboot last used gpio change it state automaticaly. Why this is happens?

My rule:

Code: Select all

on System#Boot do
GPIO,4,1
GPIO,5,1
endon 



on Curtains_open#Curtains_open=0 do
timerSet, 1, 3
endon

on Rules#Timer=1 do
gpio,4,1         // Turn off relay
Publish /ESPEasy_Bedroom_Curtains/Curtains_open,1
endon


on Curtains_close#Curtains_close=0 do
timerSet, 2, 3
endon

on Rules#Timer=2 do
gpio,5,1         // Turn off relay
Publish /ESPEasy_Bedroom_Curtains/Curtains_close,0
endon

Sturgeon
Normal user
Posts: 13
Joined: 23 Apr 2018, 20:18

Re: Plobrem with GPIO after reset/reboot.

#3 Post by Sturgeon » 03 May 2018, 10:45

So, problem is still not solved.
But I think that the reason for this in MQTT. When my PC (where install Mosquitto broker) is shutdown, ESP not run gpio on restart. When broker is working, last MQTT comand repeat after reboot/restart. What broker preferense can do this behavior?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Plobrem with GPIO after reset/reboot.

#4 Post by grovkillen » 03 May 2018, 11:39

Do you have the message retained activated?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Sturgeon
Normal user
Posts: 13
Joined: 23 Apr 2018, 20:18

Re: Plobrem with GPIO after reset/reboot.

#5 Post by Sturgeon » 03 May 2018, 11:55

Do you have the message retained activated?
I start without MQTT Retain Msg flag. Then I try with this flag (For what? I dont know). Not difference.
MQTT spy see only one first message. After reset MQTT spy dont see any message to ESP.

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: Plobrem with GPIO after reset/reboot.

#6 Post by danmero » 03 May 2018, 13:39

Try GPIO 12 and 14 , or 4 and 5 if you don't use I2C.

Regards,

Sturgeon
Normal user
Posts: 13
Joined: 23 Apr 2018, 20:18

Re: Plobrem with GPIO after reset/reboot.

#7 Post by Sturgeon » 03 May 2018, 14:39

danmero wrote: 03 May 2018, 13:39 Try GPIO 12 and 14 , or 4 and 5 if you don't use I2C.

Regards,
I begin with GPIO 12 and 14. Now I use GPIO 4 and 5 (D1 and D2 pin). Not difference.

Sturgeon
Normal user
Posts: 13
Joined: 23 Apr 2018, 20:18

Re: Plobrem with GPIO after reset/reboot.

#8 Post by Sturgeon » 04 May 2018, 12:46

In OpenHab mqtt config file I change setting to:

mosquitto.retain=false

And problem solved.
Thanks for all!

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests