X11 Programming on Raspberry Pi - qt

I'm wanting to develop a GUI application for the Raspberry Pi. I want this application to run without the overhead of a Desktop GUI environment, directly on X11. My google searching has led me nowhere trying to find examples of people doing this. My preferred platform is Qt, although if an option were available in another language/environment I would be open to it. My question is: does anyone know of examples of applications that do this? I'm just looking for anything to get me started.

Related

Can QT and FreeRTOS work together on MCU?

I may ask a stupid question. I want to use FreeRTOS as the OS on my NXP MCU MIMXRT1062XXXXB. The MCU connects to a display. I want to use QT to development user interface application. I want to know if it is possible to run QT application base on FreeRTOS on MCU?
Yes it is possible - lots of people do it. My first Google search for this hit this page on the QT website: https://doc.qt.io/QtForMCUs-2.1/qtul-using-with-freertos.html

QT, understanding cross-compiling for Raspberry PI3

I'm trying to understand how to cross-compile for a Raspberry PI3.
First, let me check if I understood correctly the meaning of the cross-compiling: is it to compile for a hardware that is different from the machine I'm building my application? This means, building for example a linux application from a windows system?
Second, all the tutorials I found required the building of QT for the target platform. Is this because to build a QT application I need the target-hardware-specific-built-version of QT libraries? Why there are no pre-built versions?
Third, I don't understand why a raspberry image is required in all the tutorials I could find.
Those are some of the tutorials I found, I found really strange that such a long setup is needed to cross-compile an application and I'm just wondering if what I'm trying to do (compile from a Linux machine a raspberry-pi3 QT application) is what those articles are really describing.
Tutorial 1, Tutorial 2, QT official embedded device page
You are correct, cross-compiling is building on one type of hardware (Host) to run on a different type of hardware (Target).
If you are willing to go for a commercial version of Qt, Qt will provided a turnkey solution (Boot to Qt) for developing on a specific Raspberry Pi. By turn-key, I mean they have all the target tools for cross compiling and the correctly built libraries for the target, etc. It's not cheap, and probably not the way to go for the hobbyist.
If you go with the open source (free) version of Qt, you will need to do most of the setup work yourself. The reason you are having a hard time finding everything built for you are mostly related to two things: The size of the distribution, and what you are building for what (i.e. which Qt version for which Raspberry Pi and which Raspberry Pi Linux version and which drivers, etc.).
The Raspberry Pi image is needed as you need the correct libraries to build Qt against. The cross-compilation tools need to link against the target (Raspberry Pi) images.
Yes, it is a long process to setup a Qt cross compilation environment, but it only needs to be done when once for each Qt version. Once you have setup the environment, building and deploying a Qt application on the target Raspberry Pi is really quite fast and easy.

How to combine a Qt-GUI with ROS?

I'm currently working on a Qt-GUI with which I plan to remote control a robot. The robot is ros-controlled and equipped with multiple cameras. The topic is completely new to me and I just started learning both Qt and ROS and have some basic questions. I didn't make any progress googling around so I finally decided to post it here:
How can I connect data from ROS with Qt? So let's say I kind of want to live-stream the recordings of the cameras into my GUI. How is the general procedure there?
I've seen this ROS Qt Creator Plug-in. Is that something I want to use for this project?
Thanks a lot to everyone answering.
This is my first post here so I hope I didn't mess anything up or flouted forum regulations.
Edit 1: I am working with C++.
Edit 2: In case it helps you giving me advice; the rostopic type of the camera topic is sensor_msgs/Image.
For question 1, since the images are coming over the sensor_msgs/Image topic, using ROS with OpenCV's cv_bridge in the Qt application to receive the the incoming image stream from ROS into the Qt-GUI is a good start. There are several tutorials that cover integrating OpenCV into a Qt project. An important advice is to keep track of the image properties (size, color format, etc.), which will help in displaying the image properly in the GUI. Disclaimer: I have worked with Qt libraries on the Python side, not with C++.
As for question 2, the information for setting up, building, and running the code within the Qt-Creator can be very convenient. There are times where it is prudent to use an IDE to build, run, and debug code (to deal with memory management, segmentation faults, etc.), while other for other times running "catkin_make" or "catkin build" in the root directory when the hardware is minimal.

Running QT5 in an embedded device with 64 MB RAM

I have been working with QML for a couple of weeks now. But now a new requirement has risen where I have to check whether I can run QT5 in an embedded device for my project. I need this for my GUI related operations. The device has an ARM processor (Intel ARM920T-PXA27x processor to be exact) with 64 MB RAM. 32 MB will be taken up for the OS and the rest will be available for application and QT.
I have to check whether this is possible. I have googled for some references and unable to find a suitable answer to my requirement with QT5. I need the GUI libraries but my project does not have advanced graphical requirements like swiping or animations. It contains basic controls like texts, buttons and lists/grids. Since I am new to QT especially to this part, I would like to hear whether
1) Is this a viable option and should I keep digging more into this? Any feedback would be welcome to know if it's worthy to spend time to attempt this or if it's a lost cause.
2) If there are options, could you point me in the right direction to look more into this?
It depends on the OS you are running on your SOC.
It's definitely possible when running Linux. You can e.g. use Qt Lite for configuring a minimal static build of Qt. Then you deploy your statically linked application to the device. You can check this blog post for experiences with Qt Lite.
One possibility is to go with Qt for Device Creation for the whole embedded Linux based software stack which boots to a UI implemented with Qt technologies.

SQLite+ Embedded linux + Pygtk or QT/c++

I'm trying to build an application in my ARM9 (Freindly ARM) board that will get data via serial port and update the database.
Now I need to port SQLite in my embedded linux and write an application to store my values.
How to port SQLite to Embedded linux
Pygtk or Qt? Which is easy for a newbie ?
P.S: I know I'm asking a lot of questions in a single post, but I just thought giving the complete picture will help to give a better suggestion. If not personalized opinions, I'll be grateful if you guys can give me pointers to good links/tutorials. :) Thanks.
1.
You don't need to port sqlite to the your Freindly ARM ARMv9 board.(as Mat has already mentioned)
I am going to assume that you have a mini2440 or
a micro2440.
Either way it is a Samsung S3C2440 chip.
sqlite works on this board as per the following thread.
Sumeet's post has cross compliation instructions.
Qt cross compliation works as per the following thread
So does Python and Gtk.
You have 2 options when it comes to cross-compliation,
Cross compile yourself
Use a tool like buildroot or openembedded's bitbake
For further resources on cross-compliation and building packages for this board
see the following resources.
mini2440 Google Code Project, specifically see the wiki and download sections
FriendlyArm Forum
FriendlyArm Downloads
linuxmce mini2440 wiki page
HOWTO-Getting-Started-With-OpenEmbedded for mini2440
Further HOWTOs
2.
PyGTK and PyQt are both relatively easy to learn in comparison to learning and debugging cross compilation on embedded architectures. If by Qt you didn't mean PyQt but instead meant C++ and Qt, then it not only becomes a choice of GUI toolkit, but also of language. I don't know your familiarity with Python or with C++, so I don't know which would be easier for you.
Which one you want to use is up to you.
Resources for both are linked to below
PyQt4 Tutorial
PyGTK Tutorial

Resources