Page 1 of 1

strange characters while submitting rules

Posted: 29 Nov 2019, 09:29
by riker1
Hi

I experienced strange characters while submitting rules.

Is flash corrupt?
Would totally format / flash solve this?

Thanks


strange characters on start of rules after submitting :

Code: Select all

I 

��


Re: strange characters while submitting rules

Posted: 29 Nov 2019, 13:23
by grovkillen
What browser are you using?

Re: strange characters while submitting rules

Posted: 29 Nov 2019, 14:00
by TD-er
And also, how big is your rules file? (or actually was your file, as it now seems damaged)

Re: strange characters while submitting rules

Posted: 30 Nov 2019, 02:25
by ThomasB
And also: If it is an official ESPEasy release then what is the bin file name? Or if it's self compiled then what are the core and ESPEasy versions?

- Thomas

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 13:36
by riker1
Hi I am using Chrome

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 13:37
by riker1
TD-er wrote: 29 Nov 2019, 14:00 And also, how big is your rules file? (or actually was your file, as it now seems damaged)
It happens also with small rules sets, just 200 characters

Uploading via file solved it

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 13:40
by riker1
ThomasB wrote: 30 Nov 2019, 02:25 And also: If it is an official ESPEasy release then what is the bin file name? Or if it's self compiled then what are the core and ESPEasy versions?

- Thomas
It was ESP_Easy_mega-20190305_normal_ESP8266_4M.bin

I assume it was related to the browser

are you aware of any brower history while writing rules does lead to problems?

I experience sometimes that rules are not written complete .
I select pulldown rules 2 , submit it, but than it is jumping to rule 1 and rule2 keeps unchanged....

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 14:47
by TD-er
As we speak, I am looking into the way we deal with rules and also how the webserver internals parse the POST form elements.
For the last one, I added a feature request (part is actually a bug report I think): https://github.com/esp8266/Arduino/issues/6884

I've also looked at our own code handling the rules in the web interface and the code is also not really memory efficient.
For that part I will add a fix.
But as long as my feature request is not finished, it will be very hard to see if the submitted data was received complete and processed well.

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 14:59
by riker1
Hi

just experienced the same problem under chrome with

ESP_Easy_mega-20191119_normal_core_241_ESP8266_4M1M.bin


sometime strange char will be stored

now just those in the beginning of the ruleset:

Code: Select all

oFile: free stack: 3440
....
...
 
No sure where they are coming from

looks like you have an idea

Thanks T

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 15:03
by riker1
Just for curiosity

is it a problem having more open tabs per ESP website at the same time?

I do logging and editing rules in parallel ?

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 15:33
by TD-er
I do think there is a problem with concurrent web access on the Webserver we use.
As they are handled on event base, there is a possibility the webserver arguments are changed while the previous request still is rendered.
So I am thinking about adding some mutex on processing save requests.

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 19:42
by ThomasB
Interesting problem. I tried to duplicate the issue but did not experience any strange characters.

My Setup:
*NodeMCU, ESP_Easy_mega-20191130-2-PR_2789_test_ESP8266_4M_VCC.bin
- Enabled Controllers: Home Assistant (openHAB) MQTT
- Enabled Devices: Switch input, Display-Nextion, Generic-System Info (Qty 4).

*Launched two Chrome Browsers on the Win10/64 PC. Chrome Version 78.0.3904.108 (64-bit).
- First Chrome browser has two tabs: One shows web log (set to "debug more" log level) and the other has the Rules file.
- Second Chrome browser has only one tab with Rules file.

The rules test file had 1680 chars in it. I saved it about a hundred times. No extraneous chars were seen.

My problem-free results may hint that the problem involves the ESPEasy's configuration. Maybe interaction with a specific Controller or Device plugin. Or maybe today was my lucky day.

- Thomas

Re: strange characters while submitting rules

Posted: 06 Dec 2019, 20:44
by TD-er
Well, your build is heading for the infinite uptime, so it will not break :)

I've been looking into the webserver code a bit more (core library stuff) and I've come to the conclusion this may have lead to a lot of very strange issues in the past where settings somehow have become corrupted.
So this is for sure something I will think about how to detect these issues as they may have remained undetected until now.
The rules handling may be one of the most clear situations where an error like these gets noticed quite easily.
Also the submitted data of the rules is significantly larger, so it may lead to issues sooner.