Skip to main content

Raspberry Pi Usage Instructions

Precautions:

  • Ensure the host computer is powered off before installing the expansion board.
  • Avoid using the expansion board in damp or dusty environments.
  • When installing the screen, ensure the power is off when plugging/unplugging the screen cable and pay attention to the cable orientation to prevent damage.
  • When installing the fan, pay attention to the fan's current and voltage specifications to prevent damage.
  • Note: UART1 is enabled by default and does not require configuration.
  • Please flash the latest image, such as mainsailos, rather than upgrading the kernel.
  • The Raspberry Pi can use all interfaces!!!
  • Note: The system kernel version used by the Raspberry Pi must be greater than 5.17.x. Execute the command uname -r to check the kernel version.
  • System image compatible with Raspberry Pi zero2/zero2W/2B/3B/3B+/4B/CM4/5B.

  • This image is pre-installed with klipper, moonraker, mainsail, fulidd, klipper-screen, etc.

  • Click the download links below.

  • Loading...

Installing G2T

  • Reference below:
    Loading...
  • Wiring reference:
    Loading...

Method for Connecting Tool Board Using Onboard RS232

Loading...
  • After flashing the Raspberry Pi with the latest system, you need to edit the config.txt file on the boot partition.
  • Note: UART1 is enabled by default and does not require system configuration. UART3 requires the following steps.
  • Add the following line to config.txt:
dtoverlay=uart3
  • If using uart1, the ID is as follows (reference below):
[mcu]
serial: /dev/ttyAMA0
baud: 250000
restart_method:command
  • If using uart3, the ID is as follows (reference below):
[mcu]
serial: /dev/ttyAMA1
baud: 250000
restart_method:command

Using the Onboard 5VFAN

  • If you need the Raspberry Pi 40PIN to control devices, installation must follow 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 # Temperature at which the host cooling fan starts
min_temp: 0 # Minimum temperature; errors below this
max_temp: 90 # Maximum temperature; errors above this
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 st7796, supporting both capacitive and resistive touch, with a resolution of 320x480, using SPI interface.

2. System Installation

Tip
  • Note: The system kernel version used by the Raspberry Pi must be greater than 5.17.x. Execute the command uname -r to check the kernel version.
  • Please flash the latest image, such as mainsailos, rather than upgrading 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, such as an SD card.
    • Click NEXT and wait for the installation to complete.

4. Driver Installation

  • Install the 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

Tip
  • Touch requires enabling I2C support. The corresponding configuration is dtparam=i2c_arm=on.
  1. After installing the driver, you need to add the overlay support dtoverlay=fly-tft-v2 in the config.txt file.
  2. Open /boot/config.txt (for bookworm system, it's /boot/firmware/config.txt).
    sudo nano /boot/config.txt
  3. 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 following configurations:
    dtoverlay=fly-tft-v2,r90  # Same as default orientation, landscape
    dtoverlay=fly-tft-v2,r270 # 270-degree landscape, landscape (flipped)
    dtoverlay=fly-tft-v2,r0 # 0-degree portrait, vertical
    dtoverlay=fly-tft-v2,r180 # 180-degree portrait, vertical (flipped)
    • Only add one configuration; do not add multiple.
    • Normally, the touch orientation of the TFT will automatically rotate to follow the display orientation, so there is no need to modify the touch configuration within the system.
  1. After adding it to the end of the file, execute the command sudo reboot to restart the system.

    • Ensure the hardware is connected correctly.
    • The driver is installed.
    • The overlay support dtoverlay=fly-tft-v2 is added in the /boot/config.txt file (for bookworm system, /boot/firmware/config.txt).
    • Some systems may have a default fb0 device, and FLY-TFT may be assigned to fb1. You may need to modify the configuration file to enable the fb1 device.
    • Execute the command ls /dev/fb* to check the devices. If two devices, fb0 and fb1, appear, execute the following command to enable the fb1 device (default is fb0).
    • Execute the following command to change the default configuration to 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; it needs to be installed manually.
  • Please refer to KlipperScreen or use kiauh for installation.
  • 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: Sets the maximum SPI clock frequency for the TFT, in Hz. Default is 96000000 (if severe screen distortion occurs, appropriately reduce this value).

  • Example: dtoverlay=fly-tft-v2,speed=80000000

  • r0/r90/r180/r270 Optional No parameter required: Sets the display and touch orientation of the TFT. Default is 90 degrees. Options are 0, 90, 180, 270 (only one configuration can be added).

  • Example: dtoverlay=fly-tft-v2,r90 or dtoverlay=fly-tft-v2,r180

  • disable_touch No parameter required: Disables the touch function of the TFT. Default is enabled.

  • Example: dtoverlay=fly-tft-v2,disable_touch

  • invx, invy No parameter required: Sets the touch direction of the TFT. invx flips the X direction, invy flips the Y direction.

  • Example: dtoverlay=fly-tft-v2,invx or dtoverlay=fly-tft-v2,invy or dtoverlay=fly-tft-v2,invx,invy

  • swapxy No parameter required: Sets the touch direction of the TFT, swapping the X and Y axes, i.e., landscape orientation.

    • Example: dtoverlay=fly-tft-v2,swapxy
Tip
  • Note: All parameters can be set simultaneously (only one optional parameter can be chosen). Separate multiple parameters with commas. Multiple parameters must be on the same line.
  • Warning: Normally, only the four parameters r0, r90, r180, r270 are used. Other parameters are only used in special circumstances, especially invx, invy, swapxy.
  • Example: dtoverlay=fly-tft-v2,speed=80000000,r270

Notes for Raspberry Pi zero2 and zero2W

Loading...
  • These notes are specifically for using the FLY-TFT screen with G2T.
  • For Raspberry Pi zero2 and zero2w, you need to modify the default display device. You can directly modify it by executing the code below; otherwise, it will not display.
  • Note: After execution, a restart is required for the changes to take effect.
sudo sed -i 's/\/dev\/fb0/\/dev\/fb1/g' /etc/X11/xorg.conf.d/99-fbdev.conf

Screen Installation

Loading...
Loading...