ESP unit restarting/freezing

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

ESP unit restarting/freezing

#1 Post by manjh » 03 Jul 2019, 15:38

A few weeks ago I did maintenance on 2 of my units, and while I was at it installed the latest Mega release.
Since then the units have restarted several times after some hours, and now they are both frozen. I will have to restart when I am home again next weekend.

Any ideas what could be wrong? Perhaps I installed the wrong version, would that explain the behaviour?
What is the simplest way to defect the type of ESP chip?

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

Re: ESP unit restarting/freezing

#2 Post by grovkillen » 03 Jul 2019, 17:35

You should try to save all the tasks one by one since the settings have changed its structure.
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:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#3 Post by manjh » 03 Jul 2019, 17:52

grovkillen wrote: 03 Jul 2019, 17:35 You should try to save all the tasks one by one since the settings have changed its structure.
I did. In fact, because I had some problems with the units I loaded a very ancient version to make sure everytning was cleared, and then the mega. After that I had to do all settings from scratch.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#4 Post by manjh » 03 Jul 2019, 17:53

Forgot to ask: is there some tool to check the HW type of the ESP?

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

Re: ESP unit restarting/freezing

#5 Post by grovkillen » 03 Jul 2019, 18:11

If you look under info you will see what type of ESP the firmware detected.
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:

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

Re: ESP unit restarting/freezing

#6 Post by grovkillen » 03 Jul 2019, 18:12

I think you may need to do a "blank flash" if you first used an ancient version and then updated to mega...
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:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#7 Post by manjh » 03 Jul 2019, 19:33

grovkillen wrote: 03 Jul 2019, 18:12 I think you may need to do a "blank flash" if you first used an ancient version and then updated to mega...
Ah. How do I do a blank flash?

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

Re: ESP unit restarting/freezing

#8 Post by grovkillen » 03 Jul 2019, 20:23

Flash a "blank" bin file (they are in the release zip).
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:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#9 Post by manjh » 08 Jul 2019, 20:18

I did as you suggested: flashed a blank, then a 4M image.
What went wrong: I saw the option to set SSID and PW, plus a few other things. That did not work, the unit did not connect. Moreover, even via the serial monitor I was unable to get things to connect.
So I re-flashed the blank and then the image. This is now working, I will see if it reboots again as the previous.

One more question: you mention that the type of HW can be found in the "information", but I cannot find it. Where should I look?

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#10 Post by manjh » 09 Jul 2019, 11:10

Something came to mind: with the latest Mega release (lloks great, guys!), do I still need to reboot the ESP units periodically, or can I discard that bit of rules?

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

Re: ESP unit restarting/freezing

#11 Post by TD-er » 09 Jul 2019, 15:10

@manj
In the start page of the web interface, I added a big button which links directly to the system info page. But it's also available via Tools -> system info

And the reboot thing.
Well there is still the issue of WD reboots, which do appear to be caused when the unit does a WiFi reconnect (not always, but often)
If you experience that the unit is unreachable from time to time, you can check the "Gratuitous ARP" checkbox in the Advanced settings (via Tools)
This will send an occasional ARP announcement so the switch knows how to reach the node.

I can't say it is no longer needed to perform a daily reboot, since I don't know the reason why your nodes did need it.
But if you're using core 2.5.2, it is already quite a stable build, with only the WD reboots occasionally depending on WiFi stability.
If your units are in a very hard to reach position, I would say keep them rebooting at set time via rules.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#12 Post by manjh » 09 Jul 2019, 16:22

TD-er wrote: 09 Jul 2019, 15:10
Well there is still the issue of WD reboots, which do appear to be caused when the unit does a WiFi reconnect (not always, but often)
If you experience that the unit is unreachable from time to time, you can check the "Gratuitous ARP" checkbox in the Advanced settings (via Tools)
This will send an occasional ARP announcement so the switch knows how to reach the node.
I have several access points in my home, plus the main router. All SSID's have the same name, so wherever I am in the house my devices connect automatically.
However, I did notice in the setup, that the SSID is shown along with the hex address. When I select that SSID, does that mean the ESP will connect exclusively to that AP? In other words, does it take the hex address into the connect?

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#13 Post by manjh » 09 Jul 2019, 16:24

TD-er wrote: 09 Jul 2019, 15:10
But if you're using core 2.5.2, it is already quite a stable build, with only the WD reboots occasionally depending on WiFi stability.
Confused... when I look at the sytem info, I see this:

Code: Select all

Build:⋄	20103 - Mega
System Libraries:⋄	ESP82xx Core 2_4_2, NONOS SDK 2.2.1(cfd48f3), LWIP: 2.0.3 PUYA support
Git Build:⋄	mega-20190630
Plugins:⋄	47 [Normal]
Build Md5:	9afaa5349e7881f59519e1fb694bfa75
Md5 check:	passed.
Build Time:⋄	Jun 30 2019 02:15:51
Binary Filename:⋄	ESP_Easy_mega-20190630_normal_ESP8266_4M.bin
By the looks of this, I am using 2.4.2!

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#14 Post by manjh » 09 Jul 2019, 16:25

TD-er wrote: 09 Jul 2019, 15:10 In the start page of the web interface, I added a big button which links directly to the system info page. But it's also available via Tools -> system info
Yes, I found that, but it does not tell me about the HW type. Unless it is encoded in this:

Code: Select all

ESP Chip ID:	2237835 (0x22258B)
ESP Chip Frequency:	80 MHz
ESP Board Name:	PLATFORMIO_ESP12E

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#15 Post by manjh » 10 Jul 2019, 22:17

This is not good. Sofar, I have upgraded four units to the latest Mega release, made sure I flashed a blank first. They all seemed to work OK, but after several hours they freeze. When I reset them, the are OK again but for how long... I don't see any common reason, except the uptime that they all report into Domoticz. For the rest, the nature of their functions are quite different.
Does this ring any bells? Should I downgrade, and to which build?

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#16 Post by manjh » 11 Jul 2019, 10:37

I downgraded two of the units to build 147, we'll see what happens.
Meanwhile, another strange thing pops up: one of the units with the latest Mega release does not have any problem to keep running!
What's different from the other three? Well. those three were configured on my worktable in my office, and then moved to another place in the house, where they are likely to have a different access point (but with the same SSID name and password).
The one without the problem stayed within the same AP range.

I'm just guessing here, but could that have anything to do with it? Even though name and PW are identical, the hex address of the AP's are, of course, different.
And I saw that address in the initial config step of the Mega build, and it does not show anywhere in the older 147 build.

How about it, guys, could this have any impact at all? :?

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

Re: ESP unit restarting/freezing

#17 Post by grovkillen » 11 Jul 2019, 13:14

We do have the implication that the WiFi is the bad guy here. The issue has been discussed with Espressif SDK core developers and we'll see how it evolves. Hopefully a fix is on the horizon.
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:

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#18 Post by manjh » 11 Jul 2019, 14:45

grovkillen wrote: 11 Jul 2019, 13:14 We do have the implication that the WiFi is the bad guy here. The issue has been discussed with Espressif SDK core developers and we'll see how it evolves. Hopefully a fix is on the horizon.
OK, good. So I guess I stubled upon it, because I have multiple access points.
What was the exact description of the problem to Expressif?

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#19 Post by manjh » 11 Jul 2019, 17:22

Forgot to mention: if you would like me to do some testing, just let me know.
I now have 18 ESP units running, with plans for about 4 or 5 more. All running ESPEasy in various builds.
Network: router plus 3 AP'-s, identical SSID and PW.
Must be a good surrounding for tests.

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

Re: ESP unit restarting/freezing

#20 Post by TD-er » 14 Jul 2019, 19:47

What is happening is this.
If the unit does need to reconnect, it may crash.
It looks like the ESP ends up in some infinite loop and thus cause a WD reboot.

A WiFi reconnect may happen due to lots of reasons.
For example channel change, lots of packet loss, ECC errors, etc.

I guess the one that did not crash yet is not handling a lot of traffic (no MQTT) and also in range of only one AP.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#21 Post by manjh » 14 Jul 2019, 21:29

TD-er wrote: 14 Jul 2019, 19:47 What is happening is this.
If the unit does need to reconnect, it may crash.
It looks like the ESP ends up in some infinite loop and thus cause a WD reboot.

A WiFi reconnect may happen due to lots of reasons.
For example channel change, lots of packet loss, ECC errors, etc.

I guess the one that did not crash yet is not handling a lot of traffic (no MQTT) and also in range of only one AP.
the last one froze as well, I am now back to build 147. Works just fine.

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

Re: ESP unit restarting/freezing

#22 Post by grovkillen » 14 Jul 2019, 23:45

I got the impression 147 will work great since it's using a lot of delay in the code.
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:

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

Re: ESP unit restarting/freezing

#23 Post by TD-er » 15 Jul 2019, 18:44

I think it is working OK, since it is using a very old core library and somewhere (don't know exactly when) a bug was introduced that causes the crashes on WiFi reconnect.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: ESP unit restarting/freezing

#24 Post by manjh » 16 Jul 2019, 20:28

TD-er wrote: 15 Jul 2019, 18:44 I think it is working OK, since it is using a very old core library and somewhere (don't know exactly when) a bug was introduced that causes the crashes on WiFi reconnect.
Ah. Old things are not bad... :D

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 37 guests