Warning: Bug in OLED Framed plugin
Posted: 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:
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!
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
(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!