lvgl / lv_web_emscripten

LVGL ported to Emscripten to be converted to JavaScript
MIT License
80 stars 28 forks source link

UI Mirror #20

Closed garudaonekh closed 1 year ago

garudaonekh commented 1 year ago

Hi, newbie question.

I wish to manage my controller from the TFT touchscreen as well as from mobile app.

So my plan is to use this library to embed the ui in my app and the lvgl for the controller.

My main question is the interactions/event handling and effort to make this work. I plan to use Websocket over MQTT for the communications between controller and the web ui. Moreover, is lvgl_js is a better solution for my case?

Thanks

kisvegabor commented 1 year ago

Hi,

To be honest I have no idea how to communicate with the outside world from an Emscripten LVGL UI. We use it only to make the examples/demos run in the browser.

lvgl_js would be really an option, however for MQTT you can use the C LVGL and a C MQTT library as well.

garudaonekh commented 1 year ago

I have no knowledge on React Native. However, I managed to get the lv_binding_js to work and can run the demo widget example. But as I know, this lv_binding_js can't run on ESP32 controller thus, i still need to write code twice.

What I plan to do is design/write once and deploy the code to ESP32 and export it to webview to run on MobileApp via lv_web_emscripten. So user can manage the ESP32 controller from TFT LCD and also from Mobile App.

So the missing parts for me are:

  1. A way to push the user interaction event from the lv_web_emscripten to the ESP32 Controller. Is it possible to customize lv_web_emscripten?
  2. update the lv_web_emscripten widget when property changes. For example, temperature value changes.

Thanks;

kisvegabor commented 1 year ago

But to be sure I understand it well:

The missing things are how to

Maybe all these can be solved by a websocket where you can

As all these can be handles in C and the question is how to compile the whole websocket library into webassembly. For this, it might be useful: https://emscripten.org/docs/porting/networking.html

garudaonekh commented 1 year ago

Thanks for your support. I need sometimes to understand more on emscripten. What it ports and what it doesn't and what can be updated to the ported code.

Somehow, like what is half way discussed issue: https://github.com/lvgl/lv_web_emscripten/issues/19. UI Separation from the controller logic is important so that it's easy for porting and code sharing.

garudaonekh commented 1 year ago

After checking emscripten detail, it is all possible. Thanks

There are some other problems to deal with but it is not in the scope of this issue.

Thanks