Raspberry Pi Usage Instructions
Notes:
- Ensure the host computer is powered off before installing the expansion board.
- Avoid using the expansion board in humid or dusty environments.
- When installing the screen, be careful not to plug or unplug while powered on, and pay attention to the screen cable orientation to avoid damage.
- When installing the fan, pay attention to the fan's current and voltage specifications to avoid damage.
- Note that UART1 is already enabled by default and does not need further configuration.
- Please flash the latest image such as
mainsailos, not upgrade the kernel. - Raspberry Pi can use all interfaces!!!
- Note: The system kernel version used by Raspberry Pi must be greater than
5.17.x. Run the commanduname -rto check the kernel version.
Installing G2T
- The reference is below
Loading...
- Reference wiring
Loading...
Method for Connecting the Tool Board Using Onboard RS232
- After flashing the latest system on the Raspberry Pi, you need to edit the config.txt file on the boot drive
- Please note that UART1 is already enabled by default and does not require configuration in the system. UART3 requires the steps below.
- Simply add the following to config.txt
dtoverlay=uart3
- If using uart1, refer to the following id
[mcu]
serial: /dev/ttyAMA0
baud: 250000
restart_method:command
- If using uart3, refer to the following id
[mcu]
serial: /dev/ttyAMA1
baud: 250000
restart_method:command
Onboard 5V FAN Usage
-
If you need to control devices via the Raspberry Pi 40PIN, you need to install it according to the Klipper tutorial RPi Microcontroller
Loading...
[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 host MCU temperature
control:watermark #Control method
target_temp: 48 #Host cooling fan startup temperature
min_temp: 0 #Minimum temperature; an error will be reported below this temperature
max_temp: 90 #Maximum temperature; an error will be reported above this temperature
off_below: 0.10
kick_start_time: 0.50
max_speed: 0.8 #Maximum speed, which is 80% of full power operation
min_speed: 0.3 #Minimum speed, which is 30% of full power operation
How to Use the Screen
- Github address FLY-TFT
1. Introduction
FLY-TFT-V2 is a TFT LCD screen based on the st7796, supporting both capacitive touch and resistive touch, with a resolution of 320x480, using an SPI interface
2. System Installation
- Note: The system kernel version used by the Raspberry Pi must be greater than
5.17.x. Run the commanduname -rto check the kernel version - Please flash the latest image such as
mainsailos, do not upgrade the kernel - You need to install KlipperScreen yourself
- Use Raspberry Imager to install the latest MainsailOS
- Download and install Raspberry Imager
- Open Raspberry Imager
- Click CHOOSE DEVICE
- Select 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 device supports a 64-bit system, select rpi64
- Click CHOOSE STORAGE
- Select your storage device, such as an SD card
- Click NEXT and wait for the installation to complete
3. Driver Installation
-
Install the FLY-TFT-V2 driver
git clone https://github.com/kluoyun/FLY-TFT.gitcd FLY-TFTsudo chmod +x ./scripts/install.sh./scripts/install.sh
4. Usage
- Touch requires I2C support to be enabled, the corresponding configuration is
dtparam=i2c_arm=on
- After installing the driver, you need to add the
dtoverlay=fly-tft-v2overlay support in 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 90-degree landscape display. If you need to rotate the screen, please use the following configuration
dtoverlay=fly-tft-v2,r90 # Same as the default orientation, landscapedtoverlay=fly-tft-v2,r270 # 270-degree landscape, landscape (flipped)dtoverlay=fly-tft-v2,r0 # 0-degree portrait, portraitdtoverlay=fly-tft-v2,r180 # 180-degree portrait, portrait (flipped)
- Only one configuration can be added, not multiple
- Under normal circumstances, the TFT touch orientation will automatically rotate to follow the display orientation, no need to modify the touch configuration within the system
-
After adding to the end of the file, run the command
sudo rebootto restart the system- Please ensure the hardware connection is correct
- The driver is installed
- The
dtoverlay=fly-tft-v2overlay support has been added in the/boot/config.txtfile (for bookworm system it is/boot/firmware/config.txt) - Some systems may have a default fb0 device, and FLY-TFT will be assigned to the fb1 device. You need to modify the configuration file to enable the fb1 device
- Run the command
ls /dev/fb*to check the devices. If two devices fb0 and fb1 appear, please execute the following command to enable the fb1 device (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
5. Using KlipperScreen
- MainsailOS does not have KlipperScreen installed by default, you need to install it manually
- Please refer to KlipperScreen or use kiauh to install
- If KlipperScreen is successfully installed and step 4 has been completed correctly, the KlipperScreen interface should already be displayed at this point
6. All Available Configurations
-
speed**Required parameter: Set the maximum SPI clock frequency of the TFT, in Hz, default is 96000000 (if severe screen distortion occurs, please lower this value appropriately) -
Example:
dtoverlay=fly-tft-v2,speed=80000000 -
r0/r90/r180/r270Optional****No parameter required: Set the display and touch orientation 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,r90ordtoverlay=fly-tft-v2,r180 -
disable_touchNo parameter required: Disable the touch function of the TFT, default is enabled -
Example:
dtoverlay=fly-tft-v2,disable_touch -
invx,invyNo parameter required: Set the touch orientation of the TFT,invxflips the X direction,invyflips the Y direction -
Example:
dtoverlay=fly-tft-v2,invxordtoverlay=fly-tft-v2,invyordtoverlay=fly-tft-v2,invx,invy -
swapxyNo parameter required: Set the touch orientation of the TFT, swap the X axis and Y axis, i.e. landscape- Example:
dtoverlay=fly-tft-v2,swapxy
- Example:
- Note: All parameters can be set simultaneously (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,r270are used. Other parameters are only used in special cases, especiallyinvx,invy,swapxy
- Example:
dtoverlay=fly-tft-v2,speed=80000000,r270
Precautions for Raspberry Pi Zero 2 and Zero 2 W
- These precautions are instructions for using the FLY-TFT screen with the G2T
- Raspberry Pi Zero 2 and Zero 2 W require modifying the default display device. You can execute the code below to modify it directly, otherwise it will not display
- Please note that a restart is required after execution before it can be used
sudo sed -i 's/\/dev\/fb0/\/dev\/fb1/g' /etc/X11/xorg.conf.d/99-fbdev.conf
Screen Installation
When connecting the FLY-G2T to the FLY-TFT-V2, use the FPC Flexible Cable-16P-Reverse-0.5mm-400mm, and make sure the cable's gold finger orientation is correct before fastening the connector latch.