I've got this idea for tiny, pluggable scriptable widgets for OBK yesterday. OBK already features a hardcoded set of channel types:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/channelTypes.md
we also support a custom REST page for displaying channels:
https://www.elektroda.com/rtvforum/topic4040354.html
but we didn't have anything in between....
so my idea is to create a WIDGET driver, that basically allows you to create short custom code snippets in HTML and JS
they are placed on main obk page, in two modes:
- either in refreshed automatically state div
- or before this state div (no auto refresh)
It's already in the main tree, enabled on Windows:
html file:
script:
Result:
I am thinking that maybe it could be used, along with REST interface, to display more custom data. See REST tutorial:
https://www.elektroda.com/rtvforum/topic3971355.html
I am also thinking about adding something like $CH1 support to the said widgets directly, maybe?
source:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/driver/drv_widget.c
Can you give it and try and tell me some feedback, @divadiow , @max4elektroda , @insmod , @DeDaMrAz , @XJ_ ? Watch for bCache setting, I don't think that reading LFS file on each page refresh is really that optimal... still, it's just a read, not a write, so it should not at least wear the flash.
Helpful post? Buy me a coffee.
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/channelTypes.md
we also support a custom REST page for displaying channels:
https://www.elektroda.com/rtvforum/topic4040354.html
but we didn't have anything in between....
so my idea is to create a WIDGET driver, that basically allows you to create short custom code snippets in HTML and JS
they are placed on main obk page, in two modes:
- either in refreshed automatically state div
- or before this state div (no auto refresh)
It's already in the main tree, enabled on Windows:

html file:
Code: HTML, XML
script:
startDriver widget
widget_clearAll
// first argument is location - 0 means "static" (before refreshable state div), 1 means "state" (it's refreshed every second or so)
// second argument is bAllowCache, if allowed, it's cached in RAM instead of LFS read every refresh
widget_create 0 0 demo1.html
Result:

I am thinking that maybe it could be used, along with REST interface, to display more custom data. See REST tutorial:
https://www.elektroda.com/rtvforum/topic3971355.html
I am also thinking about adding something like $CH1 support to the said widgets directly, maybe?
source:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/src/driver/drv_widget.c
Can you give it and try and tell me some feedback, @divadiow , @max4elektroda , @insmod , @DeDaMrAz , @XJ_ ? Watch for bCache setting, I don't think that reading LFS file on each page refresh is really that optimal... still, it's just a read, not a write, so it should not at least wear the flash.