Home

Awesome

<img src ="images/photo_2022-03-31_22-41-40.jpg"><img src ="images/photo_2022-03-31_22-42-09.jpg">

DWIN_T5UIC1_LCD

Python class for the Ender 3 V2 LCD runing klipper3d with Moonraker

https://www.klipper3d.org

https://octoprint.org/

https://github.com/arksine/moonraker

Setup:

Disable Linux serial console

By default, the primary UART is assigned to the Linux console. If you wish to use the primary UART for other purposes, you must reconfigure Raspberry Pi OS. This can be done by using raspi-config:

For full instructions on how to use Device Tree overlays see this page.

In brief, add a line to the /boot/config.txt file to apply a Device Tree overlay.

dtoverlay=disable-bt

Enabling Klipper's API socket

Check your /etc/systemd/system/klipper.service file for API enable parameter -a /tmp/klippy_uds:

ExecStart=/home/pi/klippy-env/bin/python /home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /home/pi/klipper_logs/klippy.log -a /tmp/klippy_uds

Library requirements

Thanks to wolfstlkr

sudo apt-get install python3-pip python3-gpiozero python3-serial git

sudo pip3 install multitimer

git clone https://github.com/bustedlogic/DWIN_T5UIC1_LCD.git

Wire the display

Here's a diagram based on my color selection:

<img src ="images/GPIO.png?raw=true" width="325" height="75"> <img src ="images/panel.png?raw=true" width="325" height="180">

I tried to take some images to help out with this: You don't have to use the color of wiring that I used:

<img src ="images/wire1.png?raw=true" width="200" height="400"> <img src ="images/wire2.png?raw=true" width="200" height="400">

<img src ="images/wire3.png?raw=true" width="400" height="200"> <img src ="images/wire4.png?raw=true" width="400" height="300">

Run The Code

Enter the downloaded DWIN_T5UIC1_LCD folder. Make new file run.py and copy/paste in the following (pick one)

For an Ender3v2

#!/usr/bin/env python3
from dwinlcd import DWIN_LCD

encoder_Pins = (26, 19)
button_Pin = 13
LCD_COM_Port = '/dev/ttyAMA0'
API_Key = 'XXXXXX'

DWINLCD = DWIN_LCD(
	LCD_COM_Port,
	encoder_Pins,
	button_Pin,
	API_Key
)

If your control wheel is reversed (Voxelab Aquila) use this instead.

#!/usr/bin/env python3
from dwinlcd import DWIN_LCD

encoder_Pins = (19, 26)
button_Pin = 13
LCD_COM_Port = '/dev/ttyAMA0'
API_Key = 'XXXXXX'

DWINLCD = DWIN_LCD(
	LCD_COM_Port,
	encoder_Pins,
	button_Pin,
	API_Key
)

Run with python3 ./run.py

Run at boot:

Note: Delay of 30s after boot to allow webservices to settal.

path of `run.py` is expected to be `/home/pi/DWIN_T5UIC1_LCD/run.py`

sudo chmod +x run.py

sudo chmod +x simpleLCD.service

sudo mv simpleLCD.service /lib/systemd/system/simpleLCD.service

sudo chmod 644 /lib/systemd/system/simpleLCD.service

sudo systemctl daemon-reload

sudo systemctl enable simpleLCD.service

sudo reboot

Status:

Notworking:

* Save / Loding Preheat setting, hardcode on start can be changed in menu but will not retane on restart.
* The Control: Motion Menu