Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Mirror #20

Closed
garudaonekh opened this issue Sep 24, 2023 · 5 comments
Closed

UI Mirror #20

garudaonekh opened this issue Sep 24, 2023 · 5 comments

Comments

@garudaonekh
Copy link

garudaonekh commented Sep 24, 2023

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
Copy link
Member

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
Copy link
Author

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
Copy link
Member

But to be sure I understand it well:

  • For ESP32 you would like to use LVGL in C and there are no questions here
  • For mobile you would like to compile the same code that you have used on ESP to a HTML file using Emscriptem.

The missing things are how to

  • update the UI in the HTML file (e.g. label text, change screen, etc)
  • get notified if a button is pressed

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

  • receive commands like: "set_temperature1: 27" and as you process the messages you know which labels to update.
  • send notifications when a button is pressed

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
Copy link
Author

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: #19. UI Separation from the controller logic is important so that it's easy for porting and code sharing.

@garudaonekh
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants