ESP8266 or ESPEASY crashes sometimes and deletes rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
buzzger0815
Normal user
Posts: 21
Joined: 05 Aug 2020, 17:54

ESP8266 or ESPEASY crashes sometimes and deletes rules

#1 Post by buzzger0815 » 11 Aug 2020, 13:32

Hi there!

I don't know, if my problem is hardware or software related, so i posted it in the general discussion.

My esp8266 or my espeasy crashes sometimes. I starts with a no longer responding web interface, after approx. 10 seconds the blue led goes on and stays on. The only way, to get it working again, is a power cycle (i didn't try a reset until yet).

It happens, when i change a rule and save it. The ui doesn't respond any longer, blue led goes on and finish.

Sometimes, if this happens, the rule is deleted.

I use a ESP8266-01. I ordered a ESP8266-12 to test, if it is because of the esp8266-01. BUT i already tested it on 2 different esp8266-01, same behavior.

Any clues?

P.S.: I changed the thread, because after some testing, it is clear that i happens when i save the rule.

buzzger0815
Normal user
Posts: 21
Joined: 05 Aug 2020, 17:54

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#2 Post by buzzger0815 » 11 Aug 2020, 14:31

Now i'm stuck into a 100% load with the rules engine turned off.

In the log i see an error

Code: Select all

FS : Error while reading/writing config.dat in 1024
IMPT : Failed to connect to MQTT broker - attempt 1
IMPT : Failed to connect to MQTT broker - attempt 2
IMPT : Failed to connect to MQTT broker - attempt 3
IMPT : MQTT 037 Intentional reconnect
Power off and on doesn't change anything.
Last edited by buzzger0815 on 11 Aug 2020, 14:32, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#3 Post by Ath » 11 Aug 2020, 14:32

What exact release of ESPEasy (name of the .bin file please) do you have installed on your ESP?
/Ton (PayPal.me)

buzzger0815
Normal user
Posts: 21
Joined: 05 Aug 2020, 17:54

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#4 Post by buzzger0815 » 11 Aug 2020, 14:34

Ath wrote: 11 Aug 2020, 14:32 What exact release of ESPEasy (name of the .bin file please) do you have installed on your ESP?
ESP_Easy_mega_20200801_normal_ESP8266_1M.bin

Firmware
Build:⋄ 20109 - Mega
System Libraries:⋄ ESP82xx Core 5d3af165, NONOS SDK 2.2.2-dev(38a443e), LWIP: 2.1.2 PUYA support
Git Build:⋄
Plugin Count:⋄ 46 [Normal]
Build Origin: Travis
Build Time:⋄ Aug 1 2020 21:25:16
Binary Filename:⋄ ESP_Easy_mega_20200801_normal_ESP8266_1M
Build Platform:⋄ Linux-4.19.104-microsoft-standard-x86_64-with-glibc2.29
Git HEAD:⋄ pygit2_not_installed

buzzger0815
Normal user
Posts: 21
Joined: 05 Aug 2020, 17:54

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#5 Post by buzzger0815 » 11 Aug 2020, 14:43

Is it possible, that the flash write is causing the problem? When i go to the ui to config, press on "send" and the unit crasheds, with the blue led going on after approx. 10 seconds.

Or maybe the flash is out of order. But as i wrote i have this behavior on 2 different units.

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#6 Post by Ath » 11 Aug 2020, 15:13

Looking at the log you posted, it seems you may have some kind of networking issues, as the MQTT host can't be reached. Or is that enabled and not configured properly?
If the networking/WiFi interface is quite busy, all kinds of weird stuff may happen.
/Ton (PayPal.me)

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

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#7 Post by TD-er » 11 Aug 2020, 15:24

An ESP-01 has very limited SPIFFS space. (all 1M builds)
The total space is less than 128k, the settings file is 64k and you also need 2 blocks of 8k free for SPIFFS to do its work,
Also when changing settings or writing to a file you create fragmentation which may make it hard to find a new block to write on.
At reboot, I do call the garbage collector a number of times, but that one only can erase a block when all pages of that block are marked as not being used.
If you don't have enough free pages, you need to erase a block, which can only be done when all pages of that block are marked as not used.
Since you need 32 consecutive pages, the chance of finding one will rapidly decrease on such a small file system with fragmentation.
Not sure if the config.dat file is already made smaller (it can be as small as 36k since a lot of not (yet) used) for 1M units.
If it isn't I can change that for 1M buids.

buzzger0815
Normal user
Posts: 21
Joined: 05 Aug 2020, 17:54

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#8 Post by buzzger0815 » 11 Aug 2020, 16:11

@Ath

You are right. The credentials of the mqtt config was deleted, no be me! I reentered it, but did a very strange behavior. After that, i did a factory reset and reentered every single setting. Now it is working again. I'll try to figure out the point and report it. Thank you so far!

@TD-er
No, you don't have to change anything. I think my problems are related to the esp8266-01 module (reading what you wrote) and i will use it more carefully. I'm testing your espeasy software very hard at the moment (i'm a developer too) trying to find the right platform for my iot projects. By the way, tasmoto is out :) So by the way thank you for that piece of nice software and i'll report errors, if i can name them exactly. I'm flashing, changing rules, changing ports and so on in minutes. So maybe espeasy has to misbehave sometimes.

Thank you!

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#9 Post by Ath » 11 Aug 2020, 17:06

buzzger0815 wrote: 11 Aug 2020, 16:11 ... i did a factory reset and reentered every single setting. Now it is working again...
That is to be expected, as the flash is 'formatted' during the factory reset, you started with a clean slate :)
buzzger0815 wrote: 11 Aug 2020, 16:11 ... I'm testing your espeasy software very hard at the moment (i'm a developer too) trying to find the right platform for my iot projects. ...
Then you will love the Wemos Mini D1 (clone)modules, as they (usually) have 4 MB of flash, with 1 MB reserved for the file system (spiffs), and the upload will put the ESP into programming mode without any user-interaction (unlike the ESP01). And on top of that, the updates can be installed from the web interface as there is enough space on the module to download and flash 'in-place'.
If you need more speed, then get an ESP32 dev board, most of these don't go into programming mode automatically, but the OTA works there too, and they are quit a bit faster then the ESP8266 CPU (240 MHz dual-core vs. 80 MHz single-core) :o
/Ton (PayPal.me)

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

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#10 Post by TD-er » 11 Aug 2020, 21:13

Also the ESP32 does have a lot more GPIO pins.

But sometimes the ESP32 does seem to be a bit more picky with WiFi.

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#11 Post by Wiki » 12 Aug 2020, 10:54

TD-er wrote: 11 Aug 2020, 21:13 [...]
But sometimes the ESP32 does seem to be a bit more picky with WiFi.
I can confirm, you need clear and strong signals. But the worst part of the ESP32-story is to get the A/Ds to work reliably. I've never managed this successfully, so I personally could recommend the ESP32 only if you don't need any onboard ADC.

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

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

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#12 Post by TD-er » 12 Aug 2020, 11:21

I recently updated the ADC plugin for the ESP32, which also makes clear what pins are affected by wifi and what not.
Have you tried that one?

Wiki
Normal user
Posts: 413
Joined: 23 Apr 2018, 17:55
Location: Germany

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#13 Post by Wiki » 16 Aug 2020, 12:39

No, not yet, I didn't notice that. Maybe I should give it a try. Is the non-linearity solved?

Code: Select all

pi@raspberrypi:~ $ man woman
No manual entry for woman
pi@raspberrypi:~ $

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

Re: ESP8266 or ESPEASY crashes sometimes and deletes rules

#14 Post by TD-er » 16 Aug 2020, 16:09

What non-linearity?
The ADC itself isn't perfect linear, so the best you can do is calibrate it for a small range in which you will use it.
Depending on where the most accurate measurement is required, you can either calibrate on those 2 points, or calibrate at 2 points inbetween the important range to have the smallest error in that range.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 30 guests