Raspberry Pi Usage Instructions
Notes:
- Ensure the host machine is powered off before installing the expansion board.
- Avoid using the expansion board in humid or dusty environments.
- When installing the screen, do not plug or unplug while powered on, and pay attention to the screen cable direction to avoid damage.
- When installing the fan, pay attention to the fan's current and voltage specifications to avoid damage.
- Note that UART1 is enabled by default and does not need to be configured.
- Please flash the latest image, such as
mainsailos, rather than just upgrading 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. Run the commanduname -rto check the kernel version.
Raspberry Pi Pre-installed TFTV2 System Download Links
-
Applicable to Raspberry Pi zero2/zero2W/2B/3B/3B+/4B/CM4/5B system images
-
This image comes pre-installed with Klipper, Moonraker, Mainsail, Fluidd, Klipper-Screen, etc.
-
Click the download link below
-
Loading...
Installing G2T
- Reference below
Loading...
- Wiring reference
Loading...
Method for Connecting to a Tool Board Using Onboard RS232
- After flashing the latest system on the Raspberry Pi, you need to edit the config.txt file in the boot partition
- Note that UART1 is enabled by default and does not need configuration inside the system. UART3 requires the following steps.
- Add the following to config.txt:
dtoverlay=uart3
- If using uart1, the ID reference is below
[mcu]
serial: /dev/ttyAMA0
baud: 250000
restart_method:command
- If using uart3, the ID reference is below
[mcu]
serial: /dev/ttyAMA1
baud: 250000
restart_method:command
Using the Onboard 5V Fan
-
If you need the Raspberry Pi's 40-pin header to control devices, 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 host controller temperature
control:watermark # Control method
target_temp: 48 # Host cooling fan start temperature
min_temp: 0 # Minimum temperature, an error will occur below this temperature
max_temp: 90 # Maximum temperature, an error will occur above this temperature
off_below: 0.10
kick_start_time: 0.50
max_speed: 0.8 # Maximum speed, 80% of full power
min_speed: 0.3 # Minimum speed, 30% of full power
Screen Usage Method
- Github address FLY-TFT
1. Introduction
FLY-TFT-V2 is a TFT LCD screen based on the ST7796, supporting both capacitive and resistive touch, with a resolution of 320x480, using an SPI interface.
2. System Installation
- Note: The kernel version of the system 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, not just 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 based on your device
- Click CHOOSE OS
- Select Other specific-purpose OS
- Select 3D printing
- Select Mainsail OS
- Select the latest version. If your device supports 64-bit systems, choose rpi64
- Click CHOOSE STORAGE
- Select your storage device, e.g., SD card
- Click NEXT, wait for the installation to complete
4. 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
5. Usage
- Touch requires enabling I2C support, with the corresponding configuration being
dtparam=i2c_arm=on
- After installing the driver, add the
dtoverlay=fly-tft-v2overlay support in theconfig.txtfile. - Open
/boot/config.txt(for the 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 orientation is 90 degrees landscape. If you need to rotate the screen, use the configuration below
dtoverlay=fly-tft-v2,r90 # Same as 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.
- Normally, the TFT touch direction will automatically rotate to follow the display direction; no modification of touch configuration within the system is needed.
-
After adding to the end of the file, run the command
sudo rebootto restart the system.- Ensure the hardware connection is correct.
- The driver has been installed.
- The
dtoverlay=fly-tft-v2overlay support has been added in the/boot/config.txt(for Bookworm system/boot/firmware/config.txt) file. - Some systems may have a default fb0 device, and FLY-TFT will be assigned to fb1. You need to modify the configuration file to enable the fb1 device.
- Run the command
ls /dev/fb*to check devices. If two devices, fb0 and fb1, appear, run 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
6. Using KlipperScreen
- MainsailOS does not have KlipperScreen installed by default and needs to be installed manually.
- Please refer to KlipperScreen or install using kiauh.
- If KlipperScreen was successfully installed, and step 5 has been completed correctly, the KlipperScreen interface should now be displayed.
7. All Available Configurations
-
speedRequires a parameter: Sets the maximum SPI clock frequency of the TFT in Hz. Default is 96000000 (reduce this value if severe screen corruption occurs). -
Example:
dtoverlay=fly-tft-v2,speed=80000000 -
r0/r90/r180/r270Optional****No parameter required: Sets the display and touch orientation of the TFT. Default is 90 degrees. Optional values are 0, 90, 180, 270 (only one orientation can be added). -
Example:
dtoverlay=fly-tft-v2,r90ordtoverlay=fly-tft-v2,r180 -
disable_touchNo parameter required: Disables the touch function of the TFT. It is enabled by default. -
Example:
dtoverlay=fly-tft-v2,disable_touch -
invx,invyNo parameter required: Sets 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: Sets the touch orientation of the TFT, swapping the X and Y axes, i.e., landscape mode.- Example:
dtoverlay=fly-tft-v2,swapxy
- Example:
- Note: All parameters can be set simultaneously (optional parameters can only have one selected). Separate multiple parameters with commas; all parameters must be on the same line.
- Warning: Normally, only the
r0,r90,r180,r270parameters are used. Other parameters should only be used in special cases, especiallyinvx,invy,swapxy.
- Example:
dtoverlay=fly-tft-v2,speed=80000000,r270
Raspberry Pi Zero 2 and Zero 2W Notes
- This note is an explanation for using the FLY-TFT screen with the G2T.
- For Raspberry Pi Zero 2 and Zero 2W, you need to modify the default display device by executing the code below directly, otherwise, it cannot display.
- Please note that after execution, a reboot is required for it to take effect.
sudo sed -i 's/\/dev\/fb0/\/dev\/fb1/g' /etc/X11/xorg.conf.d/99-fbdev.conf