4D SYSTEMS gen4-4DPI-43T/CT-CLB Intelligent Display Modules for Raspberry Pi User Guide
- June 4, 2024
- 4D SYSTEMS
Table of Contents
4D SYSTEMS gen4-4DPI-43T/CT-CLB Intelligent Display Modules for Raspberry
Pi User Guide
gen4-4DPI Series
SCREEN SIZE | RESOLUTION | TOUCH TYPE | FOR RASPBERRY PI |
---|---|---|---|
Inches | mm | Non-Touch | |
4.3* | 109.22 | 480 x 272 | . |
5.0* | 127.00 | 800 x 480 | . |
7.0* | 177.80 | . |
Also available in Cover Lens Bezel (CLB) version.
VARIANTS:
Resistive Touch (T)
Capacitive Touch with Cover Lens Bezel (CT-CLB)
This user guide will help you started using the gen4-4DPI-XXT/CT-CLB modules. It also includes a list of essential project examples and application notes.
What’s In The Box
Supporting documents, datasheet, CAD step models and application notes are available at www.4dsystems.com.au
Introduction
This User Guide is an introduction to becoming familiar with the gen4 4DPiXXT /CT-CLB and the software IDE associated with it. This manual should be treated only as a useful starting point and not as a comprehensive reference document.
In this User Guide, we will briefly focus on the following topics:
- Hardware and Software Requirements
- How to use the gen4-4DPi-XXT/CT-CLB
- Getting Started with Simple Projects
- Featured Projects
- Reference Documents
The gen4-4DPi-XXT and gen4-4DPi-XXCT-CLB are part of the gen4 series of display modules designed and manufactured by 4D Systems for Raspberry Pi boards. These modules feature a 4.3”, 5.0” and 7.0” colour LCD display powered through a Raspberry Pi board and come in resistive and capacitive touch variants – gen4-4DPi-XXT and gen4-4DPi XXCT-CLB, respectively.
System Requirements
The following sub-sections discuss the hardware and software requirements for this manual.
Hardware
-
Raspberry Pi Board
One of the most important requirements is the Raspberry Pi which will be used as the CPU for the 4DPi display. -
gen4-4DPi-XXT/CT-CLB
The gen4-4DPi-XXT/CT-CLB and its accessories are included in the box, delivered to you after your purchase from our website or through one of our distributors. Please refer to the section “What’s in the box” for images of the display module and its accessories. -
gen4-4DPi Adaptor
The adaptor is placed on top of the Raspberry Pi. You can refer to the image on the description to see the proper orientation. -
30-way Flat Flex Cable (FFC)
The Flat Flex cable is attached to the adaptor to connect it to the gen4-4DPi- XXT/CT-CLB. -
5V DC Supply
To know the specifications needed for the power supply, please refer to the gen4-4DPi Datasheet.
Requirements
The gen4-4DPi is designed to work with the Raspbian Operating System running on the Raspberry Pi, as that is the official Raspberry Pi operating system.
NOTE
The Raspbian OS image is available at the official Raspberry Pi website.
How To Use The GEN4-4DPI-XXT/CT-CLB
Download and Installation
-
Download the latest Raspberry Pi
https://www.raspberrypi.com/software/ -
Load the Raspberry Pi image into the SD card
-
After loading the image file, insert the SD card into the Raspberry Pi and apply power.
NOTE: Do not connect the gen4-4DPI-XXT/CT-CLB yet! -
Either log into the Raspberry Pi from your keyboard/monitor using the standard ‘pi’ and ‘raspberry’ credentials, else SSH into your Raspberry PI and log in via your SSH session.
-
Update and upgrade your Raspberry Pi to ensure you are running the latest version of the kernel and firmware.
sudo apt-get update
sudo apt-get upgrade
NOTE: An upgrade should only be done after making sure that the latest kernel is supported by the latest kernel pack from 4D. Otherwise, installing the 4D kernel pack will downgrade the kernel.
Reboot the Raspberry Pi
sudo reboot -
After the reboot, log into your Raspberry Pi again, you will need to download and install the kernel which supports the gen4-4DPi displays.
-
To download and install the kernel image from the 4D Systems Server, please refer to the gen4-4DPi Datasheet
-
After successfully installing the image file, shutdown the Raspberry Pi safety
NOTE: and remove the power after it has completed its shutdown.
sudo poweroff
or
sudo shutdown now -
Connect the gen4-4DPi display to the Raspberry Pi as shown in the image below and reapply the power
Calibrating the Resistive Touch
Each gen4-4DPi which is shipped from the 4D Systems factory is slightly different, in the sense that each of the touch screens has a slightly different calibration. In order to get the best from your gen4-4DPi, you will need to calibrate the display so it is as accurate as possible.
To calibrate the touch screen, the xinput_calibrator is required and the following steps should be carried out. Make sure the Desktop is not running before you start, quit desktop if it is and return to the terminal prompt. Please note that only resistive touch display modules could be calibrated.
-
Install xinput_calibrator (if not installed by default) by running this from terminal:
sudo apt-get install xinput-calibrator -
Install the event device input driver:
sudo apt-get install xserver-xorg-input-evdev -
Rename 10-evdev.conf file to 45-evdev.conf
sudo mv /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share /X11/xorg.conf.d/45-evdev.conf -
Check if evdev.conf has a higher number than libinput.conf ls /usr/share/X11/xorg.conf.d/
The user should get something like this
10-quirks.conf 40-libinput.conf 45-evdev.conf 99 fbturbo.conf -
Perform a reboot
sudo reboot now -
Reconnect to SSH and run xinput calibrator.
DISPLAY=:0.0 xinput_calibrator
Perform the calibration and copy results.
The results should be something similar to this
Section “InputClass”
Identifier “calibration”
MatchProduct “AR1020 Touchscreen”
Option “Calibration” “98 4001 175 3840”
Option “SwapAxes” “0”
EndSection -
You may test the changes after xinput calibrator ends. To make the changes permanent, paste the results to calibration.conf file.
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf -
Save the file and perform a reboot
sudo reboot now
Change the Display Orientation
The Screen Orientation of the display can be changed. To implement this, there are two things that need to be changed:
-
To change the display orientation, simply edit the cmdline.txt file
sudo nano /boot/cmdline.txt -
Add the parameter below at the second position in the parameter list: 4dpi.rotate = 90
And change this to have the value of 0, 90, 180 or 170. It should look something like:
dwc_otg.lpm_enable=0 4dpi.rotate=90 console=serial0,115200
Save the file and restart your Raspberry Pi. The touch screen will automatically remap the alignment thanks to the custom kernel.
Backlight Control
The backlight brightness can be controlled from the terminal, or from a bash
script. The following command can be used to set the backlight from 0 to 100%
sudo sh -c ‘echo 31 > /sys/class/backlight/4dhats/brightness’
The above will set the backlight to 100%. Simply change the ‘echo 31’ to be anything from 0 to 31.
Getting Started With A Simple Project
After connecting the display and flash the image, you can now start doing projects. This project simply shows a message box on the gen4-4DPi that says “HELLO WORLD”.
PART 1: Scripting
Step 1: Update the Python version
This project uses Python 3.5.3. To know the version of your python3, you can
use
$ python3 ––version
You can update your python3 version by using the command
$ sudo apt-get update
$ sudo apt-get install python3
Step 2: Install PyQt
PyQt is one of the most popular Python bindings. This project uses the PyQt
binding for displaying the output.
To install PyQt, run the following command:
$ sudo apt-get install python3-pyqt4
Step 3: Connect to SSH
You can operate your BeagleBone device from a remote terminal using many
means. This example shows how to do it using SSH.
-
Login using your SSH. This appnote uses MobaXterm tool to connect through SSH.
-
Go to Desktop and create a new file “HelloWorld.py”.
-
Open using Sublime Text or any other editor you have installed in you computer.
-
Paste the script below and Save:
import sys
from PyQt4 import QtGui
def window():
app = QtGui.QApplication(sys.argv)
widget = QtGui.QWidget()
label = QtGui.QLabel(widget)
label.setText(“Hello World!”)
widget.setWindowTitle(“PyQt”)
widget.show()
sys.exit(app.exec_())
if name == ‘ main ‘:
window()
PART 2: Running the Project
Option 1: Run the Python Script Using the Raspberry Pi Terminal
To run the python script using the gen4-4DPi Display, navigate to where the
python script is saved then run the command:
$ python3 HelloWorld.py
Option 2: Run the Python Script Using SSH
Navigate to the script’s directory (in this case, Desktop).
This is optional but you can test your script in your remote terminal by running,
$ python3 HelloWorld.py
To run the script from a remote terminal and display it on the gen4-4DPi,
$ DISPLAY=:0.0 python3 HelloWorld.py
The gen4-4DPi should now look like this:
Reference Documents
The “HelloWorld” project is one of the most common and basic projects to be made in almost every language and that includes Python. The following is a list of the sites and documents that may help the user to further enhance GUI programming and to know more about the gen4-4DPi:
gen4-4DPi Datasheet
This document contains the essential information related to the gen4 4DPi.
Raspberry Pi Website
A good place to start for information and support regarding the Raspberry Pi
and various distributions available.
Raspberry Pi Latest Images
This website details the latest firmware images for the Raspberry Pi.
NOTE: For support regarding the gen4-4DPi hardware please go to www.4dsystems.com.au and either contact Support directly via a Ticket, or use the 4D Systems Forum.
GLOSSARY
- Backlight – A form of illumination used in LCD display modules.
- Calibrate Touch – A process performed to improve the accuracy of the translated touch location provided by the touch screen controller.
- Firmware – A permanent software programmed into a read-only memory.
- Image File – A serialized copy of the entire state of a computer system stored in some non-volatile form.
- Kernel – Manages the operations of the computer and the hardware.
- PyQt – PyQt is one of the most popular Python bindings for the Qt cross-platform C++ framework.
- Python – A high-level programming language designed to be easy to read and simple to implement.
- Raspbian – The official operating system used by Raspberry Pi.
- Reboot – An instance of shutting down and restarting a device.
- Resistive Touch Display – A touch-sensitive display composed of two flexible sheets coated with a resistive material and separated by an air gap or microdots.
- SSH – Secure Shell or Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.
Visit our website at: www.4dsystems.com.au
Technical Support:
www.4dsystems.com.au/support
Sales Support: sales@4dsystems.com.au
References
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>