This is a project to create a functional touch screen specifically for the Creality Ender 3 S1 pro for klipper use. It uses websockets to communicate with the Moonraker API, to send and receive commands and information. Additionally, using serial connection to the screen, it can control what the user sees.
Klipper usually runs on a raspberry pi. Therefore, you can install this script on the same raspberry pi that klipper runs on. Then, make it a systemd service to persist on boot. Also, you have to copy the DWIN_SET files to an SD card and into the screen.
Move firmware files to the screen.
- Copy the folder
resources/DWIN_SETinto a FAT32 formatted SD card. The sd card should only contain the folderDWIN_SETon it's root directory. - Remove the housing of the screen to access the board
- Insert the SD card
- Power the screen up and wait for the files to be moved from the SD.
- On the top it will
END. Then you can power off the screen and remove the SD card. The screen now contains the necessary files. - Put the housing back on, reinstall next to the printer
You will need some cable to connect the screen to the raspberry pi. I use the following one. The connector of the screen is a 6pin JST XH.
WARNING: You might need to reorganize the wiring if the colors don't match. It is always a good idea to have matching colors to avoid mistakes when connecting them to the RPI.
To connect, you have two options:
- Connect to the RPI pins directly
- Use a USB to ttl adaptor.
Up to you.
If you want to use the Raspberry PI serial pins to connect to the screen, you have to follow these additional steps:
- Run the configuration tool: sudo raspi-config
- Navigate to Interface Options → Serial Port.
- When asked: "Would you like a login shell to be accessible over serial?" Select No.
- When asked: "Would you like the serial port hardware to be enabled?" Select Yes.
- Finish and Reboot when prompted.
Note: If you want the screen to turn off together with the printer, then use an M-F jumper cable to get power from the printer's screen original ribbon and a GND M-F jumper cable to connect the printers GND to your RPI GND.
cd ~
git clone https://github.com/gpatsiaouras/ender3-s1-pro-screen-sw.git
cd ender3-s1-pro-screen-sw
python -m venv venv
source venv/bin/activate
pip install .
# Try it out
ender3-s1-pro-screen-serverCopy the file to the system folder
cd ~/ender3-s1-pro-screen-sw
sudo cp resources/systemd/ender3-s1-pro-screen-sw.service /etc/systemd/system/Edit the systemd service file now under /etc/systemd/system/ender3-s1-pro-screen-sw.service, and change
[Service]
ExecStart=/usr/local/bin/ender3-s1-pro-screen-sw-server
to
[Service]
ExecStart=<path-to-your-home-folder>/ender3-s1-pro-screen-sw/venv/bin/ender3-s1-pro-screen-server
The code assumes that your moonraker api (printer) is located on 127.0.0.1 and the screen is connected via usb in /dev/ttyUSB.
To change the default behavior, you can use environment variables. Add accordingly in the [Service] group of the service:
For raspberry pi connected using its UART pins and the example printer ip of 192.168.2.2:
Environment=SCREEN_PORT=/dev/serial0
Environment=PRINTER_IP=192.168.2.2
Then enable the service:
sudo systemctl daemon-reload
sudo systemctl enable --now ender3-s1-pro-screen-sw.service
