Introduction
This is the chapter web page to support the content in Chapter 14 of the book: Exploring Raspberry Pi – Interfacing to the Real World with Embedded Linux. The summary introduction to the chapter is as follows:
In this chapter, you are introduced to rich user interface (UI) architectures and application development on the Raspberry Pi (RPi). Rich UIs allow for a depth of interaction with an application that is not possible with command-line interfaces (CLIs)—in particular, the addition of graphical display elements can result in easier-to-use applications. Also introduced are different RPi architectures that can support rich UIs, such as general-purpose computing, touchscreen display modules, and virtual network computing (VNC). Different software application frameworks are examined for rich UI development, such as GTK+ and Qt. The Qt framework is the focus of the discussion, largely due to its comprehensive libraries of code. An example rich UI application is developed for the RPi that uses the DHT temperature and humidity sensor from Chapter 6. Finally, a feature-rich remote fat-client TCP application framework is developed, along with an example that uses the same sensor.
After completing this chapter, you should hopefully be able to do the following:
- Configure the RPi as a general-purpose computing device and use Bluetooth peripherals to control it.
- Acquire hardware for LCD touchscreen display applications.
- Use virtual network computing (VNC) to remotely execute graphical user interface (GUI) applications on the RPi.
- Build rich user interface (UI) applications that execute directly on the RPi using the GTK+ and Qt frameworks.
- Build Qt applications with advanced interfaces that connect to hardware sensors on the RPi.
- Build fat-client remote Qt applications that communicate using TCP sockets to a server that is executing on the RPi.
- Enhance TCP server code to be multithreaded, in order to allow multiple simultaneous connections from TCP client applications.
- Build remote Qt GUI server applications that communicate, using TCP sockets and JSON messages, to a client application on the RPi.
Digital Media Resources
Below are some high-resolution images of the circuits described in the book. They are reproduced in colour and can be printed at high resolution to facilitate you in building the circuits.
The Development of the Qt RPi Weather Sensor GUI application
The Qt Weather Sensor GUI Application Components
Digital Media Resources
Here are some videos on Qt development with the BeagleBone to give you a flavor of the environment in action. The steps for installing the Qt Development Environment are described throughout the chapter of the Exploring Raspberry Pi book, and it is possible to achieve similar outcomes on the RPi to those displayed in this set of videos.
This is the first video in a set of three on Qt application development on the Beaglebone or any other embedded Linux device. This video introduces the LCD module that I used, reviews it and then discusses how you can install it and develop very basic onboard GTK GUI applications. This leads to the second video where I set up a full toolchain for Qt application development under embedded Linux (Qt for embedded devices) and then in the final video I demonstrate an example application that uses an accelerometer and LED to act as output/input devices and I provide the full source code.
This is the second video in a set of three on Qt application development on the BeagleBone or any other embedded Linux device. The first video introduces the LCD module that I used and this video is where I set up a full toolchain for C++ Qt application development under embedded Linux (Qt for embedded devices). This toolchain allows us to cross compile Qt applications for the Beaglebone, deploy the applications directly to the beaglebone with a single click and even use remote debugging using gdbserver to diagnose any problems with our applications. The main use of this platform is for GUI application development when a LCD module, or external display is present.
This is the third video in a set of three on Qt application development on the Beaglebone or any other embedded Linux device. The first video introduces the LCD module that I used and the second video is where I set up a full toolchain for C++ Qt application development under embedded Linux (Qt for embedded devices). This toolchain allows us to cross compile Qt applications for the Beaglebone, deploy the applications directly to the beaglebone with a single click and even use remote debugging using gdbserver to diagnose any problems with our applications. The main use of this platform is for GUI application development when a LCD module, or external display is present.
Errata
None for the moment
Recommended Books on the Content in this Chapter
Dear Derek
I’m trying to compile QtWeather example in Qtcreator with raspberry pi cross tool-chain.
but i get error because the compiler cant find wiringPi.h.
i don’t know how to add these libraries to this example.
could you please help me?
Regards,
Dani
Hi Dani, Once you have wiringPi installed, you can add the library to the PRO file. Check the PRO file in the project QtWeather — see: https://github.com/derekmolloy/exploringrpi/blob/master/chp14/QtWeather/QtWeather/QtWeather.pro I add the library using
LIBS += -lwiringPi
Hope that helps, Derek.
I’m trying to install the qt5-default package (Page 590) on a Model B+. Even after update and upgrade this package can not be found. I assume it’s because the package does not work on Model B+. Can someone confirm this?
Thanks,
Tom
I installed Qt5 package on a Pi3, can open the creator – but the next stage – configuration is causing me grief.
Can anyone help ? – i tried to relate to Beagle videos, which I believe cover the necessary – but no joy.
Shame – seems like a cool package.
Here’s hoping :-
Phil
I installed Qt on my RPi3 and compiled and ran the sample apps on pages 598 and 599. The first time I tried to build a project I got errors.The error message and footnote on page 597 led to the solution. I had to add gcc and the path (/usr/bin/gcc) to allow Qt to find the compiler. So that’s the only configuration I had to do. Hope this helps.
Hello Derek. Congrats on this amazing book! Your focus on using C and C++ is really helpful and change minds (almost everybody is using Python for Raspberry). I’m running the HellowWorld example (the very first one for the Qt5 in this chapter) and I’m getting the message ” ‘label’ was not declared in this scope” in function ‘int main(int, char**). I believe I must change something at Header and .pro file. Any library missing or additional configuration required? Thanks!