4D SYSTEMS gen4-4DPI-43T/CT-CLB Intelligent Display Modules for Raspberry Pi User Guide

June 4, 2024
4D SYSTEMS

4D SYSTEMS gen4-4DPI-43T/CT-CLB Intelligent Display Modules for Raspberry Pi User Guide
4D SYSTEMS gen4-4DPI-43T/CT-CLB Intelligent Display Modules for Raspberry
Pi

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

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

  1. Raspberry Pi Board
    One of the most important requirements is the Raspberry Pi which will be used as the CPU for the 4DPi display.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Requirements

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

  1. Download the latest Raspberry Pi
    https://www.raspberrypi.com/software/

  2. Load the Raspberry Pi image into the SD card

  3. 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!

  4. 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.

  5. 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

  6. After the reboot, log into your Raspberry Pi again, you will need to download and install the kernel which supports the gen4-4DPi displays.

  7. To download and install the kernel image from the 4D Systems Server, please refer to the gen4-4DPi Datasheet

  8. 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

  9. Connect the gen4-4DPi display to the Raspberry Pi as shown in the image below and reapply the power
    How To Use

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.

  1. Install xinput_calibrator (if not installed by default) by running this from terminal:
    sudo apt-get install xinput-calibrator

  2. Install the event device input driver:
    sudo apt-get install xserver-xorg-input-evdev

  3. 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

  4. 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

  5. Perform a reboot
    sudo reboot now

  6. 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

  7. 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

  8. 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:

  1. To change the display orientation, simply edit the cmdline.txt file
    sudo nano /boot/cmdline.txt

  2. 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.

  1. Login using your SSH. This appnote uses MobaXterm tool to connect through SSH.
    Getting Started With A Simple Project

  2. Go to Desktop and create a new file “HelloWorld.py”.

  3. Open using Sublime Text or any other editor you have installed in you computer.

  4. 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

  1. Backlight – A form of illumination used in LCD display modules.
  2. Calibrate Touch – A process performed to improve the accuracy of the translated touch location provided by the touch screen controller.
  3. Firmware – A permanent software programmed into a read-only memory.
  4. Image File – A serialized copy of the entire state of a computer system stored in some non-volatile form.
  5. Kernel – Manages the operations of the computer and the hardware.
  6. PyQt – PyQt is one of the most popular Python bindings for the Qt cross-platform C++ framework.
  7. Python – A high-level programming language designed to be easy to read and simple to implement.
  8. Raspbian – The official operating system used by Raspberry Pi.
  9. Reboot – An instance of shutting down and restarting a device.
  10. 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.
  11. 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)

Loading......

Download This Manual (PDF format)

Download this manual  >>

4D SYSTEMS User Manuals

Related Manuals