Skip to content

LVGL examples, do they work? #17

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

Closed
hpssjellis opened this issue Sep 29, 2021 · 26 comments
Closed

LVGL examples, do they work? #17

hpssjellis opened this issue Sep 29, 2021 · 26 comments
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@hpssjellis
Copy link
Contributor

@sebromero

I feel like none of the LVGL examples work. Can someone try one of them such as:

https://github.com/arduino-libraries/Arduino_Pro_Tutorials/blob/main/examples/Creating%20GUIs%20with%20LVGL/lvglCounter/lvglCounter.ino

and report back if they work for you on the PortentaH7. I am using MBED core 2.5.2 and LVGL library 8.0.2

For me nothing compiles, I haven't even go around to connecting any USB HUB cables.

@per1234
Copy link
Contributor

per1234 commented Sep 30, 2021

LVGL library 8.0.2

The example specifies that 7.11 should be used:
https://github.com/arduino-libraries/Arduino_Pro_Tutorials/blob/main/examples/Creating%20GUIs%20with%20LVGL/lvglCounter/lvglCounter.ino#L2

/*
    Using LVGL v7.11
*/

The sketch compilation test done by the continuous integration system uses version 7.11.0 and compiles the example successfully:
https://github.com/arduino-libraries/Arduino_Pro_Tutorials/runs/3706391688?check_suite_focus=true#step:3:230

@sebromero
Copy link
Collaborator

Hi @hpssjellis ! Looks like there were some API changes in the new version of the LVGL library. Try with 7.11 as @per1234 pointed out.

@hpssjellis
Copy link
Contributor Author

hpssjellis commented Oct 1, 2021

@per1234 and @sebromero you are correct it does mention to use version 7.11 of LVGL.h. Yes, it does work which is great, using the deprecated library is a bit of a problem.

I think I started with the Portenta examples Portenta_lvgl which did not have the reminder about 7.11, and still doesn't compile, it seems to have issues finding lv_conf.h

Deprecation is the bane of TechEd.

Is there some other up-to-date graphics library we could use such as Adafruit_GFX for doing some graphics on a computer display?

or

Is there a way to make the portenta use the latest LVGL library?

@marqdevx
Copy link
Member

marqdevx commented Oct 4, 2021

Hey @hpssjellis we pointed the version used but my plans were to update the sketch and tutorial to fit the new API.

The LVGL examples from the Core need to be updated, I will do it.

Follow the tutorial of the LVGL, you just need to #include "Portenta_LittleVGL.h" (it will include the lv_conf.h automatically)

I will make a branch with a working sketch with the LVGL@v8

@hpssjellis
Copy link
Contributor Author

Thanks @marqdevx the counter example using [email protected] works great, but even with #include "Portenta_LittleVGL.h" I can't get the Arduino_MBED example Portenta_lvgl.ino working it seems to have 2 other issues. One is line 92 where SRCL should be SCROLLABLE. and then some other issue. Any hints about it.

If you do get LVGL@v8 working that would be great.

Also, is this doable from both M7 and M4 or only from M7?

@marqdevx
Copy link
Member

marqdevx commented Oct 4, 2021

Im aware of the examples of the Core, thanks for remind it. I will make a PR, hopefully they will be fixed for the next release :)

I've tried it before and its working, just need to make those small changes.

Working from both individually, you could use RPC to make changes from M7 to M4(or vice versa). but you should only have one LVGL "manager" (if im not wrong, I will check that asap).

@sebromero
Copy link
Collaborator

Is there a way to make the portenta use the latest LVGL library?

@hpssjellis As @marqdevx mentioned, the example needs to be adapted, but the library itself should work/compile fine. If you feel like, you could have a look at the LVGL changelog here and adjust the example accordingly so it reflects the API changes.
The underlying issues is that our libraries don't have versioned dependency management. So we can't specify with which version a library is compatible with. This would solve all these issues. One day we'll have it...

@hpssjellis
Copy link
Contributor Author

@marqdevx just post here when it is ready to test or the PR has been accepted.

@sebromero I agree version control would make examples much more stable. I always use versions when using javascript and npm.

<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"> </script> 

LOL, TensorflowJS is now at version 3.9.0

It is ridiculous how fast examples and videos can be deprecated, and makes teaching the subject a miserable experience.

Good luck updating the examples!

@marqdevx
Copy link
Member

Hey @hpssjellis I've made the changes to the tutorial example, check it out here https://github.com/arduino-libraries/Arduino_Pro_Tutorials/blob/marqdevx/lvgl-v8/examples/Creating%20GUIs%20with%20LVGL/lvglCounter/lvglCounter.ino

You will need atleast to update the porting.cpp inside the Core, i will make a PR once I fix an issue with the USB examples (I made it compatible with both v8 and the rest of the versions)
https://github.com/marqdevx/ArduinoCore-mbed/blob/marqdevx/lvgl-update/libraries/LittleVGL/porting.cpp

And update the widgets example aswell
https://github.com/marqdevx/ArduinoCore-mbed/tree/marqdevx/lvgl-update/libraries/LittleVGL/examples/v8/Portenta_lvgl

@hpssjellis
Copy link
Contributor Author

@marqdevx. Wow this is great. Thanks so much.

I updated LVGL to v8.0.0

replaced the porting.cpp file

Tried both widgets and counter and they both work! Well done. I will wait for the next mbed version to make my video for my maker100 course.

image

@marqdevx
Copy link
Member

Thanks!

Small update: this changes will be included in this PR to the Core arduino/ArduinoCore-mbed#340

Regarding LVGL: Portenta_LittleVGL.h will be renamed to Portenta_lvgl.h

Im making the current example be ready for that release here https://github.com/arduino-libraries/Arduino_Pro_Tutorials/tree/marqdevx/lvgl-v8

So I will close this issue, have a nice one :)

@marqdevx marqdevx added the type: imperfection Perceived defect in any part of project label Oct 13, 2021
@marqdevx marqdevx self-assigned this Oct 13, 2021
@hpssjellis
Copy link
Contributor Author

@marqdevx

You might want to change this

/*
    Using LVGL v7.11
*/

@hpssjellis
Copy link
Contributor Author

hpssjellis commented Apr 6, 2022

@marqdevx @sebromero I am testing LVGL with Arduino Verison 3.0.1 and LVGL version 8. Not having much success with the Portenta Board examples, just testing the counter now. Nothing is working for me. I will dig deeper if any of it is working for you.

I also found this repo that might have similar code

https://github.com/lvgl/lv_port_stm32h745i_disco

By the way the Portenta-board LVGL code is so confusing I would not know what to do with it. The counter code is much easier to work with. Even it has a few confusing parts.

A consistant error I am getting for the counter program is that

lvglCounter:10:31: error: variable or field 'updateCounterTask' declared void

the default Portenta program compiles but nothing happens on screen.

image

@marqdevx
Copy link
Member

marqdevx commented Apr 7, 2022

Hey @hpssjellis !
I will have a look to the Portenta-board LVGL sketch

But right now the Counter sketch inside Arduino_Pro_Tutorials it is only compatible with LVGL v7
https://github.com/arduino-libraries/Arduino_Pro_Tutorials/blob/main/examples/Creating%20GUIs%20with%20LVGL/lvglCounter/lvglCounter.ino#L2

In v8 they changed the task management, so I will make a port of the counter sketch and try to make clearer the example inside the Core Examples.

:)

@marqdevx marqdevx reopened this Apr 7, 2022
@marqdevx marqdevx added the type: enhancement Proposed improvement label Apr 7, 2022
@hpssjellis
Copy link
Contributor Author

@marqdevx Thanbk you for looking into this. It is the last program needed for my course on The Portenta Maker100

I find the coding very alien, any chance you could make 1 program that just puts text and a line on the screen. That would be a great starting point for my students.

Another amazing starter would be Portenta Vision shield camera output, with text and a line on it.

@marqdevx
Copy link
Member

marqdevx commented Apr 7, 2022

You have good examples from LVGL at https://docs.lvgl.io/master/examples.html

A basic "Hello World" label would be:

    lv_obj_t * label = lv_label_create(lv_scr_act());     /*Add a label to the button*/
    lv_label_set_text(label, "Hello World");                /*Set the labels text*/
    lv_obj_center(label);

I will check if I can simplify/beautify it a little.

Thanks for your suggestion! :)

@PRT1986
Copy link

PRT1986 commented Apr 8, 2022

I would also really enjoy some simple examples showing how to create texts, colors and buttons.
Further on a example integrating usb-c touch screen feedback to the Portenta to control a LED or Serial output

@marqdevx
Copy link
Member

marqdevx commented Apr 8, 2022

@hpssjellis could you please check if with both latest Core version and LGVL does this example work for you?
https://github.com/arduino-libraries/Arduino_Pro_Tutorials/blob/marqdevx/lvgl-v8/examples/Creating%20GUIs%20with%20LVGL/lvglCounter/lvglCounter.ino

LVGL v7 wasn't working for me.
I will check it out.

@hpssjellis
Copy link
Contributor Author

Can someone else also test this code from @marqdevx https://github.com/arduino-libraries/Arduino_Pro_Tutorials/blob/marqdevx/lvgl-v8/examples/Creating%20GUIs%20with%20LVGL/lvglCounter/lvglCounter.ino

I don't really trust my USB-C to HDMI converter connections until I see it working. Perhaps @sebromero or @PRT1986 when you get time.

Mine compiles, but gives a strange flashing green when connected to HDMI.

@PRT1986
Copy link

PRT1986 commented Apr 11, 2022

Counter version worked for me with LVGL 7.11 library firmware, not tested anything else at this stage

@hpssjellis
Copy link
Contributor Author

Thank you @PRT1986
Was that with Arduino MBED version 3.0.1?

@PRT1986
Copy link

PRT1986 commented Apr 11, 2022

image

@PRT1986
Copy link

PRT1986 commented Apr 11, 2022

IDE 1.8.19

@marqdevx
Copy link
Member

I've tried LVGL 8.2.0 and v7.11.0 with mbed_portenta 3.1.0 and they work fine 🤔
@hpssjellis if still not working for you try to update the bootloader just in case.
let me know!

@hpssjellis
Copy link
Contributor Author

Thanks @marqdevx and @per1234 my main skill is messing up everything before my students try it! This issue is definitely on my side either my screen or connector. Still interested @marqdevx if you can get that basic text and line example going. I will fix things on my end.

@marqdevx
Copy link
Member

marqdevx commented Apr 11, 2022

You have good examples from LVGL at https://docs.lvgl.io/master/examples.html

A basic "Hello World" label would be:

    lv_obj_t * label = lv_label_create(lv_scr_act());     /*Add a label to the button*/
    lv_label_set_text(label, "Hello World");                /*Set the labels text*/
    lv_obj_center(label);

I will check if I can simplify/beautify it a little.

Thanks for your suggestion! :)

This is the basic text code. You can use the examples from LVGL docs.
I will note this LVGL "request" right now we have some other priorities, I will ping you on the LVGL things that we make :)

@per1234 per1234 added conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself and removed type: enhancement Proposed improvement labels Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants