Warning: Bug in OLED Framed plugin

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Martinus

Warning: Bug in OLED Framed plugin

#1 Post by Martinus » 11 Sep 2016, 11:09

Just ran some tests on a few playground plugins, to find out that the OLED framed plugin has a bug as well as a risky design issue.
We really can't blame the developer as this project totally lacks documentation, but we do need to properly address the issues.

I already started with some very basic documentation on the wiki pages and I've just added some details on PLUGIN_READ and PLUGIN_WRITE because it's important to understand that they work quite differently.

PLUGIN_READ works on tasks, while PLUGIN_WRITE is not task related (!)

and there we have the bug...

Although it will work as long as the OLED display is setup as Task number 1. And the bug only appears when updating the displayed text using a command.
If you run the OLED framed plugin on Task 2 and change the display text using a command, the plugin will use the configuration from Task 1 and likely display nothing or garbage.

The risky part is that each 'text change' command stores the new data into the same flash memory page. So let's say that you're running a script from Domoticz every minute to display some custom message, the flash chip on the ESP module could 'brick' your ESP after a few months...
(With a specification of 100.000 write cycles for these Winbond flash chips, 100.000/1440 = 69 days)
Same issue when using rules to display text using this plugin!
(The default LCD/OLED plugins are safe to use, because they do not store these changes into flash)

If your ESP logs these messages without you touching the web gui, you maybe in trouble at some day:

Code: Select all

FLASH: Settings saved
I'll add a flash write counter to the next build to help detecting these kind of issues.
(But it will only count writes since last boot, not a total counter as this would also wear out flash...)

So if you use commands to update your framed OLED setup on a regular base, better stop doing this until this is sorted out!

DeNB3rt
Normal user
Posts: 120
Joined: 15 Dec 2015, 14:07

Re: Warning: Bug in OLED Framed plugin

#2 Post by DeNB3rt » 07 Feb 2018, 17:09

already some updates about this? :)
Located in Belgium, Bruges. Working on a full DIY domoticz setup with ESPEasy.

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

Re: Warning: Bug in OLED Framed plugin

#3 Post by TD-er » 07 Feb 2018, 20:16

As far as I know, there is no command to display text to the framed plugin. (internally they are also called "tasks", when selected)
And I wanted to add something else, via another route.

My idea is to keep the OLED plugin rather simple and add some 'proxy' plugin to generate data for the Framed plugin to display.
Like charts, texts, etc.
The OLED Framed plugin allows to display values from other tasks and by allowing multiple "proxy" tasks, you can quite easily add new functionality without changing the OLED plugin.
For example a plugin to collect/filter texts from MQTT bus, or from a web page, or via a command.
Then the "lines" defined in the OLED framed plugin only have to be stored once and still may contain something different every so many seconds.

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: Warning: Bug in OLED Framed plugin

#4 Post by mattlward » 15 Feb 2018, 05:51

Ok... so I run the framed oled and I do not see the issue here. I send 2 mqtt messages to the device every 3 minutes and the SHT30 updates the display about every 30 seconds. So, I have 6 lines to write and 2 are static. Here is what I am seeing in the info screen regarding writes:

Uptime: 1 days 4 hours 24 minutes
Load: 16% (LC=17004)
Free Mem: 14296 (4288 - sendWebPageChunkedData)
Wifi RSSI: -70 dB
Wifi Type: 802.11N
IP: 192.168.1.135
GW: 192.168.1.1
Build: 20000 - Mega
GIT version: v2.0-20180213
Plugin sets: [Normal] [Testing] [Development]
Number of Plugins: 70
Core Version: 2_3_0
Flash Size: 4096 kB
Flash Writes (daily/boot): 0 / 4

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: Warning: Bug in OLED Framed plugin

#5 Post by vader » 15 Feb 2018, 10:45

Flash Writes (daily/boot): 0 / 4 means flash write of the FIRMWARE, not the data of any plug-ins!

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: Warning: Bug in OLED Framed plugin

#6 Post by mattlward » 15 Feb 2018, 14:21

Is there a spot to check for plugin writes? I do not see the flashed saved messages in my logs.

User avatar
vader
Normal user
Posts: 241
Joined: 21 Mar 2017, 17:35

Re: Warning: Bug in OLED Framed plugin

#7 Post by vader » 15 Feb 2018, 17:56

Depends on the the log level you have set. When you realised your project with the use of the dummy plugin, this does not write to flash (keeps data only in memory).

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: Warning: Bug in OLED Framed plugin

#8 Post by mattlward » 15 Feb 2018, 18:46

So, there is a "device" call dummy that keeps variables in ram versus flash? That is great, but I have all 4 "devices" slots full. 1)MQTT sniff 2)Framed OLED 3) SHT30 4) Switch. I guess maybe a request for more device slots may be in order?

I have my logging set wide open on this particular device because it is an active, in production device that I do all of my testing on. It, however is not unique in it's config.

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

Re: Warning: Bug in OLED Framed plugin

#9 Post by TD-er » 15 Feb 2018, 19:39

I really do not understand what you want to see or see changed.

The Framed plugin has a number of lines you can set in the web interface. The text you entered there is stored in the flash (when submit is pressed)
Each write to the flash memory (also called EEPROM) is counted. This is to get an indication of the wear of the flash memory, since you can only write a limited amount of time to the flash.
N.B. This counter is not stored in the flash, so when you power down the ESP, the value of this counter is lost.

When you use texts in the OLED display which can be substituted (e.g. values from a sensor, the time or any substitute string between '%' characters), the text on the OLED is changed, but these new strings are not stored into the flash. (better not be)

If you change any other setting in ESP easy (e.g. for another plugin), that data will also be stored in flash and thus be counted to the flash counter.

And about the 'devices' or 'tasks' as they are called in the sourcecode. You can add up to 12.
Just make sure that not all types of devices can be used in the spots 5...12 For example the switch should be in spot 1...4.

So, what do you want, that is not yet possible?

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: Warning: Bug in OLED Framed plugin

#10 Post by mattlward » 15 Feb 2018, 19:52

Ok, more clear now. I see now that there are arrows on the task pane! I did not realize those were there. Where should I read to find out what can go into 5-12 as it sounds like there are some stipulations.

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

Re: Warning: Bug in OLED Framed plugin

#11 Post by TD-er » 15 Feb 2018, 19:57

mattlward wrote: 15 Feb 2018, 19:52 Ok, more clear now. I see now that there are arrows on the task pane! I did not realize those were there. Where should I read to find out what can go into 5-12 as it sounds like there are some stipulations.
I was mistaken, it was not the switch, but the counter: https://www.letscontrolit.com/wiki/inde ... ogic_input (bottom line)

In short, it is about the plugins that need some direct reaction to an external (short) trigger that could be missed quite easily.

mattlward
Normal user
Posts: 70
Joined: 24 Jan 2018, 15:20

Re: Warning: Bug in OLED Framed plugin

#12 Post by mattlward » 15 Feb 2018, 20:34

Thanks, I am getting up to speed on this software and really like it. I would like to be a participant in further development, but stupid questions may fall out of me from time to time! :o

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests