ESP8266 or ESPEASY crashes sometimes and deletes rules
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 21
- Joined: 05 Aug 2020, 17:54
ESP8266 or ESPEASY crashes sometimes and deletes rules
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.
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.
-
- Normal user
- Posts: 21
- Joined: 05 Aug 2020, 17:54
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
Now i'm stuck into a 100% load with the rules engine turned off.
In the log i see an error
Power off and on doesn't change anything.
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
Last edited by buzzger0815 on 11 Aug 2020, 14:32, edited 1 time in total.
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
What exact release of ESPEasy (name of the .bin file please) do you have installed on your ESP?
/Ton (PayPal.me)
-
- Normal user
- Posts: 21
- Joined: 05 Aug 2020, 17:54
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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
-
- Normal user
- Posts: 21
- Joined: 05 Aug 2020, 17:54
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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.
Or maybe the flash is out of order. But as i wrote i have this behavior on 2 different units.
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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.
If the networking/WiFi interface is quite busy, all kinds of weird stuff may happen.
/Ton (PayPal.me)
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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.
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.
-
- Normal user
- Posts: 21
- Joined: 05 Aug 2020, 17:54
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
@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!
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!
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
That is to be expected, as the flash is 'formatted' during the factory reset, you started with a clean slatebuzzger0815 wrote: ↑11 Aug 2020, 16:11 ... i did a factory reset and reentered every single setting. Now it is working again...
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'.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. ...
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)
/Ton (PayPal.me)
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
Also the ESP32 does have a lot more GPIO pins.
But sometimes the ESP32 does seem to be a bit more picky with WiFi.
But sometimes the ESP32 does seem to be a bit more picky with WiFi.
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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:~ $
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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?
Have you tried that one?
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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:~ $
Re: ESP8266 or ESPEASY crashes sometimes and deletes rules
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.
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.
Who is online
Users browsing this forum: Ahrefs [Bot] and 30 guests