HTTP access (GUI, ping) not working but ESP Rules still running

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ao16
Normal user
Posts: 19
Joined: 03 Oct 2018, 23:51

HTTP access (GUI, ping) not working but ESP Rules still running

#1 Post by ao16 » 16 Oct 2018, 23:19

Hi,

I am facing a strange issue with two NodeMCU's installed at different locations.
The ESP8266 seems to be still running but the HTTP interface is not responsive,
so not GUI Access via Webbrowser nor a ping works after some time of running.
This effect can happen after 20 minutes but also after 2 hours.

NodeMCU#1 is outside with 3x TS2561 and 1x BME280 connected via I2C.
(used as a sensor to determine the direction of sunlight - east, south, west)

NodeMCU#2 is inside with 1x TS2561, 1xBH1750 and a LCD2004, all via I2C.


NodeMCU#1 sents current Temperature of BME280 to NodeMCU#2 via sendToHTTP.
NodeMCU#2 displays this temperature and also displays its own systime.

That's the way I see the systime running on the display but HTTP-Access does not work on both modules
nor the sendToHTTP works from the outside module#1 to the inside module#2

On both NodeMCU's, the controller is configured (ThingSpeak).

Interesting behaviour is that on NodeMCU#1 the controller to ThingSpeak seems to continue
running for some time while HTTP GUI access is not possible anymore as I see values at the
ThingSpeak-Channel - however also after some time later, this communication to ThingSpeak gets stuck.

The only way then to restart the devices is a power cylce to reset them.
Anyhow sometimes, both NodeMCU's also do a software reset, however this is the more rare case.

At both devices I tested with F/W 2018-10-14, 2018-10-11 and also 2018-08-04.
The behaviour is the same.


Does anybody has an idea about the root cause for that behaviour?


Please find below the rules I am using. The rules are just preliminary
and more or less for testing as I first want to achieve a reliable behaviour of the devices.


NodeMCU#2 inside:

Code: Select all

On Time#Initialized do    // connected to Wifi-AP and NTP
  notify 1, "ESPEasy_SERVER 192.168.1.100 started"
  timerSet,1,9
endon


on BH1750#Lux>400 do
   if [dummy#var1]=0 do
       TaskValueSet 9,1,1
       notify 1, "Lux BH1750>400"
   endif
endon

on BH1750#Lux<400 do
   if [dummy#var1]=1 do
       TaskValueSet 9,1,0
       notify 1, "Lux BH1750<400"
   endif
endon


On Rules#Timer=1 do
  TaskValueSet 3,1,[BH1750#Lux]
  TaskValueSet 3,2,[TSL2561#Lux]
  TaskValueSet 3,3,[TSL2561#Infrared]
  TaskValueSet 3,4,[RSSI#dBm]
  LCD,1,1,[RSSI#dBm] dBm %systime%
  LCD,2,1,BH1750: [BH1750#Lux]
  LCD,3,1,SR: %sunrise%
  LCD,4,1,SS: %sunset%
  timerSet,1,9
endon

On 50_x_Alive do
  LCD,3,1,50_x:ok
endon

NodeMCU#1 Outside:

Code: Select all

On Time#Initialized do // connected to Wifi-AP and NTP
  timerSet,1,5   // set Timer1 for event in x sec - Umkopieren der Werte
  //timerSet,2,2 // set Timer2 for event in x sec - Heartbeat HTTP
  timerSet,3,1 // set Timer3 for event in x sec - Heartbeat LED
  notify 1, "50_x WX-Sensors 192.168.1.108 started"
endon

On Rules#Timer=1 do // when Timer1 expires do...
  TaskValueSet 5,1,[TSL2561_East#Lux]
  TaskValueSet 5,2,[TSL2561_South#Lux]
  TaskValueSet 5,3,[TSL2561_West#Lux]
  TaskValueSet 5,4,[TSL2561_West#Infrared]
  sendToHTTP 192.168.1.100,80,/control?cmd=LCD,3,1,Temp:[BME280#Temperature]C
  sendToHTTP 192.168.1.100,80,/control?cmd=LCD,4,1,Uptime:[uptime#minutes]min 
  timerSet,1,5 // Resets Timer1 for another x sec
endon

//On Rules#Timer=2 do // when Timer2 expires do...
 //sendToHTTP 192.168.1.100,80,/control?cmd=event,50_x_Alive
 //sendToHTTP 192.168.1.100,80,/control?cmd=LCD,3,1,Temp:[BME280#Temperature]C
 //sendToHTTP 192.168.1.100,80,/control?cmd=LCD,4,1,Uptime:[uptime#minutes]min 
 //sendTo 1,event,50_x_Alive
 //timerSet,2,2 // Resets Timer2 for another x sec
//endon

On Rules#Timer=3 do // when Timer3 expires do...
   Pulse,0,1,400 // Pulse the LED on GPIO0 shortly
   timerSet,3,1  // Resets Timer3 for another x sec
endon

Any ideas or hints about the possible root cause for this strange behaviour I would appreciate
as I am struggling since more than a week at debugging without any success.

thanks in advance,

ao16

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

Re: HTTP access (GUI, ping) not working but ESP Rules still running

#2 Post by grovkillen » 17 Oct 2018, 06:32

First I would like you to remove the rules and see if the behavior is the same. Then you should try to disable the devices and then re-enable them one by one. Also if possible send the log to a server. viewtopic.php?t=4032
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:

ao16
Normal user
Posts: 19
Joined: 03 Oct 2018, 23:51

Re: HTTP access (GUI, ping) not working but ESP Rules still running

#3 Post by ao16 » 17 Oct 2018, 20:24

Thanks a lot for this hints, grovkillen, and the approach how to do
further investigations.
The hint with the TFTP syslog is excellent, I did not know this tool up to now.

For the further investigation I will probably need several days to stepwise supervise
which component (rule or device) might cause the below desribed behaviour.
As soon I know more, I'll let you know.

best regards,

ao16

ao16
Normal user
Posts: 19
Joined: 03 Oct 2018, 23:51

Re: HTTP access (GUI, ping) not working but ESP Rules still running

#4 Post by ao16 » 25 Nov 2018, 15:45

Hi,

In the past weeks, I did further testings according your recommendations with above NodeMCU's.

To take it in advance: the most stable setup I got by using an older ESPEasy Firmware (20180522)
and additionally also by disabling the controller to talk to Thingspeak.


This are the further testing results:

I removed the rules and also disabled devices step by step (just left Sysinfo uptime active).
One controller to Thingspeak on each NodeMCU was still activated
to upload the uptime of the ESP every (I changed from 60sec to 300sec after some time).


1. The NodeMCU's and another "blank" WeMOS D1 mini (w/o additional hardware connected)
I used were not accessible via Webinterface anymore.
This happens already after one to a few hours. (seen also at Thingspeak graph)


2. Then, I connected again an LED at NodeMCU#1 and NodeMCU#2 to a GPIO Pin12 (D6)
that shall flash every second via rule and pulse command to visualize if the ESP is alive.


3. The periodic 1-second blinking sometimes was interrupted by 6...8 seconds pauses
where the LED was not blinking at all. It looked like the ESP was doing some other tasks
or just slowed down.


4. Then, at NodeMCU#2 that is here inside the house,
I activated again the I2C 2004-LCD device to visualize if NodemMCU#1 (that is outside)
sends measurement values from the connected BME280 via sendToHttp to the LCD Display.

This worked fine, however after some time, again, no fresh BME280 values from outside
were displayed anymore on the LCD.


To narrow down if NodeMCU#1 is not sending or NodeMCU#2 is not receiving http-data I connected
a syslog server to the NodeMCU's (via WiFi to the ESP, not hardwired via TXD/RXD)

Result: NodeMCU#1 (outside) was sending SendToHTTP to NodeMCU#2 (inside)
however the syslog server did not visualize if the messages have been received
(altough Debuglevel 3) at NodemMCU#2.

So then I jused used the local LCD display at NodemMCU#2 (inside) for visualization.



5. Fact is that both NodeMCU's (inside and outside) were not accessible via Webinterface
anymore after some hours. Only a hardreset by powercycling solved that.
The ESP-Watchdog did not trigger in these cases.
Obviously also, the uptime graph at Thingspeak looked like a sawtooth
max. up to several hundred minutes.


6. Then, I deactivated also the reporting of the controller to Thingspeak
at both NodeMCU's for visualization of the uptime.
On the NodeMCU#2 here inside, I used the LCD to visualize the uptime of the ESP here inside
and also to visualize the uptime of the NodeMCU outside (received via SendToHTTP).


Now this is strange:
NodeMCU#2 (inside) still seemed to run as uptime was increasing while the uptime value of
NodeMCU#1 (outside) did not increase. NodeMCU#1 (outside) alive-LED was anyhow still blinking.


So I do have the following findings or conclusions - does anybody can confirm this behaviour
on his ESP's also?


conclusion #1:
Talking to a Thingspeak controller seems to "pause" or slow down the ESP during that time


conclusion #2:
The ESP is still running its rules, however the access via WiFi (Webinterface, ping, etc.)
seems to stop after some time.


conclusion #3:
I tested with following firmware versions on the NodeMCU's and the WeMOS D1 mini
(that was running "naked" in parallel to the NodeMCU's):

20180712, 20180927, 20181004, 20181008, 20181011, 20181014, 20181023,
20181027, 20181030, 20181110, 20181117

Now, I jumped to the older F/W 20180522 and it looks significant better.
Both NodeMCU's are currently running for more than 1500 minutes already showing their uptime
on the LCD connected at the NodeMCU#1 (inside). Let's see how long this lasts...



What has changed between 20180522 and the other version above that explains the
experienced behaviour?
Anybody an idea on that?

Thanks in advance if anyone experienced similiar behaviour and how this can be solved?

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 19 guests