ESP active but webpages not reachable after some time

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

ESP active but webpages not reachable after some time

#1 Post by wim16 » 28 Jul 2017, 11:50

Hello,

I am using ESP Easy since a few months now on 3 NodeMCU''s and I like it.
I only have a problem that the webpages cannot be reached after some time and the ESP is not in the IP-list of my router anymore.
All ESP's use DHCP and it looks like something is going wrong with renewing the IP-lease.
Strange enough the ESP's still report to Domoticz (on Raspberry) and they also react on commands from Domoticz.
Through the serial interface I can see that they are active as normal.

2 units is running on R120, the other on 2.0 dev 11 but all suffer from this problem.
Any ideas on what can cause this behavior?

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: ESP active but webpages not reachable after some time

#2 Post by wim16 » 31 Jul 2017, 11:21

Well, it seems I am the only one with this problem.
At least I have found a workaround, using the fact that the ESP still reponds to commands from Domoticz.
I added a rule that reconnects to wifi and can be triggered from Domoticz. After that I have access to the unit again.
Since I don't need the web-gui very often this is acceptable...

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: ESP active but webpages not reachable after some time

#3 Post by Domosapiens » 31 Jul 2017, 13:16

2 units is running on R120, the other on 2.0 dev 11 but all suffer from this problem.
So it sounds like a router problem ..
but ...
and they also react on commands from Domoticz
Commands from Domoticz ... by name or IP address?
Did you make a mix of DHCP and Static IP's?

Did you try only static IP's ?
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: ESP active but webpages not reachable after some time

#4 Post by wim16 » 31 Jul 2017, 15:28

Domosapiens,

yes, it may be a router problem but the ESP's are the first devices with this problem.
From Domoticz I send the commands using ESP-ip. Btw, curl or ping from the RPI also works. Using the web-browser fails.
Static IP may well solve the problem but I'd rather us the IP-reservations of my router.
I'll give one of the units a static IP and see what happens...

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: ESP active but webpages not reachable after some time

#5 Post by Domosapiens » 31 Jul 2017, 16:03

From Domoticz I send the commands using ESP-ip
Don't understand that ... DHCP can give different IP's to a node.
Do you have fixed IP's to MAC addresses within DHCP?
but I'd rather us the IP-reservations of my router
Static IP's are also reservations in the router, only outside the DHCP block.

Another suggestion:
Are you above the capability of your router?
F.i. my D-Link DIR-655 has only 25 DHCP addresses.
I use DHCP for mobile things and Static for fixed things (like Desktop and ESP's)
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: ESP active but webpages not reachable after some time

#6 Post by wim16 » 31 Jul 2017, 16:24

Domosapiens wrote: 31 Jul 2017, 16:03 Do you have fixed IP's to MAC addresses within DHCP?
Yes I have, but that is not a static IP.
I static IP is managed by the device not by the router, that is why it must be outside the DHCP-block and
why I'd rather use the router functionality to reserve a certain IP for a specific MAC.

Anyway, I've set one of the ESP's to a fixed IP (so in the ESP-config) and see if that helps.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP active but webpages not reachable after some time

#7 Post by Shardan » 31 Jul 2017, 19:24

Hello all,

i use a similiar setup - i have a DNS/DHCP on an old Raspberry B and use a Ubiquiti AP for WiFi.

Due to my experience some home routers have a not really clean implementation of DHCP.
Using fixed IP's by assigning the mac to an IP adress with the router may fail if this
address is outside the DHCP range for example.

To decide if this is a ESP or router related problem a simple test should work:
If your ESPs are failing, do not touch them - reset the router instead.
If the ESPs come back then, it's more likely a router problem.
If only resetting ESP works it's more of an ESP failure i assume.

Regards
Shardan
Regards
Shardan

ILoveIOT
Normal user
Posts: 44
Joined: 01 Nov 2015, 10:54

Re: ESP active but webpages not reachable after some time

#8 Post by ILoveIOT » 01 Aug 2017, 06:27

Got the same issue here, solved it for now with rebooting the esp every two hours, notice that now, the webserver stays up, the connection solution above was not working because the ESP keeps the wifi connection.

Without 2 hours reboot, cannot ping it then anymore, webserver not working, use a fixed ip everywhere, and also see that its still connected to the accesspoint, when I walk in front of the PIR (input switch), the connection will come back and can connect with the webserver. (the following not sure, can test, but even refresh or ping multiple times, will not bring him to life)

Also noticed now when i reboot them every 2 hours, want to connect to the webserver, connection failed in browser, refresh and webserver is loading, (56min running) dont use any sleep option. Not sure but it looks like the ESP going in a sleepmode on his ip stack when no clients connected, webserver and ping not working, refresh the page 1-2-3 times, and webserver and ping is coming up. When I ping the ESP the whole time, the connection stays up and webserver is responsive. Stop the ping from a client and after 5min, the webserver and ping stops responding till you refresh (f5) in browser or use ping, as you can see below it takes 5 sec to become alive.

Pingen naar 192.168.50.231 met 32 bytes aan gegevens:
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.231: bytes=32 tijd=106 ms TTL=128
Antwoord van 192.168.50.231: bytes=32 tijd=25 ms TTL=128
Antwoord van 192.168.50.231: bytes=32 tijd=3 ms TTL=128
Antwoord van 192.168.50.231: bytes=32 tijd=3 ms TTL=128
Antwoord van 192.168.50.231: bytes=32 tijd=95 ms TTL=128

Board : NodeMCU v3 (got it with 3 different boards, 2x4mb, 1x16mb)
GIT version: v2.0.0-dev11
Uptime: 0 days 1 hours 20 minutes
Load: 16% (LC=25339)
Free Mem: 22184 (16480 - sendWebPageChunkedData)

Hope it helps ;)

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: ESP active but webpages not reachable after some time

#9 Post by wim16 » 01 Aug 2017, 10:00

Looks similar indeed.
I also thought of doing a reboot regularly but since the ESP keeps wifi connection my rule now contains a WifiDisconnect followed by a WifiConnect.
That works and does not destroy logs and settings.

ILoveIOT
Normal user
Posts: 44
Joined: 01 Nov 2015, 10:54

Re: ESP active but webpages not reachable after some time

#10 Post by ILoveIOT » 01 Aug 2017, 10:11

Hehe, now trying youre solution on one ESP, guess this should also work fine.

On System#Boot do
TimerSet,1,7200
endon

On Rules#Timer=1 do
WifiDisconnect
WifiConnect
TimerSet,1,7200
endon

What timer settings value do you use ?

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: ESP active but webpages not reachable after some time

#11 Post by wim16 » 05 Aug 2017, 12:01

Ok, I tried using a fixed IP but the results are no different so I switched back to DHCP.

I do not use a timer to trigger my rule.
Whenever I need to access an ESP whose webgui has become unreachable I trigger the event from the RPI-commandline using

Code: Select all

curl http://ESP-ip/control?cmd=event,reconnect_wifi

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: ESP active but webpages not reachable after some time

#12 Post by LisaM » 05 Aug 2017, 13:16

I have the same problem with ArduinoEasy with fixed ethernet, encj2860 ethernet shield , no wifi. Ping works, webserver no response...

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP active but webpages not reachable after some time

#13 Post by Shardan » 05 Aug 2017, 14:27

Did anyone try to restart the router instead of the ESP's?
Would be interesting if the website comes up after restarting the router.

Another interesting point:
As long as the website is reachable, watch the memory value, or send a System Info about memory to the controller.
This behaviour might be caused by a memory leak when using a specific plugin for example.
Regards
Shardan

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: ESP active but webpages not reachable after some time

#14 Post by wim16 » 05 Aug 2017, 18:21

I do not restart the ESP but force it to reconnect to wifi; I think restarting the router will have the same effect.
One of my ESP's is just idling without any devices, I will let it report free memory and see if that gives a clue.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP active but webpages not reachable after some time

#15 Post by Shardan » 08 Aug 2017, 16:17

wim16 wrote: 05 Aug 2017, 18:21 I do not restart the ESP but force it to reconnect to wifi; I think restarting the router will have the same effect.
It is not completely the same effect.
One of my ESP's is just idling without any devices, I will let it report free memory and see if that gives a clue.
An idling ESP without devices will show if one of the plugins you need has a memleak.... really sure?
Regards
Shardan

ILoveIOT
Normal user
Posts: 44
Joined: 01 Nov 2015, 10:54

Re: ESP active but webpages not reachable after some time

#16 Post by ILoveIOT » 08 Aug 2017, 18:16

Local Time: 2017-08-08 18:09:07
Free Mem: 22592 (16168 - sendWebPageChunkedData)

Start the ping after 5min.

Pingen naar 192.168.50.231 met 32 bytes aan gegevens:
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.199: De doelhost is niet bereikbaar.
Antwoord van 192.168.50.231: bytes=32 tijd=88 ms TTL=128
Antwoord van 192.168.50.231: bytes=32 tijd=109 ms TTL=128
Antwoord van 192.168.50.231: bytes=32 tijd=28 ms TTL=128
Antwoord van 192.168.50.231: bytes=32 tijd=8 ms TTL=128

Local Time: 2017-08-08 18:14:36
Free Mem: 22592 (16168 - sendWebPageChunkedData)

So the mem did not change during the 5 min, hope it helps ;)

wim16
Normal user
Posts: 88
Joined: 01 May 2017, 20:35

Re: ESP active but webpages not reachable after some time

#17 Post by wim16 » 09 Aug 2017, 13:01

Same here: free mem stays at 27960 all the time (which is about 3 days now).

aero83
New user
Posts: 4
Joined: 07 Feb 2017, 22:17

Re: ESP active but webpages not reachable after some time

#18 Post by aero83 » 18 Aug 2017, 16:42

I was having similar issues with a basic sonoff device when connected to mains. I soldered a 470uf cap to the power pins used for programming and zero issues since.

Just a possible point to check!

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: ESP active but webpages not reachable after some time

#19 Post by Shardan » 18 Aug 2017, 18:36

aero83 wrote: 18 Aug 2017, 16:42 I was having similar issues with a basic sonoff device when connected to mains. I soldered a 470uf cap to the power pins used for programming and zero issues since.

Just a possible point to check!
Which pins exactly?
I'll check and might place a tipp in the wiki.

Regards
Shardan
Regards
Shardan

aero83
New user
Posts: 4
Joined: 07 Feb 2017, 22:17

Re: ESP active but webpages not reachable after some time

#20 Post by aero83 » 19 Aug 2017, 22:26

Shardan wrote: 18 Aug 2017, 18:36
aero83 wrote: 18 Aug 2017, 16:42 I was having similar issues with a basic sonoff device when connected to mains. I soldered a 470uf cap to the power pins used for programming and zero issues since.

Just a possible point to check!
Which pins exactly?
I'll check and might place a tipp in the wiki.

Regards
Shardan
I just soldered the cap to the VCC and GND pins on the pin header that you solder on before being able to flash the device.

ILoveIOT
Normal user
Posts: 44
Joined: 01 Nov 2015, 10:54

Re: ESP active but webpages not reachable after some time

#21 Post by ILoveIOT » 21 Aug 2017, 10:46

I tried you're solution but no luck,...soldered a 1000UF capacitor between GND and VCC on the header but the issue is still there.

ILoveIOT
Normal user
Posts: 44
Joined: 01 Nov 2015, 10:54

Re: ESP active but webpages not reachable after some time

#22 Post by ILoveIOT » 27 Aug 2017, 18:28

Looks like (not sure) the 1000UF condensator is helping a bit, but the main issue is still there, found more ppl with the same problem.

More Info https://github.com/nodemcu/nodemcu-firmware/issues/578

So i guess the issue is only on Nodemcu ? If I ping the ESP the whole day,...the issue is gone, but for me that's no solution.

Now made a blocky event for the switch, so i can use it from domoticz with 5x the same URL, so i know for sure the switch will go on, downside, has some delay, and programming is not super clean, but now I can the ESP for this project.

2017-08-27 18:29:35.688 EventSystem: Event triggered: CarportTest_1
2017-08-27 18:29:35.688 EventSystem: Fetching url...
2017-08-27 18:29:35.689 EventSystem: Fetching url...
2017-08-27 18:29:35.689 EventSystem: Fetching url...
2017-08-27 18:29:35.689 EventSystem: Fetching url...
2017-08-27 18:29:35.689 EventSystem: Fetching url...
2017-08-27 18:29:35.690 (Dummy) Lighting 1 (Carport Test)
2017-08-27 18:29:38.971 Error: Error opening url: 192.168.50.231/control?cmd=event,testrelais
2017-08-27 18:29:41.934 Error: Error opening url: 192.168.50.231/control?cmd=event,testrelais
2017-08-27 18:29:44.933 Error: Error opening url: 192.168.50.231/control?cmd=event,testrelais

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests