https://github.com/arksine/moonraker
Assuming you used Mainsail or KIAUH, most of this is already set up.
It's possible 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:
- Start raspi-config:
sudo raspi-config. - Select option 3 - Interface Options.
- Select option P6 - Serial Port.
- At the prompt Would you like a login shell to be accessible over serial? answer 'No'
- At the prompt Would you like the serial port hardware to be enabled? answer 'Yes'
- Exit raspi-config and reboot the Pi for changes to take effect.
For full instructions on how to use Device Tree overlays see this page.
In brief, ensure there is a line in the /boot/config.txt file to apply a Device Tree overlay.
dtoverlay=disable-bt
Open ~/printer_data/systemd/klipper.env and ensure the KLIPPER_ARGS variable includes an something like '-a ~/printer_data/comms/klippy.sock'. If not, add it then restart your pi or 'klipper.service'.
Again assuming you used Mainsail or KIAUH, this should be by defualt.
- Display <-> Raspberry Pi GPIO BCM
- Rx = GPIO14 (Tx)
- Tx = GPIO15 (Rx)
- Ent = GPIO13
- A = GPIO19
- B = GPIO26
- Vcc = 2 (5v)
- Gnd = 6 (GND)
Here's a diagram based on my color selection:
I tried to take some images to help out with this: You don't have to use the color of wiring that I used:
I have added some Ender 3S1 specific images:
Thanks to wolfstlkr
sudo apt-get install python3-pip python3-gpiozero python3-serial git
sudo pip3 install multitimer
git clone https://github.com/nojoyy/KLIPPER_E3S1_LCD.git
Enter the downloaded KLIPPER_E3S1_LCD folder.
To get your API key run:
~/moonraker/scripts/fetch-apikey.shEdit the file run.py and paste your API key and verify that you have the proper API_Endpoint address.
nano run.pyThis is how the run.py looks for Ender 3 S1, please modify 'ender' with your username (i.e. pi, klipper, etc.)
#!/usr/bin/env python3
from dwinlcd import DWIN_LCD
encoder_Pins = (26, 19)
button_Pin = 13
LCD_COM_Port = '/dev/ttyAMA0'
API_Key = 'XXXXXX'
API_Endpoint = '/home/ender/printer_data/comms/klippy.sock'
DWINLCD = DWIN_LCD(
LCD_COM_Port,
encoder_Pins,
button_Pin,
API_Key,
API_Endpoint
)If your control wheel is reversed (Voxelab Aquila) change the encoder_pins to 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'
API_Endpoint = '/home/ender/printer_data/comms/klippy.sock'
DWINLCD = DWIN_LCD(
LCD_COM_Port,
encoder_Pins,
button_Pin,
API_Key,
API_Endpoint
)Assuming your endpoint doesn't match the provided default, it can be found via the 'klipper.env' file referenced in the EnvironmentFile listed in '/etc/systemd/system/klipper.service' or the direct ExecStart via the -a parameter.
Example Service:
[Unit]
Description=Klipper 3D Printer Firmware SV1
Documentation=https://www.klipper3d.org/
After=network-online.target
Wants=udev.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
User=ender
RemainAfterExit=yes
WorkingDirectory=/home/ender/klipper
EnvironmentFile=/home/ender/printer_data/systemd/klipper.env
ExecStart=/home/ender/klippy-env/bin/python $KLIPPER_ARGS
Restart=always
RestartSec=10
Once modified, ensure run.py is executable
sudo chmod +x run.py
Run with python3 ./run.py or './run.py'
Your output should be:
DWIN handshake
DWIN OK.
http://127.0.0.1:80
Waiting for connect to $API_endpoint
Connection.
Boot looks good
Testing Web-services
Web site exists
Press ctrl+c to exit run.py
If the test fails to connect, make be sure to double check the existence of the endpoint files or other files in the klipper.env file.
Note: Delay of 20s after boot to allow webservices to settal.
The run.sh script that is loaded by simpleLCD.service will re-run run.py on firmware restarts of the printe. If it fails to start for 5 times within 30 second it will exit and stop until the net boot.
Note if you cloned the repo anywhere other than /home/ender, you will need to modify the 'simpleLCD.service' and 'run.sh' prior to copying 'simpleLCD.service' to /lib/systemd/service.
Just modify 'simpleLCD.service' to point to the correct path of the script.
You will also need to modify run.sh to point to the directory you installed the files of the repo to.
Afterwards, ensure execute permissions:
sudo chmod +x run.py run.sh simpleLCD.serviceCopy to systemd:
sudo cp simpleLCD.service /lib/systemd/system/simpleLCD.serviceset system permissions:
sudo chmod 644 /lib/systemd/system/simpleLCD.serviceReload daemon and enable and start simpleLCD service
sudo systemctl daemon-reload && sudo systemctl enable --now simpleLCD.serviceIf service did not start, check status via
sudo systemctl status simpleLCD.serviceWorst comes to worst:
sudo rebootYour LCD should start after 30 seconds. And when you restart your printer firmware the LCD should restart as well.
Print Menu:
* List / Print jobs from OctoPrint / Moonraker
* Auto swiching from to Print Menu on job start / end.
* Display Print time, Progress, Temps, and Job name.
* Pause / Resume / Cancle Job
* Tune Menu: Print speed & Temps
Perpare Menu:
* Move / Jog toolhead
* Disable stepper
* Auto Home
* Z offset (PROBE_CALIBRATE)
* Preheat
* cooldown
Info Menu
* Shows printer info.
* Save / Loding Preheat setting, hardcode on start can be changed in menu but will not retane on restart.
* The Control: Motion Menu






