SendToHttp keeps repeating call

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
edd--
Normal user
Posts: 10
Joined: 11 Dec 2017, 09:25

SendToHttp keeps repeating call

#1 Post by edd-- » 11 Dec 2017, 10:29

Hi,

I have a simple switch that needs to perform a webcall. The switch is a traditional wall switch, meaning it is ether on or off, only on a state change it should send the http call 1 time (the web call toggles the light state).
I have the internal pullup enabled and I use rules to manage the action.

Now, the problem is that when the ESP reboots this works fine, but after a while, the command call keeps being executed every second or so. Big issue since I have this installed in my 6-year old's bedroom and last night his light started going on and off all night :( Now that's torture ...

Does anyone know what the problem could be and how to solve it ? I already implemented rules because when using the web page provider I had the same issue ...

Thanks to anyone willing to help me out here !!!

my rules:

Code: Select all

On System#Boot do //on boot
  timerSet,1,300
endon

On Rules#Timer=1 do 
 Event reconnect
 timerSet,1,300
endon

On reconnect do
 WifiDisconnect
 WifiConnect
endon

On switch1#Switch do
     SendToHTTP 192.168.77.94,80,/o_toggle.php?id=60
endon

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

Re: SendToHttp keeps repeating call

#2 Post by grovkillen » 11 Dec 2017, 11:15

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:

edd--
Normal user
Posts: 10
Joined: 11 Dec 2017, 09:25

Re: SendToHttp keeps repeating call

#3 Post by edd-- » 11 Dec 2017, 11:18

Well, in that case the web call wouldn't work right ? And it doesn't explain why it keeps on executing the same request over and over ...
So I don't see how this could be related ?

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

Re: SendToHttp keeps repeating call

#4 Post by grovkillen » 11 Dec 2017, 11:47

What settings does the switch have?
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:

edd--
Normal user
Posts: 10
Joined: 11 Dec 2017, 09:25

Re: SendToHttp keeps repeating call

#5 Post by edd-- » 11 Dec 2017, 12:39

screen.png
You do not have the required permissions to view the files attached to this post.

edd--
Normal user
Posts: 10
Joined: 11 Dec 2017, 09:25

Re: SendToHttp keeps repeating call

#6 Post by edd-- » 11 Dec 2017, 12:41

screen2.png
You do not have the required permissions to view the files attached to this post.

TD-er
Core team member
Posts: 9906
Joined: 01 Sep 2017, 22:13
Location: the Netherlands

Re: SendToHttp keeps repeating call

#7 Post by TD-er » 11 Dec 2017, 14:12

You already said the internal pull up resistors are enabled.
But perhaps also add an extra resistor of about 10k as pull up and a small capacitor (100nF) parallel to the switch.
This will make sure the input is not triggered by external sources, or a bad contact in the switch.

Something like this:
Image

N.B. the capacitor will add an extra delay to the switch.
If the delay is too long, lowering the resistor may help.
If the problem still occurs, but less often, increase the capacitor and lower the resistor.
Make sure not to use too much current in the resistor. 330 Ohm is 10 mA

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

Re: SendToHttp keeps repeating call

#8 Post by grovkillen » 11 Dec 2017, 14:52

edd-- wrote: 11 Dec 2017, 12:39screen.png
You use the GPIO-2 for the LED as well as the switch... :roll:
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:

edd--
Normal user
Posts: 10
Joined: 11 Dec 2017, 09:25

Re: SendToHttp keeps repeating call

#9 Post by edd-- » 11 Dec 2017, 15:16

ah ... my mistake, I thought this ment that the onboard LED would blink when the GPIO was grounded (when the switch was pushed), and strangely, it did look like that ...

You think this was the issue ? I now changed it to none, will test and see if this solves it.

Thanks a lot !!

edd--
Normal user
Posts: 10
Joined: 11 Dec 2017, 09:25

Re: SendToHttp keeps repeating call

#10 Post by edd-- » 11 Dec 2017, 15:26

Also interesting: I checked the logs to see when the problem started occuring, apparently it started exactly when my router rebooted (scheduled reboot).

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

Re: SendToHttp keeps repeating call

#11 Post by grovkillen » 11 Dec 2017, 15:35

https://www.letscontrolit.com/wiki/inde ... figuration

GPIO2 is not ideal to use with a switch. Study the wiki and you'll understand why.
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:

edd--
Normal user
Posts: 10
Joined: 11 Dec 2017, 09:25

Re: SendToHttp keeps repeating call

#12 Post by edd-- » 11 Dec 2017, 16:03

Thank you, so does this mean that you would advise me to use a different GPIO ? (since 2 is already connected to the onboard led) ?

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

Re: SendToHttp keeps repeating call

#13 Post by grovkillen » 11 Dec 2017, 17:48

edd-- wrote: 11 Dec 2017, 16:03 Thank you, so does this mean that you would advise me to use a different GPIO ? (since 2 is already connected to the onboard led) ?
Yes, if possible.
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:

Who is online

Users browsing this forum: Perplexity.ai [bot] and 18 guests