Raspberry Pi user manual
Notes:
- Make sure the host computer is powered off before installing the extension board.
- Avoid using the extension board in a humid or dusty environment.
- When installing the screen, pay attention to not hot-plug the screen cable and the direction of the screen cable to avoid damage.
- When installing the fan, pay attention to the current and voltage specifications of the fan to avoid damage.
- Please note that UART1 is enabled by default and does not need to be configured in the configuration.
- Please flash the latest image such as
mainsailos
, not upgrade the kernel. - The Raspberry Pi can use all interfaces!!!
- Note: The kernel version of the system used by the Raspberry Pi must be greater than
5.17.x
, execute the commanduname -r
to view the kernel version
Pre-installed TFTV2 system download link for Raspberry Pi
-
System image applicable to Raspberry Pi zero2/zero2W/2B/3B/3B+/4B/CM4/5B
-
This image pre-installs klipper, moonraker, mainsail, fulidd, klipper-screen, etc.
-
Baidu Netdisk:System Image
-
GOOGLE Drive:System Image
Install G2T
- Below is the reference
- Reference wiring
Using the on-board RS232 to connect to the tool version method

- After the Raspberry Pi is flashed with the latest system, you need to edit the config.txt file in the boot disk
- Please note that UART1 is already opened by default and does not need to be configured in the system. UART3 needs to perform the following steps
- Add to config.txt
dtoverlay=uart3
- If using uart1 id, below is the reference
[mcu]
serial: /dev/ttyAMA0
baud: 250000
restart_method:command
- If using uart3 id, below is the reference
[mcu]
serial: /dev/ttyAMA1
baud: 250000
restart_method:command
On-board 5VFAN usage
-
If you need to control devices via the Raspberry Pi 40PIN, you need to install according to the Klipper tutorial RPi Microcontroller
[mcu host]
serial: /tmp/klipper_host_mcu
[temperature_sensor Raspberry Pi]
sensor_type: temperature_host
[temperature_fan core_fan]
pin: host:gpio12
max_power: 1.0
sensor_type: temperature_host #Set to the mainboard temperature of the host
control:watermark #Control mode
target_temp: 48 #The temperature at which the host's cooling fan starts
min_temp: 0 #Minimum temperature, an error will be reported if it is lower than this temperature
max_temp: 90 #Maximum temperature, an error will be reported if it is higher than this temperature
off_below: 0.10
kick_start_time: 0.50
max_speed: 0.8 #Maximum speed, 80% of full power operation
min_speed: 0.3 #Minimum speed, 30% of full power operation
Screen usage method
- Github address FLY-TFT
1. Introduction
FLY-TFT-V2 is a TFT LCD screen based on st7796, supports capacitive and resistive touch, resolution 320x480, uses SPI interface
2. System installation
- Note: The kernel version of the system used by the Raspberry Pi must be greater than
5.17.x
, execute the commanduname -r
to view the kernel version - Please flash the latest image such as
mainsailos
, not upgrade the kernel - You need to install it yourself KlipperScreen
- Use Raspberry Imager to install the latest MainsailOS
- Download and install Raspberry Imager
- Open Raspberry Imager
- Click CHOOSE DEVICE
- Choose the corresponding model according to your device
- Click CHOOSE OS
- Select Other specific-purpose OS
- Select 3D printing
- Select Mainsail OS
- Select the latest version. If your setup supports 64-bit systems, select rpi64
- Click CHOOSE STORAGE
- Choose your storage device, such as an SD card
- Click NEXT, wait for the installation to complete
4. Driver installation
-
Install FLY-TFT-V2 driver
git clone https://github.com/kluoyun/FLY-TFT.git
cd FLY-TFT
sudo chmod +x ./scripts/install.sh
./scripts/install.sh
5. Usage
- Touch needs to enable I2C support, the corresponding configuration is
dtparam=i2c_arm=on
- After installing the driver, you need to add the overlay support
dtoverlay=fly-tft-v2
to the config.txt file - Open
/boot/config.txt
(for bookworm system, it is/boot/firmware/config.txt
)sudo nano /boot/config.txt
- Add the following configuration at the end of the file
dtoverlay=fly-tft-v2
- The default screen is displayed in landscape orientation at 90 degrees. If you need to rotate the screen, please use the following configuration
dtoverlay=fly-tft-v2,r90 # Same as default direction, horizontal
dtoverlay=fly-tft-v2,r270 # 270-degree landscape, horizontal (flipped)
dtoverlay=fly-tft-v2,r0 # 0-degree portrait, vertical
dtoverlay=fly-tft-v2,r180 # 180-degree portrait, vertical (flipped)- Only one configuration can be added, not multiple
- Normally, the touch direction of the TFT will automatically rotate with the display direction, no need to modify the touch configuration in the system
-
After adding to the end of the file, execute the command
sudo reboot
to restart the system- Please make sure the hardware connection is correct
- The driver is installed
- The overlay support
dtoverlay=fly-tft-v2
is added to the file/boot/config.txt
(for bookworm system, it is/boot/firmware/config.txt
) - Some systems may have a default fb0 device, FLY-TFT will be assigned to fb1 device, you need to modify the configuration file to enable the fb1 device
- Execute the command
ls /dev/fb*
to check the device, if two devices fb0 and fb1 appear, execute the following command to enable the fb1 device (the default is fb0) - Execute the following command to modify the default configuration to the fb1 device
sudo sed -i 's/\/dev\/fb0/\/dev\/fb1/g' /etc/X11/xorg.conf.d/99-fbdev.conf
6. Using KlipperScreen
- MainsailOS does not come with KlipperScreen installed by default, it needs to be installed manually
- Please refer to KlipperScreen or use kiauh to install
- If KlipperScreen is successfully installed and step 5 is completed correctly, the KlipperScreen interface should now be displayed
7. All available configurations
-
speed
**Requires parameter: set the maximum SPI clock frequency of the TFT, unit Hz, default 96000000 (if there is serious screen flickering, reduce this value appropriately) -
Example:
dtoverlay=fly-tft-v2,speed=80000000
-
r0/r90/r180/r270
Optional No parameters required: Set the display and touch direction of the TFT, default is 90 degrees, optional values are 0,90,180,270 (only one configuration can be added) -
Example:
dtoverlay=fly-tft-v2,r90
ordtoverlay=fly-tft-v2,r180
-
disable_touch
No parameters required: Disable the touch function of the TFT, default is enabled -
Example:
dtoverlay=fly-tft-v2,disable_touch
-
invx
,invy
No parameters required: Set the touch direction of the TFT,invx
is X-axis flip,invy
is Y-axis flip -
Example:
dtoverlay=fly-tft-v2,invx
ordtoverlay=fly-tft-v2,invy
ordtoverlay=fly-tft-v2,invx,invy
-
swapxy
No parameters required: Set the touch direction of the TFT, swap X and Y axes, i.e., landscape- Example:
dtoverlay=fly-tft-v2,swapxy
- Example:
- Note: All parameters can be set at the same time (only one optional parameter can be selected), multiple parameters are separated by commas, and multiple parameters can only be on the same line
- Warning: Normally only the four parameters
r0
,r90
,r180
,r270
are used, other parameters are only used in special cases, especiallyinvx
,invy
,swapxy
- Example:
dtoverlay=fly-tft-v2,speed=80000000,r270
Notes for Raspberry Pi zero2 and zero2W

- This note is for the explanation of using FLY-TFT screen with G2T
- The Raspberry Pi zero2 and zero2w need to modify the default display device, you can execute the following code directly to modify, otherwise it will not be displayed
- Please note that after execution, you need to restart to use
sudo sed -i 's/\/dev\/fb0/\/dev\/fb1/g' /etc/X11/xorg.conf.d/99-fbdev.conf
Screen installation
