Help needed compiling for Unix (RPi Zero 2)

Hi, I have followed the guides on building lv_micropython for unix on the assumption that this would work on a raspberry zero 2 terminal.
I have used the image of Raspberry lite (no desktop) and compiled locally on the RPi.

All I seem to get is a flashing mouse pointer then it disappears.

I have used the master branch and also tried the release/v8 still no success.

Is there something I am missing as I have hit a brick wall and am unable to test/trial lvgl.

:cry:

update:
Ok I have realised that I wasn’t seeing a display because as I ran the scripts as the finished the display cleared. So I had to put in a sleep for a few seconds.

release/v8 I can get working but using the master branch I still haven’t quite got working.

How should I register a SDL display in the latest builds as import SDL comes back with “no module named ‘SDL’”
I see references for import display_driver but can’t work how to get it working.

Does anyone have a full example to get the hello world example to work https://docs.lvgl.io/master/examples.html

You can use the -i command line option to open the interactive terminal even when you provide a script as an argument, so you don’t need sleep.

Do you have SDL installed on the system?
Try something like sdl2-config --version

Another option for small Linux systems is to use FrameBuffer instead.

Thanks @amirgon

sdl2-config --version returns 2.0.14

and the -i command works great from a remote terminal.

I am able to get some results with both SDL and FrameBuffer with the release/v8 branch, FB colours are inverted but neither of these work with the master branch.

As I’m just starting out should I be using v8? my only reservation is I don’t want to start learning with something that could be depreciated quickly - what is my best approach to start?

This is what I’m trying to run on master branch, I have a feeling i’m not registering the display_driver correctly.

import lvgl as lv
import display_driver

# Change the active screen's background color
scr = lv.scr_act()
scr.set_style_bg_color(lv.color_hex(0x003a57), lv.PART.MAIN)

# Create a white label, set its text and align it to the center
label = lv.label(lv.scr_act())
label.set_text("Hello world")
label.set_style_text_color(lv.color_hex(0xffffff), lv.PART.MAIN)
label.align(lv.ALIGN.CENTER, 0, 0)

In my v8 SDL test I’m using

import lvgl as lv
lv.init()

import SDL
SDL.init()

# Register SDL display driver.
draw_buf = lv.disp_draw_buf_t()
buf1_1 = bytearray(480*10)
draw_buf.init(buf1_1, None, len(buf1_1)//4)
disp_drv = lv.disp_drv_t()
disp_drv.init()
disp_drv.draw_buf = draw_buf
disp_drv.flush_cb = SDL.monitor_flush
disp_drv.hor_res = 480
disp_drv.ver_res = 320
disp_drv.register()

# Register SDL mouse driver
indev_drv = lv.indev_drv_t()
indev_drv.init()
indev_drv.type = lv.INDEV_TYPE.POINTER
indev_drv.read_cb = SDL.mouse_read
indev_drv.register()

###############################################################

# Change the active screen's background color
scr = lv.scr_act()
scr.set_style_bg_color(lv.color_hex(0x003a57), lv.PART.MAIN)

# Create a white label, set its text and align it to the center
label = lv.label(lv.scr_act())
label.set_text("Hello world")
label.set_style_text_color(lv.color_hex(0xffffff), lv.PART.MAIN)
label.align(lv.ALIGN.CENTER, 0, 0)

Stable version is v8.
v9 is in active development and planned to be released by the end of this year.
You can use either, both are supposed to be stable enough.

Try adding this:

lv.init()
event_loop = lv_utils.event_loop()
disp_drv = lv.sdl_window_create(480, 320)
indev_drv = lv.sdl_mouse_create();