Hi all, this post is for two things:
1. to announce that gui-v2 source code is now public: https://github.com/victronenergy/gui-v2.
2. to start discussion/get feedback on how to allow modifications again.
In case you have not seen it yet, we're in the final stages of replacing the current GUI in Venus OS with a new one, called gui-v2. For more details, see https://bit.ly/gui-v2.
Modifying the UI is different with gui-v2. While gui-v1 in itself was not open source as a repo on for example Github, all the visible elements were taken care of in QML and those are non-compiled files that could be edited after obtaining root access to the GX device. This allowed for modifications. Small ones, but also large projects like Kevin Windrem's GuiMods.
In gui-v2, the QML files are still on the root fs and can be edited, but doing so only changes the version you see on screen. It won't change the version used remotely in a browser, ie. the WebAssembly version. That version is a compiled single binary, which is built at the time of the Venus OS release and cannot be rebuilt on the GX itself.
The WebAssembly version is hosted on the GX and served to a browsers over LAN and remotely over VRM. The browser downloads the precompiled binary (WASM file) and the runs it locally. Note that for VRM there is a caching mechanism in place; but done in such way that changing the WASM build on the GX will also make its way over VRM to be access remotely.
Building the WASM requires lots of tooling installed (Qt6, emscriptem), and then takes a while. To learn more, see the gui-v2 automated build, https://github.com/victronenergy/gui-v2/blob/main/.github/workflows/build-wasm.yml, a Github Action workflow as well as the how to build instructions in the gui-v2 Wiki: https://github.com/victronenergy/gui-v2/wiki/How-to-build-venus-gui-v2.
- The level of modifications done on our current UI varies a lot:
Some commercial integrators install a quite different UI with a USB stick, which requires them to maintain a build process. - UI enhancements, like Kevin Windrem's GuiMods.
- Add-ons that come together with installing other functionality onto Venus OS; like dbus-serialbattery, https://github.com/Louisvdw/dbus-serialbattery for example.
Victron is committed to make modifications possible again. But I have not yet seen a clear winning solution for how to do that. The team working on gui-v2 as well as myself are primarily busy with getting gui-v2 ready for prime time.
As a first step we've made gui-v2 open source: https://github.com/victronenergy/gui-v2/.
Some ideas that came up so far are:
- Add a web browser component to gui-v2 (that part is easy, it exists in Qt); and make it show a webpage hosted on Venus OS, or possibly also web page on other devices in the system. Same can (relatively easily) be made available remotely just like we do with the Node-RED dashboard for example. First step would be a simple test, also to see how feasible it is wrt CPU and memory resources. Involved building Venus OS including the web component for Qt6 and then making small proof of concept.
- Make gui-v2 dynamically load components: You can load QML and JavaScript resources from URLs (see https://doc.qt.io/qt-6/qtqml-documents-networktransparency.html) and for QML components, you can even build strings dynamically and then compile and instantiate them (see https://doc.qt.io/qt-6/qml-qtqml-qt.html#createQmlObject-method).
- Do a full build of gui-v2, both the ARM as well as WASM build; and to get that mod, users need to install those (or script on GX downloads those). The disadvantage of this approach is that you cannot combine different modifications.
I am looking forward to hear your thoughts. I invite the community to share details of what you modify, and whether you have idea and skill to help us find a solution.