Getting started with lvgl on linux  - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: November 15, 2024, 10:23:36 am
content: I'm trying to setup my first test project oy lvgl on linux.Yes i have read:https://blog.lvgl.io/2018-01-03/linux_fbit tell you what files you need. But no single download of lvgl actually has all of these files in it and I have no idea what to expect to find in the folders so I do not deem the article much help actually. I have indeed downloaded some setups from github where while the lvgl folder is there for example it is empty.Last time I was shown how to do this it involved squareline studio which then still needed something copying into it from elsewhere.I'm also a little confused on the versions as different repositories are at different versions. If I were to assemble the files as described in the article from different git repositories while guessing about the contents of any folders it is likely I will create my own incompatibility anyway.

author: JPortici
author_rank: Super Contributor
timestamp: November 15, 2024, 12:39:10 pm
content: https://docs.lvgl.io/master/details/integration/ide/pc-simulator.htmlwhen i started jerking around with LVGL i used one of those projects. The Qt one worked best for me, as i use Qt a lot (i tried the visual studio one, worked but was a huge PITA to change anything or to reproduce) and it did literally just work™

author: Simon
author_rank: Unknown
timestamp: November 15, 2024, 03:51:26 pm
content: Well I am looking to do the programming an linux as that is the release target. I had not realized that anything that would run on linux/windows was being called a simulator.

author: JPortici
author_rank: Super Contributor
timestamp: November 15, 2024, 04:17:34 pm
content: I really, really, really don't understand how you keep overcomplicating stuff.Yes, they call it simulator as it is intended to be a simulator to sort out the UI in something you don't have to spend seconds/minutes to flash every time you change something.Yes, it doesn't mean you can't use LVGL to build PC applications, but why would you, unless you want a consistent UI between embedded and PC*? You can, doesn't mean you should.Why not just use Qt** or WxWidgets as they are the standard way to do things*which is the reason why Qt for embedded and Qt for android/iOS exist.**bonus: it's really multiplatform, i'm preparing for the inevitable switch from windows to debian, as i will refuse to use win 11 for development, will keep a VM for deployment and testing but then i'll use linux, period. So i opened a bunch of my projects and just hit compile. Didn't have to change a thing

author: Simon
author_rank: Unknown
timestamp: November 15, 2024, 04:47:15 pm
content: The problem is that.... I don't know that I'm over complicating stuff.I have never done any linux work before. This is my first project. The final target will be a SBC with a small screen. The application wants things like dials/gauges. I am trying to design a HMI. A previous attempt was done with an ESP32 but it really needs to be a computer with some power behind it for further developments. Previously lvgl was used and people like the result. The simplest way to not get hate is to replicate the existing layout etc.If lvgl is not really for linux then OK, I'll use something else. I've spent several months now like this going in circles because.... well when people put up their tutorials etc they can't cover everything and make assumptions about what i know, problem is I don't know, and one semicolon out and it's like the world is falling apart so I never know how much I am going wrong or missing.i will look at QT

author: globoy
author_rank: Frequent Contributor
timestamp: November 15, 2024, 05:04:07 pm
content: Did you find the lv_port_linux repo?https://github.com/lvgl/lv_port_linux

author: Simon
author_rank: Unknown
timestamp: November 15, 2024, 05:11:14 pm
content: Quote from: globoy on November 15, 2024, 05:04:07 pmYes! as you can see it comes with no contents in the lvgl folder and the drivers folder is missing. The lvgl folder on github links to the main lvgl git project. So I have to peice it together?

author: globoy
author_rank: Frequent Contributor
timestamp: November 15, 2024, 05:33:56 pm
content: Did you clone it or just download the zip file? A clone of the repo should pull in the lvgl repo (at this moment:https://github.com/lvgl/lvgl/tree/8d47460580c6e17ff800aaac2dbbb11c3520cc44). That repo src has a drivers subdirectory that has all the linux drivers (fb, SDL, wayland, etc). But you don't get this if you just download the linux port repo as a zip file. You have to recursively check it out to get the submodules as shown in the readme.

author: Simon
author_rank: Unknown
timestamp: November 15, 2024, 05:45:14 pm
content: I see, no I downloaded it. But if it's not for linux proper I guess there is no point in bothering.

author: globoy
author_rank: Frequent Contributor
timestamp: November 15, 2024, 05:50:36 pm
content: Quote from: Simon on November 15, 2024, 05:45:14 pmWhat do you mean by that? It can surely run on linux. I've done it using fbdev for output and evdev for input. It's just that it supports more devices than just those two on linux (this is nice as you can both create a linux embedded device with only the LVGL GUI like any STM32 or ESP gadget or you could even create a desktop app sitting in a window for linux using it).

author: Simon
author_rank: Unknown
timestamp: November 15, 2024, 05:53:40 pm
content: Well this is my problem, different people have different ideas. I know Qt is kind of mainstream although I also just want to get started with something.

author: globoy
author_rank: Frequent Contributor
timestamp: November 15, 2024, 07:45:08 pm
content: I'm sorry Simon, I must be missing what you're really asking.I was replying because you mentioned perhaps starting with LVGL since people liked the previous system. It is possible to run LVGL on Linux. I just downloaded and compiled the lv_port_linux on a Raspberry Pi 4 with the Pi LCD screen and it worked straight-away. I stupidly started with dietpi so I had to install a bunch of stuff (git, cmake, compilers) but the actual build and running of the demo was exactly as documented in the repo. Worked first time.Of course Qt could also be used and is definitely a norm for Linux. My point was LVGL can work just fine too and there's no reason not to use it if it's a good fit (for example you know it or you have an existing code base to start with).Good luck with your project.

author: Simon
author_rank: Unknown
timestamp: November 15, 2024, 08:09:38 pm
content: Well for me it is a complete start from scratch both with lvgl and linux. If I can come up with something decent in something else I'm just as happy. The previous design was done by someone who no longer works for the company, he just loved the ESP32 to the point that everything was an ESP32 project. For me they are just in the middle between a micro controller and a SBC, very useful I am sure but not for my requirements so I've not ventured into them. Ultimately I will need to produce PDF reports so a SBC is a must.If I use lvgl I am into using C/C++ for everything, I'm sure that i could have separate little programs running if I need to create the different parts in different things but no idea as of yet how to do that.QT seems to come with a full development package/IDE so maybe it is the better option for those long term goals of the project. I will also need to access a CAN bus and run communications with something.