Compare commits

..
1 Commits
Author SHA1 Message Date
alfrix 8af5c0b2d4 Trace memory 2023-03-24 08:12:19 -06:00
445 changed files with 13557 additions and 43558 deletions

No files matched your search

+12 -1
View File
@@ -1 +1,12 @@
ko_fi: alfrix
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: klipperscreen
open_collective: # Replace with a single Open Collective username
ko_fi: klipperscreen
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+26
View File
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Logfile**
Attach your [klipperscreen.log](https://klipperscreen.readthedocs.io/en/latest/Troubleshooting/)
-70
View File
@@ -1,70 +0,0 @@
name: Bug report
description: Create a report to help us improve
title: "[BUG] <title>"
labels: 'bug'
body:
- type: markdown
attributes:
value: |
Please search to see if an issue already exists for the bug you encountered.
This is a bug report, If you need general support, please visit us on [Discord](https://discord.klipper3d.org/)
# Guidelines:
1. Logfile must be provided from ks startup up to the bug
2. The version used must be from this repo (not a fork)
3. The version used shouldn't be too old (older than the last tagged version)
This bug report will be closed if the guidelines are not respected.
#### This is an Open Source project developed voluntarily, there are no Warranties, or ETA.
[License](https://github.com/KlipperScreen/KlipperScreen/blob/master/LICENSE)
### Thank you for choosing KlipperScreen
- type: textarea
id: what-happened
attributes:
label: 'What happened?'
description: A clear and concise description of what the bug is.
placeholder: During a print i pressed pause and nothing happend
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: 'What did you expect to happen instead?'
description: A clear and concise description of what you expected to happen instead.
placeholder: The printer to pause.
validations:
required: true
- type: textarea
id: repro-steps
attributes:
label: 'How to reproduce this bug?'
description: A clear and concise description with precise steps to reproduce this bug.
placeholder: Press pause button and during printing.
validations:
required: true
- type: textarea
id: additional-info
attributes:
label: 'Additional information:'
description: Any additional info, screenshots or recordings which help to describe the issue.
placeholder: hardware info or related printer config.
- type: textarea
id: logs
attributes:
label: Log output
description: |
Please attach the FULL klipperscreen.log and if needed xorg.log or the tail of journalctl.
if you need help to find the log file:
Read the [Documentation](https://klipperscreen.readthedocs.io/en/latest/Troubleshooting/)
placeholder: |
#### The LOG file is REQUIRED. Without the logfile your issue will be closed
Use a Zip archive if needed
validations:
required: true
-8
View File
@@ -1,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Klipper Discord Server
url: https://discord.klipper3d.org/
about: If you have questions or need general support.
- name: KlipperScreen Discussions
url: https://github.com/KlipperScreen/KlipperScreen/discussions
about: If you have questions or need general support.
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FR]"
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
@@ -1,45 +0,0 @@
name: Feature request
description: Suggest an idea for this project
title: "[FR] <title>"
labels: 'enhancement'
body:
- type: markdown
attributes:
value: >-
## Thank you for choosing KlipperScreen
This form is for feature requests of KlipperScreen
Requesting a feature does not mean it will be worked on, it's taken as a suggestion.
#### This is an Open Source project developed voluntarily, there are no Warranties, or ETA.
[License](https://github.com/KlipperScreen/KlipperScreen/blob/master/LICENSE)
- type: textarea
id: solution
attributes:
label: 'Requested feature'
description: A clear and concise description of what you want.
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: 'Is your feature request related to a problem?'
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: false
- type: textarea
id: alternative
attributes:
label: 'Describe alternatives you have considered'
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
id: info
attributes:
label: 'Additional information'
description: Add any other context drawings or screenshots about the feature.
validations:
required: false
+1 -1
View File
@@ -8,4 +8,4 @@ updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
interval: "daily"
-85
View File
@@ -1,85 +0,0 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
paths-ignore:
- 'docs/**'
- 'ks_includes/locales/**'
pull_request:
paths-ignore:
- 'docs/**'
- 'ks_includes/locales/**'
schedule:
- cron: '32 21 * * 5'
jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
-29
View File
@@ -1,29 +0,0 @@
name: docs
on:
push:
branches: [master, main]
paths:
- 'docs/**'
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v6
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v5
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
-24
View File
@@ -1,24 +0,0 @@
name: "Add missing log comment"
on:
issues:
types: [labeled]
jobs:
comment:
if: contains(github.event.issue.labels.*.name, 'missing-log')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v8
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Hello, I'm an automated bot. \n\n
Please attach a log file to this issue as it is required to properly diagnose the problem. \n\n
Logs help verify versions, inspect for errors, prevent duplicate reports, etc. \n\n
If you don't know how to grab the log file please refer to the documentation: \n\n
https://klipperscreen.readthedocs.io/en/latest/Troubleshooting/ \n\n
Thank you!`
})
+2 -10
View File
@@ -1,18 +1,10 @@
name: test-code
on:
push:
paths-ignore:
- 'docs/**'
- 'ks_includes/locales/**'
pull_request:
paths-ignore:
- 'docs/**'
- 'ks_includes/locales/**'
on: [push, pull_request]
jobs:
lint-python-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v1
- uses: ricardochaves/python-lint@v1.4.0
with:
python-root-list: "screen.py ks_includes panels"
-3
View File
@@ -1,6 +1,4 @@
.idea/
.vscode/
.DS_Store
KlipperScreen.conf
__pycache__/
*.py[cod]
@@ -8,4 +6,3 @@ __pycache__/
dist/
build/
venv/
.venv/
-28
View File
@@ -1,28 +0,0 @@
# Read the Docs configuration file for MkDocs projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-lts-latest
tools:
python: latest
jobs:
post_checkout:
# Cancel building pull requests when there aren't changed in the docs directory or YAML file.
# You can add any other files or directories that you'd like here as well,
# like your docs requirements file, or other files that will change your docs build.
#
# If there are no changes (git diff exits with 0) we force the command to return with 183.
# This is a special exit code on Read the Docs that will cancel the build immediately.
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml;
then
exit 183;
fi
mkdocs:
configuration: mkdocs.yml
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
-323
View File
@@ -1,323 +0,0 @@
# Changelog
This just tracks the most notable changes, if you want all the details checkout the commit history.
Probably all versions contain changes regarding documentation, translation, fixes and other minor refactors
## Current master
* add a wifi interface selector in the network panel
* option to use keyboard navigation
* allow starting in locked state
* option to auto-lock the screen
* if printer power_devices in ks config add shortcut to shutdown panel
* change default value on macro shortcut to false
* rotate the move buttons according to screw_rotation
* add caching of some resources for perfomance
## v0.4.6 (Jul 2, 2025)
* basic lockscreen for shows or kids
* add fine-tune panel on the main/more menu
* add comment field if available in Spoolman
* save dialog asks to save z probe/endstop if it was modified
* power_devices defined in the config will turn off when using the shutdown button
## v0.4.5 (Oct 28, 2024)
* allow calling KlipperScreen panels from gcode
* bed_mesh: automatically call for z_tilt or quad_level if not applied
* show battery status in the topbar
* macros: keyboard to keypad input switch with auto pre-selection
## v0.4.4 (Sep 16, 2024)
* support for different moonraker routes
* allow showing/hiding cursor from the settings
* some wpa-eap support, adds the security type selector and user field
* extrude: wait for temp or open temp panel automatically close #1416
* extrude: show more filament sensors (up to 9)
* notifications: change icon if warnings were issued
* notifications: add clear close #1178
* notifications: klipper config warnings
## v0.4.3 (Jun 29, 2024)
* prompts: add regular buttons and groups
* refactor: always ignore and hide console temp responses
* gcodes: vertical: remove left icons if low resolution
* keypad: support floating point temp
* gcodes: add extra info to confirm print
* zcalibrate: add a dropdown with the function name to select
* job_status: auto-estimated time: use last print time if available
* gcodes: add option to delete in the confirmation
## v0.4.2 (Jun 10, 2024)
* job_status: remove the status message and use the titlebar for that
* shutdown: add restart ks
* extrude: move firmware retraction into the panel, add pressure advance control closes #724
* screen: theme doesn't need a restart anymore
* splash: show the message when klipper is shutdown
* rename print panel to gcodes
* job_status: add extra info to print list and dialog
* network: new NetworkManager backend using sdbus (#1269)
* drop python 3.7 support (#1271)
## v0.4.1 (May 24, 2024)
* vertical layout: increase font size
* main_menu and temp: change layout to accomodate a bigger graph and list in vertical mode
* pins: add pwm_tool
* menu: add pins panel access while printing
* move and zcalibrate: changes in z invert
* system: add cpu and memory usage tracking
* add system info panel
* updater: add distro name
* menu: rename system to update
* allow 2 different screen timeouts, one while printing the other if not
* settings: Add tooltips
* printer_select: support custom icons #1240
* bed_mesh: show round bed without padded values
* macros: send gcode style (G/M) macros without =
* bed_mesh: bedmap draw axis
* zcalibrate: add support for axis twist compensation
* zcalibrate: add confirmation for abort close #1326
## v0.4.0 (Apr 14, 2024)
* move: support rescaling the slider if machine limits are changed
* bed_mesh: add support for rotation and inversion to the meshMap
* bed_level: add a warning for the screws not being used
* heatergraph: add the ability to go fullscreen when clicked close #740
* Add an alternative to X close #1289 (#1306) (Wayland)
* limits: change to minimum cruise ratio
* heatergraph: add power representation (if set to show power in settings)
* base_panel: titlebar: turn red if high cpu or memory is in use, show usage
* create the shutdown panel, add it to the action bar, remove items from system panel
* job_status: show current offset when saving to endstop close #1286
## v0.3.9 (Feb 29, 2024)
* print panel refactor and new features (#1270)
Adds a grid/thumbnail mode (switchable to the list mode)
last mode used is saved
faster load and less memory usage
add sort by size
* extrude: add an extruder selector for machines with more than 5 extruders (#1249)
* pins: make the non pwm pins on-off pwm pins as a scale
* popups: rate limit to every second close #1225
* feat: macro prompts close #1216 (#1219)
## v0.3.8 (Dec 23, 2023)
* add move_distances config option (#1211)
* printer_select: do not sort, this allows the users to sort how they want by defining them in the config in the order they want
## v0.3.7 (Nov 24, 2023)
* wifi: add icons
* initial notifications panel
* add moonraker warnings
## v0.3.6 (Sep 24, 2023)
* LED light control, close #991 (#1106)
* pause will auto-open extrude
* macros: hide the panel if there are no elegible macros
* job_status: click thumbnail for fullscreen thumbnail
## v0.3.5 (Aug 21, 2023)
* camera: relative url support close #1086 (#1088)
* Spoolman support close #1060
* Use callbacks to disable and enable buttons to improve user feedback
* main_menu: allow closing the keypad with the back button
* camera: add support for moonraker cameras, deprecates camera_url
## v0.3.4 (Jul 30, 2023)
* fine_tune: split speed and flow selectors close #935
* job_status: show save to endstop to apply offset for deltas close #916
* job_status: change progress percentage to time-based instead of file-based
## v0.3.3 (Jul 2, 2023)
* Menu reorganization (#1029)
* temp: add pid calibrate to the keypad (#1026)
* bed_level: add center screw close #863
## v0.3.2 (Feb 20, 2023)
* add ability to style and template menu buttons (#866)
* Update on-screen keyboard (#874)
## v0.3.1 (Dec 11, 2022)
* feat: camera support, using mpv as backend
* resizability
* print: add move/rename, make delete a visible button close #636
## v0.3.0 (Dec 5, 2022)
* feat: turn on_off power devices with the screensaver close #518
* macros add parameters
* print: allow directory deletion
* job_status: add eta
* Added support for network manager
* settings: add extra large font close #798
## v0.2.9 (Nov 18, 2022)
* job_status: use the new print_stats layer info
* functions: logging: use printer_data
* keyboard: add spanish and german, change backscpace, clear and accept to icons
## v0.2.8 (Oct 27, 2022)
* config: add printer_data to default config search locations
* extrude: make the speed and distance configurable close #673
* limits and retraction: infinite sliders
* print: hide files and directories starting with .
## v0.2.7 (Oct 4, 2022)
* exclude: graph (#743)
* Add current heater power % to job status (#708)
## v0.2.6 (Sep 2, 2022)
* Change URL protocol to HTTPS and WSS when connecting to port 443
* main temp: add the ability to hide the graph
* system: add shutdown and restart host
* exclude: add exclude objects support
## v0.2.5 (Aug 1, 2022)
* system: Add check for updates close #681
* bed_level: support 3 screws close #606
* job_status: now works without extruders or fans
* print: add delete file
* screen: Always ask to save config if we detect it on responses
* output_pin panel close #546
* built-in keyboard
## v0.2.4 (Jul 3, 2022)
* Enable users to inject a custom script to start KlipperScreen (#660)
* basic support for extruder_stepper
* fan: add max and stop buttons
## v0.2.3 (May 31, 2022)
* job_status: ask for confirmation, and show saved offset
* extrude: add filament sensor support
* limits: add reset, allow to set above the configured maximum but turn the slider red
* job_status: animate filename if it's too long
* macros: allow reverse sorting
* Add Input Shaper panel
* zcalibrate: show the saved offset and offset to be saved
* Allow setting 0 in preheat options (#612)
## v0.2.2 (May 1, 2022)
* Improve Job status (#592)
Adds heater_generic and/or temp_sensors besides extruder/bed (because of the limited space maybe only 1)
Temps are now buttons and act as a shortcut to the temp panel
Adds fan_generic to the fan label and it's now a shortcut to the fan panel
The colors and size of the progress circle were changed to be more subtle.
Margins between items were augmented, because they are buttons now
Adds 3 information pages: move, extrusion and time:
* move can be opened with speed or z buttons
* time with elapsed/remaining buttons
* extrusion with the extrude_factor / flowrate button
* limits: add units
* Add firmware retraction panel close #101
* Add possibility to define custom code for cooling (#579)
* job_status: add save z button to save babystepping
* console: hide temps, clear button, button icons
## v0.2.1 (Apr 1, 2022)
* Vertical mode (#480)
* Use extruder icon without number if there is only 1
* Screensaver if dpms is off
* fine_tune: add reset button, do not set babystepping prior to homing, reorganize a bit
* menu and printer_select: support more than 8 items
* zcalibrate: add selector for the different modes zcalibrate supports
* system: feature: add Full Update
* Added option to select default printer at startup. (#542)
* Show fan speed according to max_power and off_below (#543)
* console: add switch to turn off autoscroll (#540)
* base_panel: allow titlebar items to be configured
* splash_screen: allow power_devices to be configured
* Bed_level: Support 6 and 8 Screws and rotation (#484)
* Show position including offsets in the move panel (#516)
* Start in configurations without fans or extruders or temp devices
* Extrude panel: Support 5 extruders (#441)
* Support hiding by name using underscore (#437)
* Support Manual Mesh calibration (#388)
* Support the "enter" key from a physical keyboard (#379)
* Support multiple power devices. (#350)
* add speed as parameter to UN/LOAD_FILAMENT macro (#359)
## v0.2.0 (Dec 7, 2021)
The Project changed maintainer [alfrix](github.com/alfrix)
(Thats the reason for the version jump)
* Temp graph (#357)
* Create keypad widget and include set temp on the main menu
* Switch from vext.gi to PyGObject (#348)
* Add the full message of the commits in the updater (#343)
* Wakeup touch block (#340)
* screen: RESPOND echo will now show a message on the screen.
* Zcal panel: Support for Z_ENDSTOP_CALIBRATE (#327)
* Move panel: Add Z-tilt/Quad-gantry-level/HomeXY button (#326)
* Add temperature_fan to heaters (#325)
* Configurable xy position for z-calibrate (#310)
* Material themes (#297)
* Support custom themes (#288)
* Allow gcode commands with preheat options (#274)
* Add printer limits panel
* Add unload/load and reorganize extrude panel (#250)
* Font Size Selector (#245)
* Wake the screen at print start and end (#229)
* system: Add restart option to services that moonraker supports
* base_panel: Add extruder/heater bed temperatures to the title bar
## v0.1.6 (May 13, 2021)
* Wifi manager: Updates to include ability to change wifi networks
## v0.1.5 (May 10, 2021)
* New Style - Solarized (#144)
* M117 messages display (#150)
* print: Include refresh button for files
* bed_mesh: Include ability to view mesh Added ability to visualize bed meshes. The active bed mesh will have more points available to view than inactive bed meshes.
* Multiple printers (#85)
* screen: Enable DPMS so screens can power down.
* screen: Allow cursor to be displayed #51
* temperature: add heater_generic
* screen: Only process current panel's subscription
## v0.1.4 (Feb 15, 2021)
* network: Show wifi information
* screen_panel: Put icons on a sidebar instead of on the header
* printer: Include quad_gantry_level
* wifi: Initial wifi class
* job_status/settings: Allow different file estimation methods
* print: Allow sorting by date and name.
## v0.1.3 (Jan 7, 2021)
* gcode_macros: Update to hide macros based on settings
* settings: Create settings panel for KlipperScreen settings
* job_status: updates to show active extruder
* KlippyWebsocket: changes to allow for moonraker api key
* gcode_macros: add a panel for gcode macros
* screen: allow custom moonraker url/port
* config: Allow specifying configfile location from command line
* UI scaling (#28)
* move: Allow inverting of the axis
* bed_level: include screws_tilt_calculate command
* fine_tune: Remove fan from fine tune panel. Add fan to print menu
* configuration: hide extrude while printing
* bed_mesh: Add panel for bed_mesh
* screen: add popup message capability
## v0.1.2 (Dec 2, 2020)
* Change panel layout. Add title and move back button
* system: add klipper version
## v0.1.1 (Nov 28, 2020)
* Add power panel
* menu: add ability to hide certain menus
* Dynamically load panels
* Add HOME XY button
* Highlight all heaters by default on preheat panel
## v0.1.0 (Nov 14, 2020)
* first release
## v0.0.0 (Jul 6, 2020)
* first commit
+2 -3
View File
@@ -629,9 +629,8 @@ to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
KlipperScreen: A Klipper touch interface for touchscreens
Copyright (C) 2020-2021 Jordan Ruthe
Copyright (C) 2021-2024 Alfredo Monclus
OctoScreen: A OctoPrint touch interface for TFT touch modules
Copyright (C) 2018 Máximo Cuadros Ortiz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
+6 -43
View File
@@ -1,52 +1,15 @@
# KlipperScreen
KlipperScreen is a touchscreen GUI that interfaces with [Klipper](https://github.com/Klipper3d/klipper) via [Moonraker](https://github.com/arksine/moonraker). It allows you to switch between multiple printers and access them from a single location. Notably, it doesn't need to run on the same host as your printer; you can install it on another device and configure the IP address to connect to the printer.
KlipperScreen is a touchscreen GUI that interfaces with [Klipper](https://github.com/kevinOConnor/klipper) via [Moonraker](https://github.com/arksine/moonraker). It can switch between multiple printers to access them from a single location, and it doesn't even need to run on the same host, you can install it on another device and configure the IP address to access the printer.
### Documentation
### Documentation [![Documentation Status](https://readthedocs.org/projects/klipperscreen/badge/?version=latest)](https://klipperscreen.readthedocs.io/en/latest/?badge=latest)
For detailed information, [click here to access the documentation](https://klipperscreen.github.io/KlipperScreen/).
[Click here to access the documentation.](https://klipperscreen.readthedocs.io/en/latest/)
### Inspiration
KlipperScreen draws inspiration from [OctoScreen](https://github.com/Z-Bolt/OctoScreen/) and was developed to provide a native touchscreen GUI compatible with [Klipper](https://github.com/Klipper3d/klipper) and [Moonraker](https://github.com/arksine/moonraker).
KlipperScreen was inspired by [OctoScreen](https://github.com/Z-Bolt/OctoScreen/) and the need for a touchscreen GUI that
will natively work with [Klipper](https://github.com/kevinOConnor/klipper) and [Moonraker](https://github.com/arksine/moonraker).
[![Main Menu](docs/img/panels/main_panel.png)](https://klipperscreen.readthedocs.io/en/latest/Panels/)
Explore more screenshots [here](https://klipperscreen.readthedocs.io/en/latest/Panels/).
### Translations
Translations for KlipperScreen are hosted on Weblate. Thanks to the Weblate team for supporting the open-source community.
<a href="https://hosted.weblate.org/engage/klipperscreen/">
<img src="https://hosted.weblate.org/widget/klipperscreen/svg-badge.svg" alt="Translation status" />
</a>
Click the widget below to access the translation platform:
<a href="https://hosted.weblate.org/engage/klipperscreen/">
<img src="https://hosted.weblate.org/widget/klipperscreen/horizontal-auto.svg" alt="Weblate widget" width="50%" />
</a>
### About the Project
KlipperScreen was created by Jordan Ruthe in 2020.
| Donate to Jordan |
|------------------|
| [Patreon](https://www.patreon.com/klipperscreen) |
| [Ko-fi](https://ko-fi.com/klipperscreen) |
Since 2021, the project has been maintained by Alfredo Monclus (alfrix).
| Donate to Alfrix |
|------------------|
| [Ko-fi](https://ko-fi.com/alfrix) |
We extend our gratitude to all contributors who have helped along the way. [Meet the contributors](https://github.com/KlipperScreen/KlipperScreen/graphs/contributors).
### Sponsors
![LDO](docs/img/sponsors/LDO.png) ![YUMI](docs/img/sponsors/YUMI.png)
Special thanks to [LDO](https://ldomotors.com/) and [YUMI](https://wiki.yumi-lab.com/) for sponsoring KlipperScreen and the open-source community.
[More Screenshots](https://klipperscreen.readthedocs.io/en/latest/Panels/)
-5
View File
@@ -1,5 +0,0 @@
from typing import Callable
def _(message: str) -> str: ...
def ngettext(singular: str, plural: str, n: int) -> str: ...
+1
View File
@@ -0,0 +1 @@
screen.py
-27
View File
@@ -1,27 +0,0 @@
#
# DO NOT EDIT THIS FILE USE KlipperScreen.conf
#
[main]
[preheat PLA]
bed = 40
extruder = 195
[preheat ABS]
bed = 90
extruder = 220
[preheat PETG]
bed = 80
extruder = 240
[preheat FLEX]
bed = 0
extruder = 210
[include main_menu.conf]
[include splash_menu.conf]
[include print_menu.conf]
[include move_menu.conf]
-150
View File
@@ -1,150 +0,0 @@
#
# DO NOT EDIT THIS FILE USE KlipperScreen.conf
#
[menu __main]
name: {{ gettext('Main Menu') }}
[menu __main move]
name: {{ gettext('Move') }}
icon: move
panel: move
[menu __main temperature]
name: {{ gettext('Temperature') }}
icon: heat-up
panel: temperature
enable: {{ (printer.temperature_devices.count > 0) or (printer.extruders.count > 0)}}
[menu __main extrude]
name: {{ gettext('Extrude') }}
icon: extrude
panel: extrude
enable: {{ printer.extruders.count > 0 }}
[menu __main more]
name: {{ gettext('More') }}
icon: settings
[menu __main print]
name: {{ gettext('Print') }}
icon: printer
panel: gcodes
enable: {{ printer.extruders.count > 0 }}
[menu __main gcodes]
name: {{ gettext('Gcodes') }}
icon: files
panel: gcodes
enable: {{ printer.extruders.count == 0 }}
[menu __main more bedlevel]
name: {{ gettext('Bed Level') }}
icon: bed-level
panel: bed_level
enable: {{ 'bed_screws' in printer.config_sections or 'screws_tilt_adjust' in printer.config_sections }}
[menu __main more bedmesh]
name: {{ gettext('Bed Mesh') }}
icon: bed-mesh
panel: bed_mesh
enable: {{ 'bed_mesh' in printer.config_sections }}
[menu __main more zoffset]
name: {{ gettext('Z Calibrate') }}
icon: z-farther
panel: zcalibrate
[menu __main more limits]
name: {{ gettext('Limits') }}
icon: fine-tune
panel: limits
[menu __main more fan]
name: {{ gettext('Fan') }}
icon: fan
panel: fan
enable: {{ printer.fans.count > 0 }}
[menu __main more led]
name: {{ gettext('Leds') }}
icon: light
panel: led
enable: {{ printer.leds.count > 0 }}
[menu __main more macros]
name: {{ gettext('Macros') }}
icon: custom-script
panel: gcode_macros
enable: {{ printer.gcode_macros.count > 0 }}
[menu __main more pins]
name: {{ gettext('Pins') }}
icon: hashtag
panel: pins
enable: {{ printer.output_pins.count > 0 or printer.pwm_tools.count > 0 }}
[menu __main more power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ moonraker.power_devices.count > 0 }}
[menu __main more camera]
name: {{ gettext('Camera') }}
icon: camera
panel: camera
enable: {{ moonraker.cameras.count > 0 }}
[menu __main more console]
name: {{ gettext('Console') }}
icon: console
panel: console
[menu __main more updater]
name: {{ gettext('Update') }}
icon: refresh
panel: updater
[menu __main more input_shaper]
name: {{ gettext('Input Shaper') }}
icon: move
panel: input_shaper
enable: {{ 'input_shaper' in printer.config_sections }}
[menu __main more save]
name: {{ gettext('Save Config') }}
icon: complete
method: ks_confirm_save
[menu __main more settings]
name: KlipperScreen
icon: settings
panel: settings
[menu __main more network]
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __main more notifications]
name: {{ gettext('Notifications') }}
icon: notifications
panel: notifications
[menu __main more spoolman]
name: Spoolman
icon: spoolman
panel: spoolman
enable: {{ moonraker.spoolman }}
[menu __main more system]
name: {{ gettext('System') }}
icon: info
panel: system
enable: {{ moonraker_connected }}
[menu __main more fine_tune]
name: {{ gettext('Fine Tuning') }}
icon: fine-tune
panel: fine_tune
-47
View File
@@ -1,47 +0,0 @@
#
# DO NOT EDIT THIS FILE USE KlipperScreen.conf
#
[menu move homing homex]
name: {{ gettext('Home X') }}
icon: home-x
method: printer.gcode.script
params: {"script":"G28 X"}
[menu move homing homey]
name: {{ gettext('Home Y') }}
icon: home-y
method: printer.gcode.script
params: {"script":"G28 Y"}
[menu move homing homez]
name: {{ gettext('Home Z') }}
icon: home-z
method: printer.gcode.script
params: {"script":"G28 Z"}
[menu move homing homeall]
name: {{ gettext('Home All') }}
icon: home
method: printer.gcode.script
params: {"script":"G28"}
[menu move homing homexy]
name: {{ gettext('Home XY') }}
icon: home
method: printer.gcode.script
params: {"script":"G28 X Y"}
[menu move homing quad_gantry_level]
name: {{ gettext('Quad Gantry Level') }}
icon: home-z
method: printer.gcode.script
params: {"script":"QUAD_GANTRY_LEVEL"}
enable: {{ 'QUAD_GANTRY_LEVEL' in printer.available_commands }}
[menu move homing Z-Tilt]
name: {{ gettext('Z Tilt') }}
icon: z-tilt
method: printer.gcode.script
params: {"script":"Z_TILT_ADJUST"}
enable: {{ 'Z_TILT_ADJUST' in printer.available_commands }}
-102
View File
@@ -1,102 +0,0 @@
#
# DO NOT EDIT THIS FILE USE KlipperScreen.conf
#
[menu __print]
name: {{ gettext('Print Control') }}
[menu __print temperature]
name: {{ gettext('Temperature') }}
icon: heat-up
panel: temperature
enable: {{ (printer.temperature_devices.count > 0) or (printer.extruders.count > 0)}}
[menu __print fan]
name: {{ gettext('Fan') }}
icon: fan
panel: fan
enable: {{ printer.fans.count > 0 }}
[menu __print move]
name: {{ gettext('Move') }}
icon: move
panel: move
enable: {{ printer.pause_resume.is_paused }}
[menu __print extrude]
name: {{ gettext('Extrude') }}
icon: extrude
panel: extrude
enable: {{ printer.extruders.count > 0 }}
[menu __print power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ moonraker.power_devices.count > 0 }}
[menu __print led]
name: {{ gettext('Leds') }}
icon: light
panel: led
enable: {{ printer.leds.count > 0 }}
[menu __print macros]
name: {{ gettext('Macros') }}
icon: custom-script
panel: gcode_macros
enable: {{ printer.gcode_macros.count > 0 }}
[menu __print notifications]
name: {{ gettext('Notifications') }}
icon: notifications
panel: notifications
[menu __print camera]
name: {{ gettext('Camera') }}
icon: camera
panel: camera
enable: {{ moonraker.cameras.count > 0 }}
[menu __print console]
name: {{ gettext('Console') }}
icon: console
panel: console
[menu __print limits]
name: {{ gettext('Limits') }}
icon: fine-tune
panel: limits
[menu __print network]
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __print settings]
name: KlipperScreen
icon: settings
panel: settings
[menu __print spoolman]
name: Spoolman
icon: spoolman
panel: spoolman
enable: {{ moonraker.spoolman }}
[menu __print system]
name: {{ gettext('System') }}
icon: info
panel: system
enable: {{ moonraker_connected }}
[menu __print pins]
name: {{ gettext('Pins') }}
icon: hashtag
panel: pins
enable: {{ printer.output_pins.count > 0 or printer.pwm_tools.count > 0 }}
[menu __print lock]
name: {{ gettext('Lock') }}
icon: lock
panel: lock_screen
-34
View File
@@ -1,34 +0,0 @@
#
# DO NOT EDIT THIS FILE USE KlipperScreen.conf
#
[menu __splashscreen]
name: {{ gettext('Menu') }}
[menu __splashscreen power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ moonraker.power_devices.count > 0 }}
[menu __splashscreen network]
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __splashscreen updater]
name: {{ gettext('Update') }}
icon: refresh
panel: updater
enable: {{ moonraker_connected }}
[menu __splashscreen settings]
name: KlipperScreen
icon: settings
panel: settings
[menu __splashscreen system]
name: {{ gettext('System') }}
icon: info
panel: system
enable: {{ moonraker_connected }}
+45 -92
View File
@@ -1,104 +1,63 @@
# XServer-XSDL (Android Only)
# Android
This article describe how to use KlipperScreen from an Android device using XServer-XSDL
This article describes how to use KlipperScreen from an android device
!!! warning
The experience may not be equal to run KlipperScreen natively.
Depending on the device or the network you may encounter performance degradation or other issues.
!!! important
The experience may not be equal to run KlipperScreen natively,
depending on the device there maybe performance degradation or other issues
!!! bug
This method may cause [memory-leaks](https://github.com/KlipperScreen/KlipperScreen/issues/862)
if you don't disable DPMS when installed on X11
It's recommended that you use [VNC](VNC.md) instead
But if you want to use this at least install [earlyoom](https://packages.debian.org/en/stable/earlyoom)
```bash
sudo apt install earlyoom
sudo systemctl enable --now earlyoom
```
1. [First install KlipperScreen](Installation.md)
2. Download the apk of XServer-XSDL or ViewTouch from the [official sourceforge](https://sourceforge.net/projects/libsdl-android/files/apk/XServer-XSDL/).
since it's no longer on the play store.
With Android 4 you may have to use v1.11.40
3. Install the app on the Android device
4. Choose [USB (ADB)](#adb) or [WI-FI](#wifi)
1. [First installl KlipperScreen on the Pi](Installation.md)
2. Install [XServer-XSDL](https://play.google.com/store/apps/details?id=x.org.server) on the android device
3. Choose [USB(ADB)](#adb) or [WIFI](#wifi)
### ADB
!!! warning
Leaving the phone always connected it's not recommended, remove the battery to avoid issues.
1. Install ADB on the computer/SBC/Pi with this command:
```bash
sudo apt-get install android-tools-adb
```
2. Put your Android device in Debug mode.
* Install ADB on the Pi
```bash
sudo apt-get install android-tools-adb
```
* Put your Android phone/tablet in Debug mode.
Usually it involves enabling developer mode and "USB debugging"
the exact method varies on different vendors and versions of the device
Usually it involves enabling developer mode and "USB debugging" but this varies on different vendors and versions of the device
search "how to enable android debugging on device-model-and-brand"
search "how to enable Android debugging on device-model-and-brand"
* Copy the launcher script
3. Copy the sample launcher script with the following commands:
```bash
cd ~/KlipperScreen/scripts
cp sample-android-adb.sh launch_KlipperScreen.sh
chmod +x launch_KlipperScreen.sh
```
```bash
cd ~/KlipperScreen/scripts
cp sample-android-adb.sh launch_KlipperScreen.sh
chmod +x ~/KlipperScreen/scripts/launch_KlipperScreen.sh
```
4. Start Xserver-XSDL On the Android device
5. Go to [Startup](#startup)
* Go to [Startup](#startup)
### WIFI
1. Create a launcher script by entering the following commands:
* Create a launcher script
```bash
rm ~/KlipperScreen/scripts/launch_KlipperScreen.sh
touch ~/KlipperScreen/scripts/launch_KlipperScreen.sh
chmod +x ~/KlipperScreen/scripts/launch_KlipperScreen.sh
nano ~/KlipperScreen/scripts/launch_KlipperScreen.sh
```
```bash
cd ~/KlipperScreen/scripts
touch launch_KlipperScreen.sh
chmod +x launch_KlipperScreen.sh
nano launch_KlipperScreen.sh
```
2. Start the app on the Android device (Xserver-XSDL or ViewTouch)
3. Paste this into the script:
Replace the example IP with the one that Android app shows in the screen.
```bash
DISPLAY=192.168.150.122:0 $KS_XCLIENT
```
* Paste this into the script (replace the example IP)
```bash
DISPLAY=192.168.150.122:0 $KS_XCLIENT
```
!!! important
It's recommended to use a static IP address, because if it changes your connection will stop working.
It's recommended to use a static address, because if the address changes your connection will stop working.
* Go to [Startup](#startup)
## Startup
Enter this command on the computer/SBC/Pi
```bash
sudo service KlipperScreen restart
```
## Doesn't start
Follow this steps:
1. Reboot the Android device
2. Open the XSDL app and leave it waiting in the blue-screen
3. Reboot the computer/SBC/Pi
## Xserver-XSDL config
Some versions of the app require this configuration to work as expected.
Start Xserver-XSDL On the android device
On the splash-screen of the app go to:
```
@@ -108,21 +67,15 @@ On the splash-screen of the app go to:
```
if you missed it, restart the app.
## Recommended configuration for this use case
It's recommended to set Display timeout to never:
Also for X11 installs turn off DPMS:
![disable_dpms_poweroff](img/disable_dpms_poweroff.png)
on the Pi
```bash
sudo service KlipperScreen stop
sudo service KlipperScreen start
```
## Stop Screen Blanking in Xserver-XSDL
Even after enabling the "Stay Awake" option in the Developer/USB Debugging options of your Android device,
the Xserver-XSDL may still go to a black screen but keep the backlight of your device on.
To keep the screen always active, upon start up of Xserver-XSDL app, select the `Change Device Configuration`
at the top of the splash screen and then select the `Command line parameters, one argument per line` option.
Append the following argument (must be on separate lines):
Even after enabling the "Stay Awake" option in the Developer/USB Debugging options of your Android device, the Xserver-XSDL may still go to a black screen but keep the backlight of your device on. To keep the screen always active, upon start up of Xserver-XSDL app, select the `Change Device Configuration` at the top of the splash screen and then select the `Command line parameters, one argument per line` option. Append the following argument (must be on seperate lines):
```
-s
0
@@ -140,11 +93,11 @@ sudo service KlippyScreenAndroid stop
sudo rm /etc/systemd/system/KlippyScreenAndroid.service
```
Follow this guide on how to set up the new launcher script with [USB(ADB)](#adb) or [WI-FI](#wifi) and restart KS.
Follow this guide on how to setup the new launcher script with [USB(ADB)](#adb) or [WIFI](#wifi) and restart KS.
## Help
[The Discourse thread has old instructions, but you may get some help if needed](https://klipper.discourse.group/t/how-to-klipperscreen-on-android-smart-phones/1196)
[The Discourse thread has old instructions but you may get some help if needed](https://klipper.discourse.group/t/how-to-klipperscreen-on-android-smart-phones/1196)
[#klipper-screen channel on Discord](https://discord.klipper3d.org/)
+27
View File
@@ -0,0 +1,27 @@
# Changelog
Breaking changes will be listed here.
#### [2022 03 21](https://github.com/jordanruthe/KlipperScreen/commit/bc34b3c8d6761c27a0b0c62fc4dfa11442b417f6)
* Default configuration is now merged again.
Fixing [2021 05 20](https://github.com/jordanruthe/KlipperScreen/commit/eb801486928bf02709033dcbc5f0a45ca43b23c1)
#### [2022 03 10](https://github.com/jordanruthe/KlipperScreen/commit/490dc929bd11e3c4200b999ce7204d84fa0bc184)
* The "Power On Printer" button now requires power_devices under the printer section in KlipperScreen.conf
the power_devices allowed are those defined in the config of moonraker of the printer
The "Power" panel will be in the Menu if there are power devices found
#### [2022 03 01](https://github.com/jordanruthe/KlipperScreen/commit/49ab84e8d51535d3469d97fdee53099cca6abc39)
* The "Power On Printer" button now requires that the printer name in KlipperScreen.conf
and the power device in moonraker.conf to have the same name.
The "Power" panel will be in the Menu if there are power devices found
#### [2022 01 11](https://github.com/jordanruthe/KlipperScreen/commit/8a8c6c064cc6d097b1b34a5c42b4001367e545a6)
* The Preheat panel has been deprecated in favor of an all in one Temperature panel
Remove preheat panel from your Klipperscreen.conf or replace the occurrences of preheat with temperature
#### [2021 05 20](https://github.com/jordanruthe/KlipperScreen/commit/eb801486928bf02709033dcbc5f0a45ca43b23c1)
* Default configuration is not merged if a user configuration is set for a specific option
For instance, if `menu __main` is user defined, the main menu will not have any defaults.
+107 -199
View File
@@ -5,136 +5,98 @@ create a blank file in `~/printer_data/config/KlipperScreen.conf`, if the file a
Write in the file only the options that need to be changed, and restart KlipperScreen.
!!! failure "Critical"
Each configuration option should be on a newline, as they are presented here.
The line endings should be of UNIX style (LF).
## Include files
```py
[include conf.d/*.conf]
# Include another configuration file. Wildcards (*) will expand to match anything.
```
## Main Options
The options listed here are not editable from within the user interface.
```{ .ini .no-copy }
The options listed here are not changeable from within the ui.
```py
[main]
# Time in seconds before the Job Status page closes itself after a successful job/print
# 0 means disabled
# job_complete_timeout: 0
job_complete_timeout: 0
# Time in seconds before the Job Status closes itself if an error is encountered
# job_error_timeout: 0
job_error_timeout: 0
# Allows the cursor to be displayed on the screen
show_cursor: False
# If multiple printers are defined, this can be set the name of the one to show at startup.
# default_printer: MyPrinter
default_printer: Ender 3 Pro
# To define a full set of custom menus (instead of merging user entries with default entries)
# To define a full set of custom menues (instead of merging user entries with default entries)
# set this to False. See Menu section below.
# use_default_menu: True
use_default_menu: True
# Define one or more moonraker power devices that turn on/off with the screensaver (CSV list)
# screen_on_devices: example1, example2
# screen_off_devices: example1, example2
# Define the password to use when locking the screen, this is not secure
# it's saved as plain text, it's meant to be a deterrent for kids or people at shows
# it will be redacted from the logs.
# default is no password
# lock_password: example_password
# Auto-lock the screen after a period of inactivity (in seconds)
# 0 means disabled
# autolock_timeout: 0
# Start KlipperScreen with the screen locked
# start_locked: False
# Allow button focus to navigate with the keyboard
# a scroll wheel mapped to tab/shift+tab and enter button can work
# Beware that the UI is coded to be touchscreen controlled, this is
# not recommended as the only way to control
# keyboard_navigation: False
screen_on_devices: example1, example2
screen_off_devices: example1, example2
```
!!! tip
It is strongly recommended that you do not add settings to the config file if you don't need them
## Printer Options
Multiple printers can be defined
```{ .ini .no-copy }
```py
# Define printer and name. Name is anything after the first printer word
[printer MyPrinter]
[printer Ender 3 Pro]
# Define the moonraker host/port if different from 127.0.0.1 and 7125
moonraker_host: 127.0.0.1
# ports 443 and 7130 will use https/wss
moonraker_port: 7125
# Use HTTPS/WSS. Defaults to True for ports 443 or 7130, False for any other port
# moonraker_ssl: False
# If you're using the route_prefix option in your moonraker config, specify it here.
# This can be useful for running multiple printers behind a path-based reverse proxy.
# Most installs will not need this.
# moonraker_path: printer1
# Moonraker API key if this host is not connecting from a trusted client IP
# moonraker_api_key: False
# Moonraker API key if this is not connecting from a trusted client IP
moonraker_api_key: False
# Define the z_babystep intervals in a CSV list. Currently only 2 are supported, the last value is default
# z_babystep_values: 0.01, 0.05
# Define the z_babystep intervals in a CSV list. Currently only 2 are supported
z_babystep_values: 0.01, 0.05
# Override the movement speed and set a specific for this printer.
# These setting overrides the settings configured in the UI. If specified,
# the values configured in the UI will not be used.
move_speed_xy: 500
move_speed_z: 300
# For the 'Power on' button on the splash screen:
# Define one or more moonraker power devices that turn on this printer (CSV list)
# By Default it tries to match the printer name defined in this section header to the moonraker power device name.
# This devices will be turned OFF when using the shutdown button
# power_devices: example1, example2
# Default is the printer name
power_devices: example1, example2
# Define what items should be shown in titlebar besides the extruder and bed
# the name must be the same as defined in the klipper config
# valid options are temperature_sensors or temperature_fans, or heater_generic
# There is a special item named "spool" that depends on Spoolman data provided through Moonraker
# titlebar_items: chamber, MCU, Pi, spool
titlebar_items: chamber, MCU, Pi
# The style of the user defined items in the titlebar
# Can be 'full' indicating that the full name is shown, 'short' for the first letter, or None (default) for no name
# titlebar_name_type: None
# Low limit for remaining spool weight in the title bar, in grams.
# When the active spool drops below this value, the spool icon and weight turn red.
# spool_low_limit: 20
titlebar_name_type: None
# Z probe calibrate position
# By default it tries to guess the correct location
# it will try using zero reference position, safe_z, mesh midddle, middle of axis length, etc
# example:
# calibrate_x_position: 100
# calibrate_y_position: 100
# By default is the middle of the bed
calibrate_x_position: 100
calibrate_y_position: 100
# Custom commands for zcalibrate
# the zcalibrate panel provides quick access to test_z, accept and cancel commands
# if you have a command that makes use of this functions and it's not in the main klipper repository
# add it to this list.
# examples:
# zcalibrate_custom_commands: MYCUSTOMPROBE_CALIBRATE, CUSTOM_CALIBRATE method=manual, CUSTOM_TEST
# Bed Screws
# define the screw positons required for odd number of screws in a comma separated list
# possible values are: bl, br, bm, fl, fr, fm, lm, rm, center
# they correspond to back-left, back-right, back-middle, front-left, front-right, front-middle, left-middle, right-middle
screw_positions: ""
# Rotation is useful if the screen is not directly in front of the machine.
# It will affect the bed mesh visualization.
# Valid values are 0 90 180 270
# screw_rotation: 0
screw_rotation: 0
# Define distances and speeds for the extrude panel. CSV list 2 to 4 integers the second value is default
# extrude_distances: 5, 10, 15, 25
# extrude_speeds: 1, 2, 5, 25
# Define distances and speeds for the extrude panel. CSV list 2 to 4 integers
extrude_distances: 5, 10, 15, 25
extrude_speeds: 1, 2, 5, 25
# Define distances for the move panel. comma-separated list with 2 to 7 floats and/or integers
# move_distances: 0.1, 0.5, 1, 5, 10, 25, 50
# Camera needs to be configured in moonraker:
# https://moonraker.readthedocs.io/en/latest/configuration/#webcam
# Camera configuration
camera_url: http://127.0.0.1/webcam/?action=stream
```
## Preheat Options
!!! question "Added one the others disappeared, Is this normal?"
Adding a custom preheat section will cause the defaults to not load, this is
the intended behaviour.
```ini
```py
[preheat my_temp_setting]
extruder: 195
extruder1: 60
@@ -150,163 +112,109 @@ heater_generic: 60
gcode: MY_HEATSOAK_MACRO
```
There is a special preheat setting named cooldown to *do additional things* when the _cooldown_ button is pressed
*do not* add `TURN_OFF_ALL_HEATERS` or you will remove the ability to turn off individual heaters with this button.
There is a special preheat setting named cooldown to do additional things when the _cooldown_ button is pressed
for example:
```ini
```py
[preheat cooldown]
gcode: M107
```
## Include files
```{ .ini .no-copy }
# [include conf.d/*.conf]
# Include another configuration file. Wildcards (*) will expand to match anything.
```
## Menu
This allows a custom configuration for the menu displayed while the printer is idle. You can use sub-menus to group
different items and there are several panel options available. It is possible to have a gcode script run on a menu
button press. There are two menus available in KlipperScreen, __main and __print. The __main menu is displayed while the
printer is idle. The __print menu is accessible from the printing status page.
!!! info
A predefined set of menus is already provided
A menu item is configured as follows:
```{ .ini .no-copy }
```py
[menu __main my_menu_item]
# To build a sub-menu of this menu item, you would next use [menu __main my_menu_item sub_menu_item]
name: Item Name
# To build a sub-menu of this menu item, you would next define [menu __main my_menu_item sub_menu_item]
#
# --- The following items are optional ---
#
# icon: home
# Icon name to be used, it can be any image in the directory:
# KlipperScreen/styles/{theme}/images/ where {theme} is your current theme
# Supported formats svg or png
#
# style: mycolor4
# Icon style, defined as "button.mycolor4" (for example) in the theme css
#
# panel: preheat
# Panel from the panels folder in the KlipperScreen folder
#
# enable: {{ 'screws_tilt_adjust' in printer.config_sections and printer.power_devices.count > 0 }}
# Enable allows hiding of a menu if the condition is false. (evaluated with Jinja2)
# Available variables are listed in the next section.
#
# --- The items below do not work if you define a panel to be loaded ---
#
# method: printer.gcode.script
# Moonraker method to call when the item is selected, you will need params below
# the most common is is printer.gcode.script check out other methods in moonraker documentation:
# https://moonraker.readthedocs.io/en/latest/web_api/#run-a-gcode
#
# params: {"script":"G28 X"}
# Parameters that would be passed with the method above
#
# confirm: 'Are you sure?'
# If present this option will give you a confirmation prompt with the text above.
# It's recommended that you use a Macro-prompt instead of this option,
# as the Macro-prompt will also be shown on other interfaces, and it's more flexible.
# Macro-prompts are described in: https://klipperscreen.github.io/KlipperScreen/macros/#prompts
icon: home
# Optional Parameters
# Icon style, defined as "button.mycolor4" (for example) in the theme css
style: mycolor4
# Panel from the panels listed below
panel: preheat
# Moonraker method to call when the item is selected
method: printer.gcode.script
# Parameters that would be passed with the method above
params: {"script":"G28 X"}
# Enable allows hiding of a menu if the condition is false. This statement is evaluated in Jinja2
# Available variables are listed below.
enable: {{ printer.power_devices.count > 0 }}
```
Available panels are listed here: [docs/panels.md](Panels.md)
Variables to conditionally test the enable statement:
```{ .yaml .no-copy }
# Configured in Moonraker
moonraker.power_devices.count # Number of power devices
moonraker.cameras.count # Number of cameras
moonraker.spoolman # Has spoolman
# Printer specific
printer.pause_resume.is_paused # Printing job is paused
Certain variables are available for conditional testing of the enable statement:
```py
printer.extruders.count # Number of extruders
printer.temperature_devices.count # Number of temperature related devices (not extruders)
printer.temperature_devices.count # Number of temperature related devices that are not extruders
printer.fans.count # Number of fans
printer.output_pins.count # Number of pins configured
printer.power_devices.count # Number of power devices configured in Moonraker
printer.gcode_macros.count # Number of gcode macros
printer.gcode_macros.list # List of names of the gcode macros
printer.leds.count # Number of leds
printer.config_sections # Array of section headers of Klipper config (printer.cfg)
printer.available_commands # List of all the commands that the printer supports
printer.output_pins.count # Number of fans
printer.bltouch # Available if bltouch section defined in config
printer.probe # Available if probe section defined in config
printer.bed_mesh # Available if bed_mesh section defined in config
printer.quad_gantry_level # Available if quad_gantry_level section defined in config
printer.z_tilt # Available if z_tilt section defined in config
printer.firmware_retraction # True if defined in config
printer.input_shaper # True if defined in config
printer.bed_screws # True if defined in config
printer.screws_tilt_adjust # True if defined in config
printer.idle_timeout # Idle timeout section
printer.pause_resume # Pause resume section of Klipper
```
A sample configuration of a main menu would be as follows:
```{ .yaml+jinja .no-copy }
```py
[menu __main homing]
name: Homing
icon: home
[menu __main preheat]
name: Preheat
icon: heat-up
panel: preheat
[menu __main print]
name: Print
icon: print
panel: print
[menu __main homing homeall]
name: Home All
icon: home
method: printer.gcode.script
params: {"script":"G28"}
[menu __main homing mymacro]
name: My Macro
icon: home
method: printer.gcode.script
params: {"script":"MY_MACRO"}
enable: {{ 'MY_MACRO' in printer.gcode_macros.list }}
[menu __main preheat]
name: Preheat
icon: heat-up
panel: preheat
```
## KlipperScreen behaviour towards configuration
KlipperScreen will search for a configuration file in the following order:
1. _~/printer_data/config/KlipperScreen.conf_
2. _~/.config/KlipperScreen/KlipperScreen.conf_
3. _${KlipperScreen_Directory}/KlipperScreen.conf_
1. _~/KlipperScreen.conf_
2. _${KlipperScreen_Directory}/KlipperScreen.conf_
3. _~/printer_data/config/KlipperScreen.conf_
4. _~/klipper_config/KlipperScreen.conf_
If you need a custom location for the configuration file, you can add [launch argument](#adding-launch-arguments)
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify
the location of your configuration file.
If one of those files are found, it will be merged with the default configuration.
Default Preheat options will be discarded if a custom preheat is found.
If include files are defined then, they will be merged first.
The default config is included here: (do not edit use as reference)
_${KlipperScreen_Directory}/config/defaults.conf_
_${KlipperScreen_Directory}/ks_includes/default.conf_
*Do not* copy the entire default.conf file, just configure the settings needed.
Preferably *do not* copy the entire default.conf file, just configure the settings needed.
If no config file is found, then when a setting is changed in the settings panel, a new configuration file should be created automatically.
## Starting on a different monitor/display/screen
Add -m or --monitor as a launch argument, to specify the number of the monitor, that will show Klipperscreen (default: 0).
!!! warning
Selecting the monitor is only allowed when KlipperScreen is set to launch fullscreen in standalone mode (no DE)
## Adding launch arguments
The recommended way to add launch arguments is:
1. Create a launch script:
```bash
touch ~/KlipperScreen/scripts/launch_KlipperScreen.sh
chmod +x launch_KlipperScreen.sh
```
2. Edit the script:
```bash
nano ~/KlipperScreen/scripts/launch_KlipperScreen.sh
```
Add the init and the launch argument, this example will launch KlipperScreen on the second monitor if exists:
```
/usr/bin/xinit $KS_XCLIENT --monitor 1
```
!!! tip
you can use --configfile and --logfile to specify custom locations for those files
If no config file is found, then when a setting is changed in the settings panel, a new configuration file will be created automatically.
+4 -16
View File
@@ -1,23 +1,11 @@
# Contact
There are several ways to contact people who can assist with issues.
Discord is probably going to provide the quickest response as there are more people in the chat who can help.
There are several ways to contact people who can assist with issues. Discord is going to be the quickest response as
there will be more people in the chat who can help.
## GitHub Issues
You may submit a GitHub issue request for any problems you are having.
## Klipper Community Discord
[Look for the channel `#klipper-screen`](https://discord.klipper3d.org/)
## Issues or improvements to the docs or the application
You may submit a GitHub issue request for any bugs you encounter.
or a Pull Request with translations, features, doc fixes.
or open an issue describing the changes.
or even provide ideas for a feature.
[GitHub repository](https://github.com/KlipperScreen/KlipperScreen/)
-61
View File
@@ -1,61 +0,0 @@
# Developer Guide
Basic setup for an environment to do development of KlipperScreen.
!!! note "Alfrix Note:"
I use a standard Linux distro with a desktop environment.
## Clone the repo
Clone your fork, for example:
```
cd ~
git clone https://github.com/klipperscreen/klipperscreen.git
```
## Install the dependencies on the host
The X11 or Wayland dependencies should not be needed if you are running a desktop GNU/Linux distro.
See [scripts/system-dependencies.json](https://github.com/KlipperScreen/KlipperScreen/blob/master/scripts/system-dependencies.json)
## Create a virtual environment
For example:
```bash
cd ~/KlipperScreen
python3 -m venv .venv
source .venv/bin/activate
pip install -r scripts/KlipperScreen-requirements.txt
# this one is optional:
pip install -r scripts/dev-requirements.txt
```
# Set configurations
Create klipperscreen.conf and place it on the repo folder
```
[main]
show_cursor=True
# disable screen timeouts
use_dpms=False
screen_blanking=off
# disable Fullscreen and start in a specified size
# 480 x 320 is the minimum size to target
width=480
height=320
# setting width or height will disable fullscreen and it's the intended behavior
```
At this point you can add your actual printer section with the IP (and port of needed) to the config or/and add a virtual printer
# Optional: Virtual printer
You may use a virtual printer like it's described in the [klipper docs](https://www.klipper3d.org/Debugging.html#testing-with-simulavr),
or it's [alternative that uses docker](https://github.com/mainsail-crew/virtual-klipper-printer)
Using a Virtual printer will need klipper and moonraker need to be installed in the machine too.
!!! note
The virtual printer has various limitations,
like constant temperature and limited availability of pins,
it's not a limitation of klipperscreen
## Optional: Configure the IDE
* Set interpreter to the virtual environment created
* Set the run configuration to `KlipperScreen/screen.py`
-49
View File
@@ -1,49 +0,0 @@
# Frequently Asked Questions
## What is the minimum Python version required?
The minimum required version of Python is 3.8. This requirement is checked during installation.
??? "Using Older Python Versions"
If you need to use Python 3.7, you can revert KlipperScreen to v0.4.1
Connect to the printer via SSH and:
```sh
cd ~/KlipperScreen
git reset --hard v0.4.1
```
## Does KlipperScreen work with OctoPrint?
KlipperScreen is not designed to work with OctoPrint, and there are no plans to make it compatible.
## Can I use KlipperScreen as a desktop application?
Yes, you can use KlipperScreen as a desktop application. During installation, do not install it as a service. If you have already installed it as a service, you can disable it by running:
```sh
sudo systemctl disable KlipperScreen
```
Then, you can open the application via the menu when needed. You can also find the shortcut in `KlipperScreen/scripts/KlipperScreen.desktop`.
## Why did the title bar turn red and display CPU and RAM usage?
The red title bar indicating high CPU and RAM usage is a warning system. High resource usage can lead to issues, such as "timer too close" errors in Klipper. If this warning appears during an update or maintenance process, it is generally not an issue—just avoid starting a print job until the warning clears. You can use htop or similar tools from an SSH connection to check what’s consuming the resources.
## How can I switch between multiple printers?
KlipperScreen supports multiple printers. You can switch between them by configuring each printer's IP address in the KlipperScreen settings. This allows you to manage all your printers from a single interface, even if they are running on different hosts.
## Can I customize the KlipperScreen interface?
Yes, you can customize the KlipperScreen interface by editing the configuration files. Detailed instructions and options for customization can be found in the [documentation](https://klipperscreen.github.io/KlipperScreen/).
## What should I do if my touchscreen is not responding correctly?
If your touchscreen is not responding or has touch accuracy issues, check the [Touch Issues section](Troubleshooting/Touch_issues.md) in the troubleshooting guide. You may need to calibrate the touch settings or adjust the touch matrix.
## How do I update KlipperScreen?
To update KlipperScreen, follow the instructions in the [updating guide](Updating.md).
## What if I sometimes see the desktop instead of KlipperScreen?
If you sometimes see the desktop instead of KlipperScreen, and you only want to see KlipperScreen, you may have installed a distro with a full desktop environment. [Check these instructions](Troubleshooting/Desktop.md) on how to properly switch.
+104 -11
View File
@@ -1,32 +1,125 @@
# Hardware
KlipperScreen supports a variety of screens, with a minimum supported resolution of 480x320. Generally, if a device can display a GNU/Linux desktop, it should be compatible with KlipperScreen.
There are no recommended screens, but the minimum supported resolution is 480x320.
## Supported Hardware
In general, if the device can show a GNU/Linux desktop, then KlipperScreen should work too.
The following screens are known to work with KlipperScreen:
#### Hardware known to work
* [BTT PI TFT50](https://www.biqu.equipment/collections/lcd/products/bigtreetech-pi-tft50-v1-0-tft-display-for-raspberry-pi-3d-printer-part)
* [BTT HDMI5/7](https://biqu.equipment/products/bigtreetech-hdmi5-v1-0-hdmi7-v1-0)
* [Raspberry PI 7" Touchscreen](https://www.raspberrypi.org/products/raspberry-pi-touch-display/)
* [Hyperpixel 4](https://shop.pimoroni.com/products/hyperpixel-4)
* [3.5" Elegoo](https://www.elegoo.com/de/products/elegoo-3-5-inch-tft-lcd-screen)
* [3.5" RPi Display](http://www.lcdwiki.com/3.5inch_RPi_Display)
* [5" HDMI Display-B](http://lcdwiki.com/5inch_HDMI_Display-B)
* [VoCore](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35/7)
* [WAVESHARE 4.3 inch DSI LCD](https://www.waveshare.com/4.3inch-dsi-lcd.htm)
* [DFrobot DFR0550](https://wiki.dfrobot.com/5%27%27TFT-Display_with_Touchscreen_V1.0_SKU_DFR0550)
* [Android phone](Android.md)
For more hardware known to work with KlipperScreen, visit the [Klipper Discourse](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35).
### Install
* [More known hardware in the klipper discourse](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35)
1. **Install Your Screen**: Follow the manufacturer’s instructions for installing your screen. If you see a white screen, it indicates that the installation was not successful. Ensure that you can at least see a console.
2. **Install KlipperScreen**: Once the screen is properly installed and functioning, proceed to [install KlipperScreen](Installation.md).
### Configuration
## Screen Rotation
Follow the manufacturer instructions on how to install your screen. In general if you see a white screen, then it's not properly installed, ensure that you at least see a console, Then [install](Installation.md) KlipperScreen, if you are having troubles refer to the [troubleshooting page](Troubleshooting.md) for further information.
For information on screen rotation, refer to the [Rotation section](Troubleshooting/Rotation.md) in the troubleshooting guide.
## Screen rotation
Currently there is no support for rotation at runtime, do not use xrandr to rotate the screen.
Configure the server to start in the desired orientation, there are many ways to achieve this, here is one:
## Touchscreen Touch Rotation
For touchscreen rotation and matrix issues, see the [Touch Issues section](Troubleshooting/Touch_issues.md#touch-rotation-and-matrix) in the troubleshooting guide.
Create /usr/share/X11/xorg.conf.d/90-monitor.conf
```bash
sudo nano /usr/share/X11/xorg.conf.d/90-monitor.conf
```
Paste this section modifying the options to suit your needs:
```
Section "Monitor"
Identifier "DPI-1"
# This identifier would be the same as the name of the connector printed by xrandr.
# it can be "HDMI-0" "DisplayPort-0", "DSI-0", "DVI-0", "DPI-0" etc
Option "Rotate" "left"
# Valid rotation options are normal,inverted,left,right
Option "PreferredMode" "1920x1080"
# May be necesary if you are not getting your prefered resolution.
EndSection
```
Save the file and restart KlipperScreen.
```bash
sudo service KlipperScreen restart
```
## Touchscreen touch rotation
If your touchscreen isn't registering touches properly after the screen has been rotated, you will need to apply a
transformation matrix.
First you will need your device name, on a terminal run:
```sh
DISPLAY=:0 xinput
```
Output:
```sh
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ADS7846 Touchscreen id=6 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
```
In this case the device is the ADS7846 Touchscreen, yours may be different
You can test a change by running:
```sh
DISPLAY=:0 xinput set-prop "<device name>" 'Coordinate Transformation Matrix' <matrix>
```
Where the matrix can be one of the following options:
* 0°: `1 0 0 0 1 0 0 0 1`
* 90° Clockwise: `0 -1 1 1 0 0 0 0 1`
* 90° Counter-Clockwise: `0 1 0 -1 0 1 0 0 1`
* 180° (Inverts X and Y): `-1 0 1 0 -1 1 0 0 1`
* invert Y: `-1 0 1 1 1 0 0 0 1`
* invert X: `-1 0 1 0 1 0 0 0 1`
For example:
```sh
DISPLAY=:0 xinput set-prop "ADS7846 Touchscreen" 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
```
To make this permanent, modify the file `/etc/udev/rules.d/51-touchscreen.rules` and add following line:
```sh
ACTION=="add", ATTRS{name}=="<device name>", ENV{LIBINPUT_CALIBRATION_MATRIX}="<matrix>"
```
As an alternative if the above doesn't work:
edit /usr/share/X11/xorg.conf.d/40-libinput.conf
for example:
```sh
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"
EndSection
```
More info about input transformation can be found in:
* [Ubuntu wiki InputCoordinateTransformation](https://wiki.ubuntu.com/X/InputCoordinateTransformation)
* [Libinput docs](https://wayland.freedesktop.org/libinput/doc/1.9.0/absolute_axes.html)
-203
View File
@@ -1,203 +0,0 @@
How I installed the 3.5" (A) type of screen on RaspberryOS Bookworm (Debian 12)
Update: I've tested Bullseye (Debian 11) and it works, but [rotation was not working](#rotation)
![preview](../img/hardware/rpi35a.jpg)
!!! abstract "Disclaimer"
This is based on my own experience, and it's provided for general information
and does not constitute as advice of any kind.
## Initial install
This screens connect to the [GPIO](https://en.wikipedia.org/wiki/General-purpose_input/output)
they were usually installed via repositories named LCD-show ([1](https://github.com/waveshare/LCD-show), [2](https://github.com/goodtft/LCD-show)),
however in the bookworm release there is a simpler solution
```sh
sudo nano /boot/firmware/config.txt
```
at the bottom add:
```
dtoverlay=piscreen,drm
```
???+ info
in this context drm stands for [Direct Rendering Manager](https://en.wikipedia.org/wiki/Direct_Rendering_Manager)
I had to comment out (add # at the start) vc4 or it would boot into a blackscreen
```
#dtoverlay=vc4-kms-v3d
```
Close the nano editor using `ctrl`+`x` (exit), then `y` for yes (save).
```sh
sudo reboot
```
## Wrong colors or graphical corruption
Some screens will not behave correctly and/or display wrong colors,
this usually due to the wrong [SPI](https://en.wikipedia.org/wiki/Serial_Peripheral_Interface) speed
In my case the maximum I could achieve is 22.22Mhz
```
dtoverlay=piscreen,drm,speed=22222222
```
??? info "About speed"
As you may predict speed has a big impact in usability as it dictates how often the display will refresh
If i understand the [involved drivers](https://github.com/torvalds/linux/blob/65d287c7eb1d14e0f4d56f19cec30d97fc7e8f66/drivers/spi/spi-bcm2835.c#L1068)
correctly, the spi speed is calculated as:
`core_clock / core_divisor`
The divisor must be a multiple of 2, that ranges between 2 and 65536
Core clock in the case of Pi 3 would be 400mhz
So even if you can enter any number, it will be approximated to a value from that formula
That's why I used 22.222.222 (400 / 18)
reboot to test any changes.
## Rotation
You can rotate the screen adding a rotate line with the degrees [0, 90, 180, 270]
```
dtoverlay=piscreen,drm,rotate=180
```
Screen rotation will require adjusting the touch matrix see [Touch issues](../../Troubleshooting/Touch_issues/)
!!! bug
Raspberry linux Kernel v6.1.77 has a bug in the dtb and rotate doesn't work
The fix has been merged in linux v6.6
you can copy the dtb from the new kernel into the old one if needed
## Console
To make the console work:
```sh
sudo nano /boot/firmware/cmdline.txt
```
add at the start or end:
```
fbcon=map:11
```
!!! warning "Important"
Do not add newlines to the file, it must be 1 line with the options separated by spaces
## Type (B-v2)
I have tried the type (B) version 2, and it's quite different, this screen has a different initialization sequence,
probably due to being IPS
so you will need the waveshare35b-v2 dtb of the [waveshare repo](https://github.com/waveshare/LCD-show), to be copied into the appropriate folder:
```
git clone https://github.com/waveshare/LCD-show
sudo cp LCD-show/waveshare35b-v2-overlay.dtb /boot/firmware/overlays/waveshare35b-v2.dtbo
```
the config would be something like this, another major difference is that this display will default to vertical
the maximum speed I could achieve with mine was 33mhz (400mhz/12) without color aberration,
but I ended up with 30mhz to have some margin
this overlay supports an fps value, default is 30 I changed it to 60
this screen was never super responsive but with this configuration is quite tolerable in my opinion.
``` title="/boot/firmware/config.txt"
dtoverlay=waveshare35b-v2:rotate=270,drm,speed=30000000,fps=60
```
```ini title="example of dmesg output"
...
[ 14.926080] input: ADS7846 Touchscreen as /devices/platform/soc/3f204000.spi/spi_master/spi0/spi0.1/input/input0
[ 15.015895] fbtft: module is from the staging directory, the quality is unknown, you have been warned.
[ 15.021701] fb_ili9486: module is from the staging directory, the quality is unknown, you have been warned.
[ 15.022279] SPI driver fb_ili9486 has no spi_device_id for ilitek,ili9486
[ 15.022555] fb_ili9486 spi0.0: fbtft_property_value: regwidth = 16
[ 15.022572] fb_ili9486 spi0.0: fbtft_property_value: buswidth = 8
[ 15.022588] fb_ili9486 spi0.0: fbtft_property_value: debug = 0
[ 15.022600] fb_ili9486 spi0.0: fbtft_property_value: rotate = 270
[ 15.022615] fb_ili9486 spi0.0: fbtft_property_value: fps = 60
[ 15.022627] fb_ili9486 spi0.0: fbtft_property_value: txbuflen = 32768
[ 15.826386] graphics fb1: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 32 KiB buffer memory, fps=62, spi0.0 at 30 MHz
...
```
by default with this configuration the output will be on the secondary framebuffer
so a file must be created to address this issue:
``` title="/usr/share/X11/xorg.conf.d/99-fbdev.conf"
Section "Device"
Identifier "Allwinner A10/A13 FBDEV"
Option "fbdev" "/dev/fb1"
Option "SwapbuffersWait" "true"
EndSection
```
!!! tip
notice that I'm using fbdev and not fbturbo, you can use fbturbo if you like (remember to install it)
at this point this still did not work:
```ini title="example of /var/log/Xorg.0.log"
[ 172.061] (II) LoadModule: "modesetting"
[ 172.061] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[ 172.064] (II) Module modesetting: vendor="X.Org Foundation"
[ 172.064] compiled for 1.21.1.7, module version = 1.21.1
[ 172.064] Module class: X.Org Video Driver
[ 172.064] ABI class: X.Org Video Driver, version 25.2
[ 172.065] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[ 172.067] (WW) Falling back to old probe method for modesetting
[ 172.068] (EE) open /dev/dri/card0: No such file or directory
[ 172.068] (WW) Falling back to old probe method for modesetting
[ 172.068] (EE) open /dev/dri/card0: No such file or directory
[ 172.068] (EE) No devices detected.
[ 172.068] (EE)
Fatal server error:
[ 172.068] (EE) no screens found(EE)
```
so I checked out the configuration and found:
``` title="default contents of /usr/share/X11/xorg.conf.d/20-noglamor.conf"
Section "Device"
Identifier "kms"
Driver "modesetting"
Option "AccelMethod" "msdri3"
Option "UseGammaLUT" "off"
EndSection
```
did:
```
sudo nano /usr/share/X11/xorg.conf.d/20-noglamor.conf
```
deleted everything and saved.
then removed the write permissions to prevent being regenerated:
```
sudo chmod 444 /usr/share/X11/xorg.conf.d/20-noglamor.conf
```
at this point the screen was working, but the touchscreen needed to be rotated:
``` title="rules for rotation: /etc/udev/rules.d/51-touchscreen.rules"
ACTION=="add", ATTRS{name}=="ADS7846 Touchscreen", ENV{LIBINPUT_CALIBRATION_MATRIX}="0 1 0 -1 0 1 0 0 1"
```
after a reboot the waveshare type b rev2 was working perfectly at this point.
-56
View File
@@ -1,56 +0,0 @@
Screens that use HDMI should work out of the box
you may need to configure the resolution in RaspberryOS Bookworm
you can do this by editing the kernel commandline
```
sudo nano /boot/firmware/cmdline.txt
```
!!! warning "Important"
Do not add newlines to the file, it must be 1 line with the options separated by spaces
for example:
```
video=1920x1080
```
more complex example:
```
video=HDMI-A-1:1920x1080M@60,rotate=90,reflect_x
```
???+ "Find the identifier use xrandr"
on a terminal run:
```sh
DISPLAY=:0 xrandr
```
it will output something like:
```
Screen 0: minimum 320 x 200, current 1024 x 600, maximum 8192 x 8192
HDMI-1 connected primary 1024x600+0+0 (normal left inverted right x axis y axis) 800mm x 450mm
```
in this case the identifier is HDMI-1 and a simple cmdline arg would be something like:
`video=HDMI-1:1024x600@60`
Valid mode specifiers:
```
<xres>x<yres>[M][R][-<bpp>][@<refresh-rate>][i][m][eDd]
```
options on brackets are optional
| Option | Description |
|-----------------|----------------------------------------------------------------------------------------|
| M | Calculate timings using [CVT](https://en.wikipedia.org/wiki/Coordinated_Video_Timings) |
| R | CVT reduced blanking (refresh rate must be 60Hz) |
| -<bpp> | Bits per pixel, A.K.A. BitDepth usually 24 |
| @<refresh-rate> | acceptable refresh rates are 50, 60, 70 or 85 Hz only |
| e | Force enable |
| D | Force enable Digital mode |
| d | Disable |
For more info read [modedb default video mode support](https://docs.kernel.org/fb/modedb.html)
+58 -54
View File
@@ -1,73 +1,77 @@
# Installation
## First Steps
## First steps
1. **Install the Screen**: Follow the manufacturer’s instructions for installing your screen. Some screens may require additional software, while others might not.
2. **Test the Screen**: Ensure your hardware is functioning correctly by testing it with RaspberryOS, Ubuntu, or your preferred distribution.
3. **Proceed to Install KlipperScreen**: Once you’ve confirmed that the screen is working, you can proceed with installing KlipperScreen.
Install the screen, following the instructions provided by the manufacturer, Some screens don't neeed extra software but some need to be installed with a script.
It's strongly recommended to test it and ensure your hardware is working with Raspbian, Ubuntu or any distro you like.
Once you stablished that the screen is working, then proceed installing KlipperScreen.
## Setup
This install process is meant for a non-desktop version of the OS for example Raspbian Lite, but it should work on other versions.
The installation script is designed for RaspberryOS Lite, but it should work on other Debian derivatives as well.
If you want to use it on a desktop (GUI version), then do `sudo systemctl set-default multi-user.target`
if it's a Raspberry Pi, you can use `sudo raspi-config` to set boot to console by choosing the following options in order:
## Auto Install
```sh
1System Options
└──S5 Boot / Auto Login
└──B1 Console
```
[KIAUH](https://github.com/dw-0/kiauh) is a tool that helps you install or upgrade Klipper, Moonraker, Mainsail, and other extensions.
## Auto install
![KIAUH Screenshot](img/install/KIAUH.png)
[KIAUH](https://github.com/th33xitus/kiauh) is a tool that helps you install or upgrade Klipper, Moonraker, Mainsail, and other extensions.
![Screenshot](img/install/KIAUH.png)
You can visit [KIAUH on GitHub](https://github.com/th33xitus/kiauh) to learn more and view its documentation.
Visit [KIAUH on GitHub](https://github.com/dw-0/kiauh) to learn more and view its documentation.
## Manual Install
Follow these steps to manually install KlipperScreen:
First install [Klipper](https://www.klipper3d.org/Installation.html) and [Moonraker](https://moonraker.readthedocs.io/en/latest/installation/).
### KlipperScreen Installation
Execute the following commands:
Clone the KlipperScreen repository and run the installation script:
```sh
cd ~/
git clone https://github.com/KlipperScreen/KlipperScreen.git
./KlipperScreen/scripts/KlipperScreen-install.sh
```
This script will install the necessary packages, create a Python virtual environment at `~/.KlipperScreen-env`, and install a systemd service file.
!!! tip
If you need a custom location for the configuration file, you can add the `-c` or `--configfile` option to the systemd file and specify the desired location.
## Moonraker Configuration
1. Ensure that the IP of the device is a trusted client in `moonraker.conf`:
```ini
[authorization]
trusted_clients:
127.0.0.1
```
Alternatively, add the [Moonraker API key](https://moonraker.readthedocs.io/en/latest/installation/#retrieving-the-api-key) to `KlipperScreen.conf`.
2. To use the update manager feature of Moonraker for KlipperScreen, add the following block to `moonraker.conf`:
```ini
[update_manager KlipperScreen]
type: git_repo
path: ~/KlipperScreen
origin: https://github.com/KlipperScreen/KlipperScreen.git
virtualenv: ~/.KlipperScreen-env
requirements: scripts/KlipperScreen-requirements.txt
system_dependencies: scripts/system-dependencies.json
managed_services: KlipperScreen
```
!!! tip
If you see warnings in other UIs, ignore them until KlipperScreen finishes installing and Moonraker is restarted.
## Printer Configuration
Add the following basic configurations to your `printer.cfg` file for correct functionality:
```ini
[virtual_sdcard]
path: ~/printer_data/gcodes
[display_status]
[pause_resume]
git clone https://github.com/jordanruthe/KlipperScreen.git
cd ~/KlipperScreen
./scripts/KlipperScreen-install.sh
```
## Macros
This script will install packages that are listed under manual install, create a python virtual environment at
`~/.KlipperScreen-env` and install a systemd service file.
You may need additional macros for the printer to function as expected. For more information, [read the macros page](macros.md).
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify
the location of your configuration file.
At this point KlipperScreen should be working, if it doesn't start then go to the [troubleshooting page](Troubleshooting.md)
## Moonraker configuration
In moonraker.conf ensure that 127.0.0.1 is a trusted client:
```py
[authorization]
trusted_clients:
127.0.0.1
```
!!! warning
`force_logins: true` requires the moonraker api key in [KlipperScreen.conf](Configuration.md)
If you wish to use the update manager feature of moonraker for KlipperScreen, add the following block to the moonraker.conf:
```py
[update_manager KlipperScreen]
type: git_repo
path: ~/KlipperScreen
origin: https://github.com/jordanruthe/KlipperScreen.git
env: ~/.KlipperScreen-env/bin/python
requirements: scripts/KlipperScreen-requirements.txt
install_script: scripts/KlipperScreen-install.sh
managed_services: KlipperScreen
```
!!! note
If you see warnings in other UIs ignore them until KlipperScreen finishes installing.
@@ -2,7 +2,7 @@
Also known as "Print Status" or the "printing panel" shows the relevant information of the current print.
![Screenshot](../img/panels/job_status.png)
![Screenshot](img/panels/job_status.png)
!!! tip
the third row shows the LCD message (`M117`)
@@ -10,19 +10,19 @@ Also known as "Print Status" or the "printing panel" shows the relevant informat
This panel has more information than it shows by default, just click/tap the corresponding the status buttons to access the extra information
## Position info
![speed_screenshot](../img/panels/job_status_speed.png)
![speed_screenshot](img/panels/job_status_speed.png)
!!! note
Layer is calculated from object height, it may not be accurate if variable layer is used
If that is the case use the Layer Progress method described in the [Quicktips](../Quicktips.md#layer-progress)
If that is the case use the Layer Progress method described in the [Quicktips](Quicktips.md#layer-progress)
## Extrusion info
![extrusion_screenshot](../img/panels/job_status_extrusion.png)
![extrusion_screenshot](img/panels/job_status_extrusion.png)
## Time info
![time_screenshot](../img/panels/job_status_time.png)
![time_screenshot](img/panels/job_status_time.png)
## Extra temperature items
By default, only extruder and bed temperatures will be available but additional items can be defined
using ["titlebar_items" in the config](../Configuration.md#printer-options)
By default only extruder and bed temperatures will be available but additional items can be defined
using ["titlebar_items" in the config](Configuration.md#printer-options)
-132
View File
@@ -1,132 +0,0 @@
Multiple instances of KlipperScreen
*Difficulty: Advanced*
This article describes different methods of adding remote desktop clients (VNC or Xserver-XSDL) that do not support installing KS directly.
If your remote device runs GNU/Linux then you should install KlipperScreen directly, instead of the methods described below.
The instances will be independent of each other and not a mirror.
## Notes on Performance
Beware that running multiple instances on the same device at the same time will consume more resources (memory and processing time)
and can be taxing on lower end hardware, in my testing even a Raspberry Pi 3A can run multiple instances of KS,
providing that it doesn't have any cameras or other advanced features.
!!! tip
You can view the system resource usage in the "System" panel of KlipperScreen or directly at the console with htop
Beware that even if the load seems okay at idle, during a print heavy dynamic loads can push the device over the threshold
and that may result in a Klipper error/failure, if it's running on the same device.
Performance will heavily depend on the devices used,
if one of the devices is connected through the network, like for example a VNC client or Android Xserver-XSDL client,
then the network will influence the response time of the interface.
## Option 1: Using the startup script method
*Advantage:* relatively easy to setup
*Disadvantage:* starting or stopping the service will affect all the instances
The default KlipperScreen service will launch the script
```sh
nano $HOME/KlipperScreen/scripts/launch_KlipperScreen.sh
```
Example script:
```sh
#!/bin/bash
/usr/bin/xinit $KS_XCLIENT &
DISPLAY=192.168.18.147:0 $KS_XCLIENT -c $HOME/.config/KlipperScreen/tablet.cfg &
wait
```
In this example the script launches a local instance for a screen connected to the host
then it launches a server for xserver-xsdl client that is running at the defined IP,
notice that the second instance uses a configuration that is specific to itself.
Dont forget to restart the service to load the changes
```sh
sudo systemctl restart KlipperScreen
```
## Option 2: Using a separate service
*Advantage:* stopping and starting the service will only affect the desired instance
*Disadvantage:* configuration and setup is more complex
Create a new service unit file
```sh
sudo nano /etc/systemd/system/KlipperScreen_tablet.service
```
Example of a service unit for an android tablet: (change the IP and username)
```ini title="KlipperScreen_tablet.service"
[Unit]
Description=KlipperScreen Tablet
StartLimitIntervalSec=0
After=systemd-user-sessions.service plymouth-quit-wait.service
ConditionPathExists=/dev/tty0
Wants=dbus.socket systemd-logind.service
After=dbus.socket systemd-logind.service
After=moonraker.service
[Service]
Type=simple
Restart=always
RestartSec=2
SupplementaryGroups=klipperscreen
# username
User=pi
WorkingDirectory=/home/pi/KlipperScreen
Environment="DISPLAY=192.168.18.147:0"
# Absolute paths are required, separate config is optional
ExecStart=/home/pi/.KlipperScreen-env/bin/python /home/pi/KlipperScreen/screen.py -c /home/pi/.config/KlipperScreen/tablet.cfg
[Install]
WantedBy=multi-user.target
```
Test your new service
```sh
sudo systemctl start KlipperScreen_tablet
```
Optional: After verifying it works, make it load when the system starts
```sh
sudo systemctl enable KlipperScreen_tablet
```
if you made a mistake in the config you'll have to reload the service unit
```sh
sudo systemctl daemon-reload
```
Add the new service to moonraker so it can be started and stopped from the UI
```sh
nano $HOME/printer_data/moonraker.asvc
```
In the example above it was `KlipperScreen_tablet`. Beware that is case sensitive
So in this case it would look something like this:
``` title="moonraker.asvc"
klipper_mcu
webcamd
MoonCord
KlipperScreen
KlipperScreen_tablet
moonraker-telegram-bot
moonraker-obico
sonar
crowsnest
octoeverywhere
```
Restart moonraker
```sh
sudo systemctl restart moonraker
```
+14 -26
View File
@@ -1,25 +1,19 @@
# Panels
### Splash Screen
![Splash_screen](img/panels/splash_screen.png)
!!! tip
The *'power on'* button will only appear if a power device exists in moonraker and that power device name
should be added to `power_devices` in the printer section of the klipperscreen configuration file
### Main Menu
![Main Menu](img/panels/main_panel.png)
### [Job Status](Panels/Job_status.md)
### [Job Status](Job_status.md)
```py
panel: job_status
```
[![Job Status](img/panels/job_status.png)](Panels/Job_status.md)
![Job Status](img/panels/job_status.png)
### [Bed Level](Panels/Screws.md)
### [Bed Level](Screws.md)
```py
panel: bed_level
```
[![Bed Level](img/panels/bed_level.png)](Panels/Screws.md)
![Bed Level](img/panels/bed_level.png)
### Bed Mesh
```py
@@ -90,11 +84,11 @@ panel: power
```
![Power](img/panels/power.png)
### Gcodes / Print
### Print
```py
panel: gcodes
panel: print
```
![Gcodes Panel](img/panels/gcodes.png)
![Print Panel](img/panels/print.png)
### Retraction
```py
@@ -108,26 +102,20 @@ panel: settings
```
![Settings](img/panels/settings.png)
### Spoolman
### System
```py
panel: spoolman
panel: system
```
![Spoolman](img/panels/spoolman.png)
![System Panel](img/panels/system.png)
### [Temperature](Panels/Temperature.md)
### [Temperature](Temperature.md)
```py
panel: temperature
```
[![Temperature](img/panels/temperature.png)](Panels/Temperature.md)
![Temperature](img/panels/temperature.png)
### Updater
```py
panel: updater
```
![Updater Panel](img/panels/updater.png)
### [Z Calibrate](Panels/Zcalibrate.md)
### [Z Calibrate](Zcalibrate.md)
```py
panel: zcalibrate
```
[![Z Calibrate](img/panels/zcalibrate.png)](Panels/Zcalibrate.md)
![Z Calibrate](img/panels/zcalibrate.png)
-61
View File
@@ -1,61 +0,0 @@
# Zcalibrate
This panel supports various modes of operation to assist in the calibration of the Z axis of the machine.
It's strongly suggested to read Klipper documentation about [Bed level](https://www.klipper3d.org/Bed_Level.html)
![Screenshot](../img/panels/zcalibrate.png)
## Buttons
* "Start" will initiate the only method available, or ask the user if multiple methods are available.
!!! note
KlipperScreen will automatically Home(`G28`) if needed
* The raise(+) and lower(-) buttons send `TESTZ Z=distance` where distance is selected in the bottom row.
* Accept will send `ACCEPT`
* Abort will send `ABORT`
## Calibration methods
### Probe (`PROBE_CALIBRATE`)
Available when a probe is defined. (BL-Touch is a probe)
KlipperScreen will try to position the probe in the correct place before sendind a `PROBE_CALIBRATE`
??? info "Search order to select location"
1. `calibrate_x_position` and `calibrate_y_position` in [KlipperScreen.conf](https://klipperscreen.readthedocs.io/en/latest/Configuration/#printer-options)
Both need to be configured, probe offsets are not applied. This is considered an override
2. Probe at the [zero reference position of the mesh](https://www.klipper3d.org/Bed_Mesh.html#configuring-the-zero-reference-position)
3. If `[safe_z_home]` is defined, those values are used. Unless `Z_ENDSTOP_CALIBRATE` is available.
In other words, only use `[safe_z_home]` if `z_virtual_endstop` is used
4. If the kinematics are `delta` probe is placed at 0, 0
5. Probe at the center of the `bed_mesh`
6. Probe at the center of the axes (`position_max` / 2)
Klipper documentation: [Calibrating probe Z offset](https://www.klipper3d.org/Probe_Calibrate.html#calibrating-probe-z-offset)
### Endstop (`Z_ENDSTOP_CALIBRATE`)
Available when a physical endstop is defined for `[stepper_z]`
Klipper documentation: [Calibrating a Z endstop](https://www.klipper3d.org/Manual_Level.html#calibrating-a-z-endstop)
### Bed mesh (`BED_MESH_CALIBRATE`)
Available when a probe is not defined and `[bed_mesh]` is defined
this mode lets you create a mesh leveling bed using the paper test in various points.
!!! warning
DO NOT adjust the bed screws while using this mode.
Adjust the screws using the [bed screws](Screws.md) panel before running this tool.
### Delta Automatic/Manual (`DELTA_CALIBRATE`)
Available when the kinematics are defined as delta.
Klipper documentation: [Delta calibration](https://www.klipper3d.org/Delta_Calibrate.html)
### Axis Twist Compensation (`AXIS_TWIST_COMPENSATION_CALIBRATE`)
Available when `[axis_twist_compensation]` is defined in the Klipper configuration.
Klipper documentation: [Axis Twist Compensation](https://www.klipper3d.org/Axis_Twist_Compensation.html)
+33 -136
View File
@@ -3,14 +3,25 @@ quick tips, without much explanation
## Hide macros, outputs or fans
As you probably already noticed, you can show and hide the gcode macros in the interface settings,
but you can also hide gcode macros by prefixing the name with an underscore.
Macros can be hidden directly from the interface in the macro settings.
```py
[gcode_macro MY_AWESOME_GCODE]
gcode:
_MY_HELPER_CODE
[gcode_macro _MY_HELPER_CODE]
gcode:
M300
```
You can also hide them and other devices by prefixing the name with an underscore.
MY_AWESOME_GCODE appears in your interface settings, _MY_HELPER_CODE not.
Another example:
Lets hide a temperature_fan:
```ini
```py
[temperature_fan fan1]
[temperature_fan _fan2]
```
@@ -18,151 +29,37 @@ Lets hide a temperature_fan:
fan1 will show in the interface, but _fan2 will be hidden.
## Thumbnails
Moved to [Thumbnails](Thumbnails.md)
## Layer Progress
Accurate layer progress as a message below the status:
* [PrusaSlicer](#prusaslicer)
* [Cura](#cura)
* [ideaMaker](#ideamaker)
* [OrcaSlicer](#orcaslicer)
PrusaSlicer/SuperSlicer > Printer Settings > Custom Gcode > After layer change Gcode
Follow this steps to provide the current layer in the printing information.
![speed_screenshot](img/panels/job_status_speed.png)
#### PrusaSlicer:
* Open PrusaSlicer
* Go to: `Printer Settings` > `Custom Gcode` > `Start Gcode`
```ini
SET_PRINT_STATS_INFO TOTAL_LAYER=[total_layer_count]
```
Printer Settings > Custom Gcode > After layer change Gcode
```ini
SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num + 1}
```
#### PrusaSlicer Layer Messages
* Open PrusaSlicer
* Go to: `Printer Settings` > `Custom Gcode` > `After layer change Gcode`
* Add this:
```ini
M117 Layer {layer_num+1}/[total_layer_count] : {filament_settings_id[0]}
```
`M117 Layer {layer_num+1}/[total_layer_count] : {filament_settings_id[0]}`
![Layer_progress](img/quicktips/PS_SS_Layer_progress.png)
Accurate layer progress in the secondary screen of the printing panel:
#### Cura
The layer number in the secondary screen of the printing panelis calculated according to object height and provided layer height.
It will be innacurate when using variable layer height, but can be fixed by providing klipper with the correct data.
Cura doesn't have a way to use this directly (the only "g-code on layer change" post-processing plugin doesn't support variables),
so the only way to work around is by adding a replacement post-processing script and a specific macro to Klipper.
To add the script to Cura, use the following steps:
* Open Cura
* Open the `Extensions` menu, then `Post processing`, and click on `Modify G-Code`
* Click the `Add Script` button, and select `Search and Replace` from the options
* On the `Search` textbox, enter this:
```
;(LAYER|LAYER_COUNT)\:(\d+)
```
* On the `Replace` textbox, enter this:
```
;\1:\2\n_CURA_SET_PRINT_STATS_INFO \1=\2
```
* Tick the `Use Regular Expressions` checkbox
* Click Close
In Klipper, add this macro to your printer.cfg:
```ini
[gcode_macro _CURA_SET_PRINT_STATS_INFO]
gcode:
{% if params.LAYER_COUNT is defined %}
SET_PRINT_STATS_INFO TOTAL_LAYER={params.LAYER_COUNT}
{% endif %}
{% if params.LAYER is defined %}
SET_PRINT_STATS_INFO CURRENT_LAYER={(params.LAYER | int) + 1}
{% endif %}
```
Then save the changes and restart Klipper.
After this, any new file sliced in Cura will tell Klipper how to handle the layer values
#### Cura Layer Messages
Install the extension: `Display Filename and Layer on LCD`
#### IdeaMaker
* Open IdeaMaker
* Got to: `Slice` > `Admin templates` > `Click on your template` > `edit`
* Select the tabs named `Gcode` > `Layer Change Gcode`
* Paste this:
```ini
SET_PRINT_STATS_INFO TOTAL_LAYER={total_layers}
SET_PRINT_STATS_INFO CURRENT_LAYER={layer_index}
```
!!! note
`{total_layers}` doesn't seem to be available in the Start gcode (at least on IdeaMaker 4.3.2)
#### IdeaMaker Layer Messages
* Open IdeaMaker
* Go to: `Slice` > `Manage templates` > `Click on your template` > `Edit`
* Select the tab named `Gcode` > `Layer Change Gcode`
* Paste this:
```ini
M117 Layer {layer_index} / {total_layers}
```
#### OrcaSlicer
* Open OrcaSlcicer
* Go to Prepare or Preview and in the printer section click `Edit Preset` > `Machine G-code`
* In `Start Gcode` add:
```ini
SET_PRINT_STATS_INFO TOTAL_LAYER=[total_layer_count]
```
* In `Layer change Gcode` add:
```ini
SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num + 1}
```
#### OrcaSlicer Layer Messages
* Open OrcaSlicer
* Go to Prepare or Preview and in the printer section click `Edit Preset` > `Machine G-code`
* Add this to "Layer Change Gcode":
```ini
M117 Layer {layer_num+1}/[total_layer_count] : {filament_settings_id[0]}
```
![Layer_progress](img/quicktips/OrcaSlicer-progress.png)
![speed_screenshot](img/panels/job_status_speed.png)
PrusaSlicer/SuperSlicer:
Printer Settings > Custom Gcode > Start Gcode
`SET_PRINT_STATS_INFO TOTAL_LAYER=[total_layer_count]`
Printer Settings > Custom Gcode > After layer change Gcode
`SET_PRINT_STATS_INFO CURRENT_LAYER={layer_num + 1}`
## Supported Macros
[Macros](macros.md)
+9 -20
View File
@@ -1,6 +1,6 @@
# Bed level
![Bed Level](../img/panels/bed_level.png)
![Bed Level](img/panels/bed_level.png)
For this panel to appear in the menu `[bed_screws]` or `[screws_tilt_adjust]` need to be defined in Klipper config (printer.cfg)
@@ -20,33 +20,22 @@ and reports the amount to be adjusted into the labels of the corner buttons.
### Why `[bed_screws]` are ignored/not used?
`[screws_tilt_adjust]` positions with offset will be used over `[bed_screws]`, because if the probe offset is changed or
the difference between `[bed_screws]` and `[screws_tilt_adjust]` wasn't calculated correctly,
the "Screws adjust" button stops working correctly.
Because if the probe offset is changed or the difference between `[bed_screws]` and `[screws_tilt_adjust]` wasn't calculated correctly,
the "Screws adjust" button stops working.
### Why the probe offset is applied to `[screws_tilt_adjust]`?
Because the corner buttons in KlipperScreen should place the nozzle above the screw to do the ["paper test"](https://www.klipper3d.org/Bed_Level.html?h=paper#the-paper-test).
It doesn't affect the function of `SCREWS_TILT_CALCULATE`, which will go to the defined positions.
Because the corner buttons in KlipperScreen should place the nozzle above the screw to do the ["paper test"](https://www.klipper3d.org/Bed_Level.html?h=paper#the-paper-test). It doesn't affect the function of `SCREWS_TILT_CALCULATE`, which will go to the defined positions.
## Is `BED_SCREWS_ADJUST` supported?
## Not supported for auto-detection
No, but you can achieve the same thing by using the corner buttons and going in a circle pattern adjusting until desired.
`BED_SCREWS_ADJUST` is just a helper that moves to the screws in sequence
This message will appear if you are using 3 or 5 screws and didn't define them in KlipperScreen.conf.
See "screw_positions" in the [printer options](https://klipperscreen.readthedocs.io/en/latest/Configuration/#printer-options)
## Limitations
The panel doesn't support more than 9 screws or grids bigger than 3x3.
## Rotation
The layout can be rotated if the screen is not directly in front of the machine.
in the printer configuration you would add screw_rotation: 90
Valid values are 0 90 180 270
## Inversion
The layout will be inverted if an axis is inverted in the move panel
The panel doesn't support more than 8 screws or screws that directly in the center of the bed.
## Is there an alternative?
@@ -1,23 +1,23 @@
# Temperature
This panel is available when there is at least one device with a temperature sensor associated,
This panel is available when there is at least one device with a temperature sensor asociated,
this includes extruders, heaters, sensors and temperature_fans.
There are 3 main modes of operation:
## Preheat
[Define profiles](../Configuration.md#preheat-options) to quickly change the target temperature of multiple selected devices.
[Define profiles](Configuration.md#preheat-options) to quickly change the target temperature of multiple selected devices.
This is the default mode when not printing.
![Preheat_screenshot](../img/panels/temperature.png)
![Preheat_screenshot](img/panels/temperature.png)
## Delta adjust
Change the target of the selected devices, the amount is selectable.
This is the default mode while printing
![Delta_screenshot](../img/panels/temperature_delta.png)
![Delta_screenshot](img/panels/temperature_delta.png)
## Direct input with keypad
Allows to set the exact temperature using the keypad.
![Keypad_screenshot](../img/panels/temperature_keypad.png)
![Keypad_screenshot](img/panels/temperature_keypad.png)
+15 -62
View File
@@ -1,80 +1,33 @@
# Theming
## Custom Printer Select Icons
To create a custom theme, create a folder in: _${KlipperScreen_Directory}/styles/_
When multiple printers are configured, you can customize their icons by placing an icon file in the following directory:
The folder name will be the theme name, in that folder create another folder named `images` this is where the icons should be placed. The icons must be SVG files and they need to have specific names that are defined in the code, use the default theme as a reference for the names or check the code.
`~/KlipperScreen/styles/printers/`
To edit colors and styles, create a css file named `style.css` you can use the contents of another theme as a reference.
- The icon file name must match the exact printer name as configured in `KlipperScreen.conf`.
- Supported formats for icons are SVG or PNG.
Example:
```sh
cp /path/to/printer_icon.svg ~/KlipperScreen/styles/printers/printer_name.svg
sudo service KlipperScreen restart
```
## Custom Themes
To create a custom theme for KlipperScreen, follow these steps:
1. **Create Theme Directory:**
- Navigate to `~/KlipperScreen/styles/`.
- Create a new folder with the desired theme name.
2. **Add Icon Images:**
- Inside the theme folder, create a subfolder named `images`.
- Place your SVG icon files here. Refer to the code or default theme for specific icon names used by KlipperScreen.
3. **Customize Styles:**
- Create a CSS file named `style.css` within your theme folder.
- Use existing themes or the default theme as a reference for CSS styles.
Example procedure for creating a theme named `mytheme`:
```sh
cd ~/KlipperScreen/styles/
# Create the directory
mkdir -p mytheme/images
# Copy required SVG icons
cp material-light/images/* mytheme/images/
# Create custom styles
echo "window { background-color: #FFFFFF; }" > style.css
```
4. **Apply the Theme:**
- After creating your theme, restart the KlipperScreen service:
```sh
sudo service KlipperScreen restart
```
- Select you theme from the list in the options.
### Example: Creating a Custom Theme
### Example 1
```sh
cd ~/KlipperScreen/styles/
cd ~/KlipperScreen/styles
mkdir -p mytheme/images
cd mytheme
cp ../default_theme/images/* images/
echo "window { background-color: #FFFFFF; }" > style.css
cp ../z-bolt/images/* images/
echo "window { background-color: red;}" > style.css
sudo service KlipperScreen restart
```
### Example: Custom Background and CSS
At this point `mytheme` should be on the list of themes, and when you select it the background should be red.
Creating a custom background from Mainsail sidebar using Z-bolt icons:
### Example 2
Creating a custom background from Mainsail sidebar and this css using Z-bolt icons
```css
/* style.css */
window {
background-image: url("/home/pi/mainsail/img/background.svg");
}
button {
background-color: rgba(0,0,0,0);
border-radius: 2em;
}
window { background-image: url("/home/pi/mainsail/img/background.svg");}
button {background-color: rgba(0,0,0,0); border-radius:2em;}
```
![Custom theme example with background](img/theming/theme_example.png)
+3 -10
View File
@@ -13,12 +13,11 @@ Recommended sizes for thumbnails:
## Select your slicer:
* [PrusaSlicer](#prusaslicer)
* [OrcaSlicer](#orcaslicer)
* [SuperSlicer](#superslicer)
* [Cura](#cura)
* [ideaMaker](#ideamaker)
### PrusaSlicer
### PrusaSlicer (2.3.0+)
In “Expert” mode PrusaSlicer has an option in the “Printer Settings” tab to activate previews.
Under General / Firmware.
@@ -26,13 +25,7 @@ Under General / Firmware.
![PrusaSlicer](img/quicktips/PrusaSlicer-thumbnails.png)
### OrcaSlicer
Usually works out of the box, the setting is in the printer settings under advanced:
![OrcaSlicer](img/quicktips/OrcaSlicer-thumbnails.png)
### SuperSlicer
### SuperSlicer (2.2.54+)
In “Expert” mode SuperSlicer has some very convenient options in the “Printer Settings” tab to activate and customize the previews.
@@ -58,7 +51,7 @@ In “Expert” mode SuperSlicer has some very convenient options in the “Prin
![Cura](img/quicktips/Cura-thumbnails.png)
### ideaMaker
### ideaMaker (4.2.1+)
1. Open the Advanced tab in the printer settings
2. Enable "GCode Thumbnails for Octoprint and Mainsail"
3. Set both Width and Height to 300
+3 -15
View File
@@ -1,18 +1,6 @@
# Translations
Translations are hosted on Weblate:
<a href="https://hosted.weblate.org/engage/klipperscreen/">
<img src="https://hosted.weblate.org/widget/klipperscreen/open-graph.png" alt="Weblate" />
</a>
Thanks to the Weblate team for supporting the Open-Source community.
## Manual way:
This is currently discouraged, but if you want you can make your changes manually
### Updating an existing translation:
## Updating an existing translation:
You can use an editor such as [poedit](https://poedit.net/) to assist in translations.
@@ -23,7 +11,7 @@ To test your translation:
In poedit go to `File -> Compile to MO`. Save it on the same folder, and restart KlipperScreen
### Adding a new Language:
## Adding a new Language:
Example using poedit
@@ -40,5 +28,5 @@ Once you have restarted KlipperScreen, select it from the list in the settings.
If you edited and recompiled, you need to restart KlipperScreen to reload the translation.
### Contributing:
## Contributing:
[Attach your translation on a GitHub issue or create a PR](Contact.md)
+131 -100
View File
@@ -1,148 +1,179 @@
# Troubleshooting
This page will have common problems and common solutions to those problems.
## First Steps
# First Steps
The first step to troubleshooting any problem is getting the cause of the error.
* Find KlipperScreen.log:
!!! warning "Important"
!!! important
This log file should be provided if you ask for support.
Depending on your setup the file could be accessible from the web interface alongside other logs
Depending on your setup the file could be accesible from the web interface alongside other logs
| Mainsail | Fluidd |
|:-------------------------------------------------------:|:---------------------------------------------------:|
| ![mainsail_logs](img/troubleshooting/logs_mainsail.png) | ![fluidd_logs](img/troubleshooting/logs_fluidd.png) |
Mainsail | Fluidd
:-:|:-:
![m_logs](img/troubleshooting/logs_mainsail.png) | ![f_logs](img/troubleshooting/logs_fluidd.png)
if you can't find it in the web interface, you will need to grab the system logs as explained below
if you can't find it in the web interface, use sftp to grab the log (for example Filezilla, WinSCP)
Located at `~/printer_data/logs`or in `/tmp/` if the former doesn't exists.
??? tip "Alternative: Using sftp to grab the logs"
It is possible to use sftp to grab the log, with an application like Filezilla or WinSCP
If KlipperScreen.log doesn't exist, run `systemctl status KlipperScreen`<br>
(or `journalctl -xe -u KlipperScreen`)
With some file-browsers like Dolphin, just type the address for example: `sftp://pi@192.168.1.105/home/`
Locate the logs at `~/printer_data/logs`or in `/tmp/` if the former doesn't exist.
## System logs
If [KlipperScreen.log](#first-steps) doesn't exist open a terminal in the host (typically from SSH) and
run this commands:
??? info "Multiple printers on the same host"
If the host is running multiple printers you may need to change `printer_data` to `printer_1_data`
Check the file `/var/log/Xorg.0.log` where you can find issues with the X server.
## Cannot open virtual Console
If you see this line in the logs:
```sh
systemctl status KlipperScreen > ~/printer_data/logs/KlipperScreen_systemctl.log
journalctl -xe -u KlipperScreen > ~/printer_data/logs/KlipperScreen_journalctl.log
cp /var/log/Xorg.0.log ~/printer_data/logs/KlipperScreen_Xorg.log
cp -n /tmp/KlipperScreen.log ~/printer_data/logs/KlipperScreen.log
xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
```
This will copy all the relevant logs to the folder described above, so they can be downloaded from the browser.
With the method described in the first section. You may need to press refresh or reload the page
* Run `cat /etc/X11/Xwrapper.config`
This should have the line `allowed_users=anybody` in it
??? tip "Alternative: inspect them directly on the terminal:"
!!! warning
Please do not copy-paste the output of the terminal when providing info for an issue,
most of the time this output will be incomplete, use the method described above
```sh
systemctl status KlipperScreen
journalctl -xe -u KlipperScreen
cat /var/log/Xorg.0.log
```
* Run `cat /etc/group | grep tty`
If your username is not listed under that line, you need to add it with the following command:
```sh
usermod -a -G tty pi
```
(if your username is not 'pi' change 'pi' to your username)
Restart KlipperScreen:
```sh
sudo service KlipperScreen restart
```
If it's still failing as a last resort add `needs_root_rights=yes` to `/etc/X11/Xwrapper.config`:
```sh
sudo bash -c "echo needs_root_rights=yes>>/etc/X11/Xwrapper.config"
```
restart KS.
## Screen shows console instead of KlipperScreen
![boot](img/troubleshooting/boot.png)
If you have multiple framebuffers, you may need to fix the X11 configuration,
list the available framebuffers and check the current one:
```sh
ls /dev/fb*
cat /usr/share/X11/xorg.conf.d/99-fbturbo.conf | grep /dev/fb
```
If you more than one, try changing it:
```sh
sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf
```
for example: change `/dev/fb0` to `/dev/fb1`
!!! abstract "If you see this line in the [system logs](#system-logs):"
```sh
xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
```
[Follow this steps](Troubleshooting/VC_ERROR.md)
Once you have saved that file, restart KlipperScreen.
```sh
sudo service KlipperScreen restart
```
!!! abstract "If you see this line in the [system logs](#system-logs):"
```sh
xinit[948]: /usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/drivers/fbturbo_drv.so: undefined symbol: shadowUpdatePackedWeak
```
[Follow this steps](Troubleshooting/FBturbo.md)
If you have multiple hdmi ports try the other one
!!! abstract "If you see this line in the [system logs](#system-logs):"
```sh
KlipperScreen-start.sh: (EE) no screens found(EE)
```
This is usually not the main cause of the error. [Start by checking the screen](Troubleshooting/Physical_Install.md)
## Screen is all white or blank or no signal
Drivers not installed or misconfigured can cause this too, continue looking the logs for more clues.
If the screen never shows the console even during startup, Then it's tipically an improperly installed screen,
follow the manufacturer instructions on how to physically connect the screen and install the proper drivers.
!!! abstract "If you see this line in the [system logs](#system-logs):"
```sh
modprobe: FATAL: Module g2d_23 not found in directory /lib/modules/6.1.21-v8+
```
This error is common on RaspberryOS when using FBturbo, it's not a related issue, it works correctly with the error present.
!!! abstract "If you see this line in the [system logs](#system-logs):"
```sh
(EE) Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices
```
[Follow this steps](Troubleshooting/Framebuffer_id.md)
[Maybe it's the wrong framebuffer](Troubleshooting/Framebuffer.md)
If you can't fix it, [try using a desktop distro as described here.](Troubleshooting/Last_resort.md)
If you want to contribute a solution: [Contact](Contact.md)
## Screen is always ***white*** / ***black*** or ***`No signal`***
If the screen never shows the console even during startup, Then it's typically an improperly installed screen.
[Follow this steps](Troubleshooting/Physical_Install.md)
## The screen shows colors or 'No signal' when idle
!!! warning
Only applicable to X11 not for Wayland
## The screen starts flashing colors or stays all blue/white or shows 'No signal' when idle
In KliperScreen settings find 'Screen DPMS' and turn it off.
Your screen doesn't seem to support turning off via software, the best you can do is to turn it all black.
![dpms](img/troubleshooting/dpms.gif)
## Touch not working on debian Bullseye
Your screen doesn't seem to support turning off via software.
Some dsi screens have issues where touch doesn't work with debian bullseye, the current fix
(at least until upstream is fixed) consist in changing the driver:
KlipperScreen will enable an internal screensaver to make it all black, and hopefully avoid burn-in.
If you find a way of turning it off, please share it: [Contact](Contact.md)
Run `raspi-config` > go to Advanced > GL Driver > select G2 and reboot.
## Touch issues
![config](img/troubleshooting/gldriver.png)
[Follow this steps](Troubleshooting/Touch_issues.md)
*Or*:
## Network panel doesn't list WI-FI networks
manually edit `/boot/config.txt` and change:
[Follow this steps](Troubleshooting/Network.md)
```sh
dtoverlay=vc4-kms-v3d
```
## I see the Desktop environment instead of KlipperScreen
to:
```sh
dtoverlay=vc4-fkms-v3d
```
and reboot, that should make the touch work, if your screen is rotated 180 degrees, then you may need to adjust
[the touch rotation](Hardware.md) as described in the Hardware page.
[Follow this steps](Troubleshooting/Desktop.md)
## OctoPrint
## Unauthorized
KlipperScreen was never intended to be used with OctoPrint, and there is no support for it.
Unauthorized means that you need add the IP of the device that runs KlipperScreen to the moonraker trusted clients
or the Moonraker api-key to klipperscreen.conf
## WiFi networks not listed (Using wpa_supplicant as backend)
This can be caused because of the user is not allowed to control the interface
* Edit `/etc/wpa_supplicant/wpa_supplicant.conf` and add this line if it's not there:
```
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
```
* Run `cat /etc/group | grep netdev`
If your username is not listed under that line, you need to add it with the following command:
```sh
usermod -a -G netdev pi
```
(if your username is not 'pi' change 'pi' to your username)
Then reboot the machine:
```sh
systemctl reboot
```
!!! tip
It's possible to just restart KlipperScreen and networking
## WiFi networks not listed (Using NetworkManager as backend)
`[wifi_nm.py:rescan()] [...] NetworkManager.wifi.scan request failed: not authorized`
If you see the above permission error in the log you may need to use polkit or disable it:
```sh
mkdir -p /etc/NetworkManager/conf.d
sudo nano /etc/NetworkManager/conf.d/any-user.conf
```
in the editor paste this:
```conf
[main]
auth-polkit=false
```
Then restart the service:
```sh
systemctl restart NetworkManager.service
```
!!! tip
It's possible to just restart KlipperScreen and NetworkManager
[Follow this steps](Installation.md#moonraker-configuration)
## Other issues
If you found an issue not listed here, or can't make it work, please provide all the log files
a description of your hw, and a description of the issue when [asking for support](Contact.md)
a description of your hw, and a description of the issue when asking for support.
-20
View File
@@ -1,20 +0,0 @@
#### Check if You Have a Desktop Environment
1. Let you device finish startup
2. At the end of the boot process look at the screen and check using this examples
| Desktop environment | Console |
|:------------------------------------------:|:--------------------------------------------:|
| ![de](../img/troubleshooting/desktop.png) | ![boot](../img/troubleshooting/boot.png) |
| Desktop environment | Console |
| ![delog](../img/troubleshooting/delog.png) | ![clilog](../img/troubleshooting/clilog.png) |
If you installed a desktop (GUI version) of the OS and want to run KlipperScreen exclusively then do:
```sh title="Boot to console / KlipperScreen"
sudo systemctl set-default multi-user.target && sudo reboot
```
to undo and go back to the desktop environment:
```sh title="Boot to the desktop"
sudo systemctl set-default graphical.target && sudo reboot
```
-22
View File
@@ -1,22 +0,0 @@
# FBturbo failing with undefined symbol
in the system [log](../Troubleshooting.md) this appears:
!!! abstract "Log"
```sh
xinit[948]: /usr/lib/xorg/Xorg: symbol lookup error: /usr/lib/xorg/modules/drivers/fbturbo_drv.so: undefined symbol: shadowUpdatePackedWeak
```
Your system doesn't seem compatible with the FBturbo driver that you have installed
Remove the fbturbo driver
```sh
sudo apt purge xserver-xorg-video-fbturbo
```
make sure the config is removed:
```sh
sudo rm /usr/share/X11/xorg.conf.d/99-fbturbo.conf
```
-71
View File
@@ -1,71 +0,0 @@
# Screen is using the wrong framebuffer
If you have multiple framebuffers, you may need to fix the X11 configuration,
list the available framebuffers and check the current one:
```sh
ls /dev/fb*
```
!!! example "Output example"
```
pi@raspberrypi ~ $ ls /dev/fb*
/dev/fb0 /dev/fb1
```
!!! failure "Critical"
if you only see one, for example `/dev/fb0` then this is not the issue. Go to [Troubleshooting](../Troubleshooting.md)
## Use fbcp to copy from one framebuffer to the other
```sh
cd
git clone https://github.com/tasanakorn/rpi-fbcp.git
cd rpi-fbcp
mkdir build
cd build
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
sudo wget -O /etc/init.d/fbcp https://gist.github.com/notro/eac0fec51cac67bb99c7/raw/4804a36459db10b17d35451d98d4573a045084be/fbcp
sudo chmod +x /etc/init.d/fbcp
sudo update-rc.d fbcp defaults
sudo reboot
```
## Manually change the framebuffer
the file specifying the framebuffer could be:
- 99-fbturbo.conf
- 99-fbusb.conf
- 99-fbdev.conf
check if one of those or similar exist with:
```sh
ls /usr/share/X11/xorg.conf.d/
```
!!! example
you found 99-fbdev.conf:
```sh
sudo nano /usr/share/X11/xorg.conf.d/99-fbdev.conf
```
``` title="99-fbdev.conf"
Section "Device"
Identifier "Allwinner A10/A13/A20 FBDEV"
Driver "fbdev"
Option "fbdev" "/dev/fb0"
Option "SwapbuffersWait" "true"
EndSection
```
since `ls /dev/fb*` returned `/dev/fb0 /dev/fb1` change it to `/dev/fb1`
Save the file, restart KlipperScreen.
```sh
sudo service KlipperScreen restart
```
-52
View File
@@ -1,52 +0,0 @@
# Troubleshooting Framebuffer Issues
Here are some solutions if this line is in the logs:
```sh
(EE) Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices
```
!!! abstract "Raspberry Pi"
This has been known to happen on RaspberryOS Bookworm Lite on Pi5.
Later versions of the OS fixed the issue.
```sh
sudo nano /etc/X11/xorg.conf.d/99-v3d.conf
```
Paste this into the file:
```sh
Section "OutputClass"
Identifier "vc4"
MatchDriver "vc4"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
```
Reboot.
!!! abstract "Generic"
This will heavily vary with different hardware. Find the correct busID and create a config like:
```sh
sudo nano /etc/X11/xorg.conf.d/99-busid.conf
```
Paste this into the file:
```sh
Section "Device"
Identifier "Card0"
Driver "fbdev"
BusID "pci:1:0:0"
EndSection
```
Where the busID in this example is the first pci card. You will have to find the identifier and id of the video output device using tools like:
```sh
lspci
```
Or sometimes with:
```sh
lshw
```
If you find a solution not listed here, please consider contributing with the information.
-28
View File
@@ -1,28 +0,0 @@
# Last Resort to Make the Screen Work
If your screen never shows the console or bootup text during startup, it is typically due to an improperly installed screen. See [Physical Install Issues](Physical_Install.md) for more information.
![Boot Screen](../img/troubleshooting/boot.png)
If the screen shows the bootup text but ends with a blinking cursor or login prompt, and no matter what you tried in [Troubleshooting](../Troubleshooting.md) you can't make it work, then follow these steps:
1. **Install a Distro with a Desktop Environment**
[Click to learn how to check](./Desktop.md)
2. **Ensure Proper Functionality**
Make sure the screen is working properly, including both display and touch functionality.
3. **Deactivate the Desktop Environment for KlipperScreen**
To allow KlipperScreen to run exclusively, enter the following command in a terminal and press enter:
```sh
sudo systemctl set-default multi-user.target && sudo reboot
```
4. **Reboot and Install KlipperScreen**
Wait for the system to reboot and then proceed to install KlipperScreen.
If it still doesn't work, or if you did something else to make it work and want to share your solution:
[Contact Us](../Contact.md)
Remember to share the logs, as they are crucial for troubleshooting.
-54
View File
@@ -1,54 +0,0 @@
# Network
The network panel relies on Network-Manager for its operation.
!!! info "Note for Forks"
The network panel's behavior and dependencies may differ. Please refer to your specific fork documentation or support resources for instructions tailored to your setup.
## Loss of Connection After Installing Network-Manager
If you lose network connection after installing Network-Manager, follow these steps to reconnect:
### Reconnect using KlipperScreen
- **Go to the network panel in KlipperScreen:**
- Access the network panel in KlipperScreen and select your Wi-Fi network to reconnect.
!!! info "Alternative: using the console"
- **Option 1: Switch to a local console with keyboard:**
1. Use `Ctrl + Alt + F1` (or other function keys up to F6) to access a virtual terminal.
2. Log in and run `nmtui` to manage Wi-Fi connections directly from the console.
- **Option 2: Connect a LAN cable for SSH access:**
1. Use SSH to remotely connect to your system.
2. Run `nmtui` to manage your network connections.
## Wi-Fi networks not listed
The initial scan may take a while, first be patient before assuming it's an issue. and check with other tools like `nmtui`
## Permission error
Usually permissions are set with the installer, try to update and then re-run the installer and reboot
???+ "Alternative workaround for network-manager not having permissions"
```sh
mkdir -p /etc/NetworkManager/conf.d
sudo nano /etc/NetworkManager/conf.d/any-user.conf
```
in the editor paste this:
```ini
[main]
auth-polkit=false
```
Then restart the service (or reboot):
```sh
systemctl restart NetworkManager.service
systemctl restart KlipperScreen.service
```
-26
View File
@@ -1,26 +0,0 @@
# Physical installation issues
If the screen never shows the console even during startup, Then it's typically an improperly installed screen,
!!! important
It is advised follow the manufacturer instructions on how to physically connect the screen and install the proper drivers.
## Cable issues
* Check that the cable is inserted properly:
it shouldn't be loose, and in the case of ribbon cables like DSI make sure the contacts face the right way
* If the touchscreen is connected via USB, try another port if available,
if you are using a HUB try connecting the touch directly without the HUB.
* If the board has more than one HDMI try the other port
## Driver issues
Some screens need drivers installed the most common cases are:
### Waveshare
* [Waveshare Wiki](https://www.waveshare.com/wiki)
* [repo LCD-show](https://github.com/waveshare/LCD-show)
### Goodtft (generic/clones)
* [Goodtft Wiki](http://www.lcdwiki.com)
* [repo LCD-show](https://github.com/goodtft/LCD-show)
-158
View File
@@ -1,158 +0,0 @@
# Screen rotation
Configure the server to start in the desired orientation, there are many ways to achieve this,
here are some examples:
!!! warning
Rotation is handled by the OS and not by KlipperScreen,
if you can't rotate your screen it's usually an issue with the OS configuration
## Examples of rotation
???+ example "Universal xorg configuration"
#### Universal xorg configuration
Find the identifier use xrandr
```sh
DISPLAY=:0 xrandr
```
it will output something like:
```
Screen 0: minimum 320 x 200, current 1024 x 600, maximum 8192 x 8192
HDMI-1 connected primary 1024x600+0+0 (normal left inverted right x axis y axis) 800mm x 450mm
```
Take not that the screen is `HDMI-1` (it could be `HDMI-A-1` or many other names)
Create /usr/share/X11/xorg.conf.d/90-monitor.conf
```bash
sudo nano /usr/share/X11/xorg.conf.d/90-monitor.conf
```
Paste this section modifying the options to suit your needs:
```kconfig title="90-monitor.conf"
Section "Monitor"
Identifier "HDMI-1"
# This identifier would be the same as the name of the connector printed by xrandr
# for example "DVI-I-1 connected primary" means that the identifier is "DVI-I-1"
# another example "Unknown19-1 connected primary" some GPIO screens identify as Unknown19
Option "Rotate" "left"
# Valid rotation options are normal,inverted,left,right
Option "PreferredMode" "1920x1080"
# May be necessary if you are not getting your preferred resolution.
EndSection
```
Save the file and restart KlipperScreen.
```bash
sudo service KlipperScreen restart
```
if KlipperScreen doesn't restart:
```bash
sudo reboot
```
you may have to adjust the [touch rotation](../Touch_issues/#touch-rotation-and-matrix)
???+ example "Raspberry Pi using kernel cmdline"
#### Raspberry Pi using kernel cmdline
To set screen orientation when in console mode, you will need to edit the kernel command-line
to pass the required orientation to the system.
```bash
sudo nano /boot/firmware/cmdline.txt
```
To rotate by 90 degrees clockwise, add the following to the cmdline, making sure everything is on the same line,
do not add any carriage returns. Possible rotation values are 0, 90, 180 and 270.
For example a DSI screen:
```bash
video=DSI-1:800x480@60,rotate=90
```
To find the identifier on a terminal run:
```bash
grep -H . /sys/class/drm/card*-*/status | grep :connected
```
you will get somthing like:
```bash
/sys/class/drm/card0-HDMI-A-1/status:connected
```
where HDMI-A-1 would be the identifier
in this case the identifier is HDMI-1 and a simple cmdline arg would be something like:
```bash
video=HDMI-A-1:1024x600@60
```
To apply changes do a reboot:
```bash
sudo reboot
```
[Read the official docs for more info](https://www.raspberrypi.com/documentation/computers/config_txt.html)
[Raspberry Display docs](https://www.raspberrypi.com/documentation/accessories/display.html)
???+ example "Using a dtoverlay config on a Raspberry Pi"
#### Using a dtoverlay config on a Raspberry Pi
In /boot/config.txt (or /boot/firmware/config.txt)
with some display you can add rotate, like this example for a 3.5"
```bash
dtoverlay=waveshare35b-v2,rotate=270,drm,speed=30000000,fps=60
```
??? example "Raspberry Pi legacy mode (works with vc4-fkms-v3d)"
#### Raspberry Pi legacy mode (works with vc4-fkms-v3d)
add to config.txt
```bash
display_lcd_rotate=2
```
To apply changes do a reboot:
```bash
sudo reboot
```
!!! warning
At the moment of writing Pi4 didn't support 90 and 270 degrees with this method, [see the official docs](https://www.raspberrypi.com/documentation/computers/config_txt.html#display_hdmi_rotate)
| Value | result |
| ---------- | ---------- |
| 0 | no rotation |
| 1 | rotate 90 degrees clockwise |
| 2 | rotate 180 degrees clockwise |
| 3 | rotate 270 degrees clockwise |
| 0x10000h | horizontal flip |
| 0x20000 | vertical flip |
[Read the official docs for more info](https://www.raspberrypi.com/documentation/computers/config_txt.html)
??? example "Using a screen installed with goodtft-LCD-show"
#### Using a screen installed with goodtft-LCD-show
```bash
cd LCD-show/
sudo ./rotate.sh 90
```
??? example "Using Waveshare screen that is installed with LCD-show"
#### Using Waveshare screen that is installed with LCD-show
```bash
cd LCD-show/
sudo ./LCD43-show 270 lite
```
## Touchscreen touch rotation
[See touch rotation](./Touch_issues.md#touch-rotation-and-matrix)
-246
View File
@@ -1,246 +0,0 @@
# Touchscreen issues
Contents:
* [Touch not working](#touch-not-working)
* [Touch rotation and matrix](#touch-rotation-and-matrix)
* [Touch calibration](#touch-calibration)
Beware that this document focuses on RaspberryOS but most of it should apply to any other Debian based distros
## Touch not working
If the screen is connected over USB, the cable may cause issues.
For that, please see [this guide](Physical_Install.md#cable-issues).
??? abstract "DSI screens touch not working on RaspberryOS / MainsailOS version Debian 11 Bullseye"
Some DSI screens have issues where touch doesn't work with the default configuration.
The current workaround/temporary fix involves changing the kernel driver module used for these displays.
`sudo nano /boot/config.txt` and change
```sh
dtoverlay=vc4-kms-v3d
```
to
```sh
dtoverlay=vc4-fkms-v3d
```
Close the nano editor using `ctrl`+`x` (exit), then `y` for yes (save).
**Reboot** to apply changes. `sudo reboot`
If that doesn't fix it, you can try commenting these lines out, resulting in:
```sh
# dtoverlay=vc4-kms-v3d
# max_framebuffers=2
```
**Reboot** to apply changes. `sudo reboot`
## Touch rotation and matrix
If the touch works but registers touch input in a different location from the input, then you may need to apply an input transformation matrix.
First you will need your device name. On a terminal, run:
```sh
DISPLAY=:0 xinput
```
??? tip "Alternative"
```
libinput list-devices
```
!!! note
requires libinput-tools
```
sudo apt install libinput-tools
```
Output:
```text
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ADS7846 Touchscreen id=6 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
```
In this case the device is the ADS7846 Touchscreen, yours may be different
You can test a change by running:
```sh
DISPLAY=:0 xinput set-prop "<device name>" 'Coordinate Transformation Matrix' <matrix>
```
!!! example
```sh
DISPLAY=:0 xinput set-prop "ADS7846 Touchscreen" 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
```
Where the matrix can be one of the following options:
| Rotation | Matrix |
|-----------------------------------------|-----------------------|
| 0° | `1 0 0 0 1 0 0 0 1` |
| 90° Clockwise | `0 -1 1 1 0 0 0 0 1` |
| 90° Counter-Clockwise | `0 1 0 -1 0 1 0 0 1` |
| 180° (Inverts X and Y) | `-1 0 1 0 -1 1 0 0 1` |
| invert Y | `-1 0 1 1 1 0 0 0 1` |
| invert X | `-1 0 1 0 1 0 0 0 1` |
| expand to twice the size horizontally | `0.5 0 0 0 1 0 0 0 1` |
To make the calibration permanent read [Save touch calibration](#save-touch-calibration)
## Touch calibration
This is optional, and you should only do it if you are having problems.
Download and build xtcal:
```sh
sudo apt-get install libxaw7-dev libxxf86vm-dev libxft-dev
cd
git clone https://github.com/KurtJacobson/xtcal
cd xtcal
make
cd ..
```
First you will need your touchscreen device name. On a terminal, run:
```sh
DISPLAY=:0 xinput
```
??? tip "Alternative"
```
libinput list-devices
```
!!! note
requires libinput-tools
```
sudo apt install libinput-tools
```
Output:
```text
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ADS7846 Touchscreen id=6 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
```
In this case the device is the ADS7846 Touchscreen, yours may be different
Reset the old calibration: (set the 0° rotation matrix: 1 0 0 0 1 0 0 0 1)
```sh
DISPLAY=:0 xinput set-prop "ADS7846 Touchscreen" 'Coordinate Transformation Matrix' 1 0 0 0 1 0 0 0 1
```
Run the calibrator - if it's not fullscreen cancel with `ctrl`+`c` and adjust geometry
```sh
DISPLAY=:0 xtcal/xtcal -geometry 480x320
```
!!! important
KlipperScreen or a desktop environment should be on the screen to launch the calibrator
Touch the center of the crosses in order, they should turn white.
![xtcal_preview](../img/troubleshooting/xtcal.png)
### Test the calibration
Copy the output of the calibration and test it, For example:
```sh
DISPLAY=:0 xinput set-prop "ADS7846 Touchscreen" 'Coordinate Transformation Matrix' -0.016267 -0.952804 0.978336 -1.010164 0.065333 0.998316 0 0 1
```
if it's not correct reset the matrix and run xtcal again.
## Save touch calibration
modify `/etc/udev/rules.d/51-touchscreen.rules`:
```sh
sudo nano /etc/udev/rules.d/51-touchscreen.rules
```
```sh title="51-touchscreen.rules"
ACTION=="add", ATTRS{name}=="<device name>", ENV{LIBINPUT_CALIBRATION_MATRIX}="<matrix>"
```
Close the nano editor using `ctrl`+`x` (exit), then `y` for yes (save).
```sh
sudo reboot
```
!!! example
```sh
sudo nano /etc/udev/rules.d/51-touchscreen.rules
```
```sh title="51-touchscreen.rules"
ACTION=="add", ATTRS{name}=="ADS7846 Touchscreen", ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1 0 0 1"
```
Close the nano editor using `ctrl`+`x` (exit), then `y` for yes (save).
```sh
sudo reboot
```
!!! example "Alternative Example"
As an alternative **if the above doesn't work**:
determine the touchscreen driver (usually libinput):
```bash
cat /var/log/Xorg.0.log
```
```bash title="example of /var/log/Xorg.0.log"
...
(II) Using input driver 'libinput' for 'ADS7846 Touchscreen'
...
```
if it says `evdev` instead, then change `libinput` to `evdev` below, both in the filename and in the file
```bash
sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
```
```sh title="40-libinput.conf"
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "TransformationMatrix" "0 -1 1 1 0 0 0 0 1"
EndSection
```
!!! note
the number of the filename determines the order of loading, if you have issues
check if there are other files overriding your config or just use 99-touch_calibration.conf as a name.
Close the nano editor using `ctrl`+`x` (exit), then `y` for yes (save).
```sh
sudo reboot
```
For more in-depth guidance on using Coordinate Transformation Matrices:
* [Ubuntu wiki InputCoordinateTransformation](https://wiki.ubuntu.com/X/InputCoordinateTransformation)
* [Libinput docs](https://wayland.freedesktop.org/libinput/doc/1.9.0/absolute_axes.html)
-39
View File
@@ -1,39 +0,0 @@
# Cannot open virtual Console
If you see this line in the [log](../Troubleshooting.md):
!!! abstract "Log"
```sh
xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
```
* Run `cat /etc/X11/Xwrapper.config`
This should have the line `allowed_users=anybody` in it
* Run `cat /etc/group | grep tty`
If your username is not listed under that line, you need to add it with the following command:
```sh
usermod -a -G tty pi
```
(if your username is not 'pi' change 'pi' to your username)
Restart KlipperScreen:
```sh
sudo service KlipperScreen restart
```
If it's still failing:
add `needs_root_rights=yes` to `/etc/X11/Xwrapper.config`:
```sh
sudo bash -c "echo needs_root_rights=yes>>/etc/X11/Xwrapper.config"
```
Restart KlipperScreen:
```sh
sudo service KlipperScreen restart
```
-36
View File
@@ -1,36 +0,0 @@
# Updating
## Using Moonraker update manager
!!! info
This method will not work if KlipperScreen and Moonraker are on different Hosts
For this to work, KlipperScreen should be added to moonraker.conf as explained in the installation instructions.
[moonraker-configuration](Installation.md/#moonraker-configuration)
Then you can update using the System panel:
![system-panel-screenshot](img/panels/system.png)
or from any UI that supports updating from moonraker.
## Using KIAUH
Same as in the installation instructions, but select update instead of install
![KIAUH-screenshot](img/install/KIAUH.png)
## Manual update
```sh
cd ~/KlipperScreen
git pull
source ~/.KlipperScreen-env/bin/activate
pip --disable-pip-version-check install -r ~/KlipperScreen/scripts/KlipperScreen-requirements.txt
sudo service KlipperScreen restart
deactivate
```
-85
View File
@@ -1,85 +0,0 @@
# VNC
This article describes how to use KlipperScreen through a remote connection.
!!! warning
The experience may not be equal to run KlipperScreen natively.
Depending on the device or the network you may encounter performance degradation or other issues.
## On the Host device:
The host device could be for example a Raspberry Pi
1. [First install KlipperScreen](Installation.md)
2. Install a vnc server package, for example:
```bash
sudo apt install tigervnc-standalone-server
```
3. Create `~/KlipperScreen/scripts/launch_KlipperScreen.sh`:
```bash
#!/bin/bash
# Use display 10 to avoid clashing with local X server, if any
Xtigervnc -rfbport 5900 -noreset -AlwaysShared -SecurityTypes none :10&
DISPLAY=:10 $KS_XCLIENT&
wait
```
!!! tip
To change resolution add: `-geometry 1280x720` to the arguments of Xtigervnc
4. Make the script executable
```bash
chmod +x ~/KlipperScreen/scripts/launch_KlipperScreen.sh
```
5. Restart KlipperScreen or reboot the system:
```bash
sudo systemctl restart KlipperScreen.service
```
## On the remote device:
Install a VNC viewer and configure it to the ip of the host.
??? example "Example using an iPad"
#### Example using an iPad
* Install a VNC viewer for example: `RealVNC Viewer: Remote Desktop`
* Open the VNC viewer app
* Press "+" button at the top right
* Enter IP address of your print host.
* Press "Save"
* Select "Interaction", select "Touch panel", go back
* Press "Done"
* Double-click on an icon with IP address you have just added.
* VNC client will complain about unencrypted connection. Disable the warning and say "Connect"
* Use or skip tutorial
* Press the "Pin" icon to hide the panel.
##### Prevent unwanted rotation of UI
* Go to `Settings` > `General` > Set `Use side switch to` to `Lock Rotation`
##### Avoid accidentally switching between apps
* Go to `Restrictions` > Set passcode > Enable restrictions.
* Open
* Triple-click "Home" button
* Guided access pops up
* Press "Start"
* Now iPad is locked to VNC viewer until "Guided access" mode is disabled by triple-clicking "Home" button and entering the password.
??? example "Example using an Android device"
#### Example using an Android device
* Install a VNC viewer for example: `RealVNC Viewer: Remote Desktop`
* Open the VNC viewer app
* Press "+" button at the right
* Enter IP address of your print host.
* Press "Save"
* Double-click on an icon with name or IP address you have just added.
* VNC client may complain about unencrypted connection. Disable the warning and say "Connect"
##### Prevent unwanted rotation of UI
* Lock the rotation using the buttons in the notification bar or in device Settings > Screen > Disable "Rotate automatically"
It's recommended to set Display timeout to never:
Also for X11 installs turn off DPMS:
![disable_dpms_poweroff](img/disable_dpms_poweroff.png)
+44
View File
@@ -0,0 +1,44 @@
# Zcalibrate
This panel supports various modes of operation to assist in the calibration of the Z axis of the machine.
It's strongly suggested to read Klipper documentation about [Bed level](https://www.klipper3d.org/Bed_Level.html)
![Screenshot](img/panels/zcalibrate.png)
## Buttons
* "Start" will initiate the only method available, or ask the user if multiple methods are available.
!!! note
KlipperScreen will home if needed and move to the middle of the bed,
but the location can be configured in [KlipperScreen.conf](https://klipperscreen.readthedocs.io/en/latest/Configuration/#printer-options)
* The raise(+) and lower(-) buttons send `TESTZ Z=distance` where distance is selected in the bottom row.
* Accept will send `ACCEPT`
* Abort will send `ABORT`
## Calibration methods
### Endstop (`Z_ENDSTOP_CALIBRATE`)
Available when an physical endstop is defined for `[stepper_z]`
See Klipper documentation: [Calibrating a Z endstop](https://www.klipper3d.org/Manual_Level.html#calibrating-a-z-endstop)
### Probe (`PROBE_CALIBRATE`)
Available when a probe is defined. (BL-Touch is a probe)
See Klipper documentation: [Calibrating probe Z offset](https://www.klipper3d.org/Probe_Calibrate.html#calibrating-probe-z-offset)
### Bed mesh (`BED_MESH_CALIBRATE`)
Available when a probe is not defined and `[bed_mesh]` is defined
this mode lets you create a mesh leveling bed using the paper test in various points.
!!! warning
DO NOT adjust the bed screws while using this mode.
Adjust the screws using the [bed screws](Screws.md) panel before running this tool.
### Delta Automatic/Manual (`DELTA_CALIBRATE`)
Available when the kinematics are defined as delta.
See Klipper documentation: [Delta calibration](https://www.klipper3d.org/Delta_Calibrate.html)
!!! note
KlipperScreen will automatically Home(`G28`) if needed
-40
View File
@@ -1,40 +0,0 @@
Only breaking changes will be listed here.
#### [2024_05_24](https://github.com/KlipperScreen/KlipperScreen/commit/524aa0e7dc2b27c93534d356ba19963b793f38d8)
* Drop python 3.7 support, last version for it is v0.4.1: `git reset --hard v0.4.1`
* Drop old WiFi manager, only maintain sdbus-networkmanager
#### [2024_01_26](https://github.com/KlipperScreen/KlipperScreen/commit/9d0e4b841f905f0034a7c6fefefcf041e38b90a3)
* Deprecated old ~/klipper_config folder users need to place the configfile
in ~/printer_data/config, ~/.config/KlipperScreen, or directly in the repo
#### [2023 10 08](https://github.com/KlipperScreen/KlipperScreen/commit/b6199a4f24beb02dc0f8956f60c88e3ba3468927)
* Deprecated [bed_screws] and [z_calibrate_position] sections those configs should go in [printer name]
#### [2023 07 23](https://github.com/KlipperScreen/KlipperScreen/commit/8053e97d1041f136118d40669442e910df6cf186)
* Deprecated `camera_url` option of printer, the camera config is read from moonraker
#### [2022 03 21](https://github.com/KlipperScreen/KlipperScreen/commit/bc34b3c8d6761c27a0b0c62fc4dfa11442b417f6)
* Default configuration is now merged again.
Fixing [2021 05 20](https://github.com/KlipperScreen/KlipperScreen/commit/eb801486928bf02709033dcbc5f0a45ca43b23c1)
#### [2022 03 10](https://github.com/KlipperScreen/KlipperScreen/commit/490dc929bd11e3c4200b999ce7204d84fa0bc184)
* The "Power On Printer" button now requires power_devices under the printer section in KlipperScreen.conf
the power_devices allowed are those defined in the config of moonraker of the printer
The "Power" panel will be in the Menu if there are power devices found
#### [2022 03 01](https://github.com/KlipperScreen/KlipperScreen/commit/49ab84e8d51535d3469d97fdee53099cca6abc39)
* The "Power On Printer" button now requires that the printer name in KlipperScreen.conf
and the power device in moonraker.conf to have the same name.
The "Power" panel will be in the Menu if there are power devices found
#### [2022 01 11](https://github.com/KlipperScreen/KlipperScreen/commit/8a8c6c064cc6d097b1b34a5c42b4001367e545a6)
* The Preheat panel has been deprecated in favor of an all-in-one Temperature panel
Remove preheat panel from your Klipperscreen.conf or replace the occurrences of preheat with temperature
#### [2021 05 20](https://github.com/KlipperScreen/KlipperScreen/commit/eb801486928bf02709033dcbc5f0a45ca43b23c1)
* Default configuration is not merged if a user configuration is set for a specific option
For instance, if `menu __main` is user defined, the main menu will not have any defaults.
-1
View File
@@ -1 +0,0 @@
../CHANGELOG.md
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 356 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 632 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

+2 -24
View File
@@ -1,6 +1,6 @@
# KlipperScreen
KlipperScreen is a touchscreen GUI that interfaces with [Klipper](https://github.com/Klipper3d/klipper) via [Moonraker](https://github.com/arksine/moonraker). It can switch between multiple printers to access them from a single location, and it doesn't even need to run on the same host, you can install it on another device and configure the IP address to access the printer.
KlipperScreen is a touchscreen GUI that interfaces with [Klipper](https://github.com/kevinOConnor/klipper) via [Moonraker](https://github.com/arksine/moonraker). It can switch between multiple printers to access them from a single location, and it doesn't even need to run on the same host, you can install it on another device and configure the IP address to access the printer.
### Required Hardware
@@ -24,26 +24,4 @@ Job Status
KlipperScreen was inspired by [OctoScreen](https://github.com/Z-Bolt/OctoScreen/) and the need for a touchscreen GUI that
will natively work with [Klipper](https://github.com/klipper3d/klipper) and [Moonraker](https://github.com/arksine/moonraker).
### About the project
KlipperScreen has been created and maintained by Jordan Ruthe from 2020 to 2021
Donate to Jordan: [Patreon](https://www.patreon.com/klipperscreen) [Ko-fi](https://ko-fi.com/klipperscreen)
The current maintainer is Alfredo Monclus (alfrix) from 2021 onwards
Donate to Alfredo: [Ko-fi](https://ko-fi.com/alfrix)
thanks to all the [contributors](https://github.com/KlipperScreen/KlipperScreen/graphs/contributors) who helped along the way.
### Sponsors
| | Thank you for sponsoring KlipperScreen and the open source community. |
| - | - |
| ![LDO](img/sponsors/LDO.png) | [LDO](https://ldomotors.com/) |
| ![YUMI](img/sponsors/YUMI.png) | [YUMI](https://wiki.yumi-lab.com/) |
[Changelog](Changelog.md)
+18 -267
View File
@@ -1,289 +1,40 @@
# Macros
## Recommended
!!! note
If you have already installed other UIs then you may have these macros already, and it's usually asked by KIAUH
None of the following macros are strictly required for KlipperScreen, but they provide the toolhead parking at pause and cancel.
These can be assumed sane defaults, but should be checked and modified to your own needs.
### Pause
```yaml+jinja title="printer.cfg"
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL
```
### Resume
```yaml+jinja title="printer.cfg"
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
{% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
```
### Park
```yaml+jinja title="printer.cfg"
[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
variable_extrude: 1.0
gcode:
##### set park position for x and y #####
# default is your max position from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set z_park_delta = 2.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - z_park_delta) %}
{% set z_safe = z_park_delta %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E-{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G91
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
```
### Cancel
```yaml+jinja title="printer.cfg"
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_park: True
gcode:
## Move head and retract only if not already in the pause state and park set to true
{% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
```
# Supported Macros
## Extrude Panel
### LOAD_FILAMENT / UNLOAD_FILAMENT
Load and Unload Filament macros are used in the Extrude-Panel if it is available.
The selected speed is transferred to this macro.
The following example macros show how this can be used in the macro.
These macros are used in the Extrude panel `Load` and `Unload` buttons. and they will be hidden from the macros panel.
The selected speed in the panel is transferred as a parameter.
The following examples show how this can be used:
```yaml+jinja title=" printer.cfg"
```jinja
[gcode_macro LOAD_FILAMENT]
variable_load_distance: 50
variable_purge_distance: 25
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %}
SAVE_GCODE_STATE NAME=load_state
M300 # beep
G91
G92 E0
G1 E{load_distance} F{max_velocity} # fast-load
G1 E{purge_distance} F{speed} # purge
G1 E350 F{max_velocity} # fast-load
G1 E25 F{speed} # purge
M300
M300
RESTORE_GCODE_STATE NAME=load_state
```
!!! warning
`variable_load_distance` will depend on the printers distance from the extruder to the nozzle.
For printers with long bowden tubes you may have to increase the extrude only distance in the configfile
```ini title=" printer.cfg"
[extruder]
max_extrude_only_distance: 600 # default is 50mm
```
```yaml+jinja title=" printer.cfg"
```jinja
[gcode_macro UNLOAD_FILAMENT]
variable_unload_distance: 50
variable_purge_distance: 25
gcode:
{% set speed = params.SPEED|default(300) %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %}
{% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity %}
SAVE_GCODE_STATE NAME=unload_state
G91
M300 # beep
G92 E0
G1 E{purge_distance} F{speed} # purge
G1 E-{unload_distance} F{max_velocity} # fast-unload
G1 E25 F{speed} # purge
G1 E-420 F{max_velocity} # fast-unload
M300
M300
RESTORE_GCODE_STATE NAME=unload_state
```
if it loads too fast and your extruder can't keep up, you should adjust the `max_extrude_only_velocity` in `printer.cfg`
## Hidden by the interface
All gcode_macros with the attribute `rename_existing` are hidden , because these are default Klipper Gcodes
and these should be implemented in KlipperScreen itself with buttons already.
[This is the same behaviour of other UIs](https://docs.mainsail.xyz/overview/features/hide-macros-outputs-or-fans#macros-with-rename_existing)
[LOAD_FILAMENT and UNLOAD_FILAMENT are also hidden](#load_filament-unload_filament)
## Hide Macros
Macros can be completely hidden in the interface by prefixing the name with an underscore.
```yaml+jinja title=" printer.cfg"
[gcode_macro MY_AWESOME_GCODE]
gcode:
_MY_HELPER_CODE
[gcode_macro _MY_HELPER_CODE]
gcode:
M300
```
`MY_AWESOME_GCODE` appears in your interface settings, but `_MY_HELPER_CODE` does not.
## Prompts
It allows macros in Klipper to trigger dialog prompts to interact with the Firmware and will enable
the user to choose between options or to close the dialog again in case it's no longer needed.
!!! warning
This feature needs the `[respond]` module of Klipper.
So please check if this is enabled in your Klipper config.
### Supported Macro prompt commands
Begin the prompt and set a title:
```yaml+jinja title="Start"
RESPOND TYPE=command MSG="action:prompt_begin My Prompt"
```
Add a button:
`prompt_button` or `prompt_footer_button`
The options are label | gcode | style
Supported styles: primary, secondary, info, warning, error
```yaml+jinja title="Add a button"
RESPOND TYPE=command MSG="action:prompt_button button_text|RESPOND MSG=test|info"
```
!!! info
Only 4 footer buttons are allowed, the rest will not show due to screen space concerns
Show the prompt on the screen:
```yaml+jinja title="Show"
RESPOND TYPE=command MSG="action:prompt_show"
```
Optional: Close the Prompt:
```yaml+jinja title="Close"
RESPOND TYPE=command MSG="action:prompt_end"
```
Groups:
Footer buttons will be displayed on the same row,
but regular buttons will default to 1 per row,
to display them in the same row group them:
```yaml+jinja title="Group Start"
RESPOND TYPE=command MSG="action:prompt_button_group_start"
```
add buttons and then:
```yaml+jinja title="Group End"
RESPOND TYPE=command MSG="action:prompt_button_group_end"
```
### Examples
```yaml+jinja
[gcode_macro SHOW_PROMPT]
gcode:
RESPOND TYPE=command MSG="action:prompt_begin My Prompt"
RESPOND TYPE=command MSG="action:prompt_text This is an example of a prompt"
RESPOND TYPE=command MSG="action:prompt_button primary|G28|primary"
RESPOND TYPE=command MSG="action:prompt_button secondary|RESPOND MSG=test|secondary"
RESPOND TYPE=command MSG="action:prompt_button info|RESPOND MSG=test #2|info"
RESPOND TYPE=command MSG="action:prompt_button warning|RESPOND MSG=test #3|warning"
RESPOND TYPE=command MSG="action:prompt_show"
```
![Prompt_1](img/macros/Prompt_1.png)
```yaml+jinja
[gcode_macro SHOW_PROMPT_2]
gcode:
RESPOND TYPE=command MSG="action:prompt_begin Nevermind just close this >>>"
RESPOND TYPE=command MSG="action:prompt_text Do you want to load a new filament?"
RESPOND TYPE=command MSG="action:prompt_footer_button Load|LOAD_FILAMENT"
RESPOND TYPE=command MSG="action:prompt_footer_button Unload|UNLOAD_FILAMENT|error"
RESPOND TYPE=command MSG="action:prompt_show"
```
![Prompt_2](img/macros/Prompt_2.png)
## KlipperScreen actions
!!! warning
this should be considered experimental
Show a panel:
```
RESPOND TYPE=command MSG="action:ks_show extrude"
```
Show a menu with items:
!!! note
you need to escape double quotes because they are used by MSG
```
RESPOND TYPE=command MSG="action:ks_show menu items=[{'save': {'name': 'Home', 'icon': 'home', 'panel': None, 'method': 'printer.gcode.script', 'enable': 'True', 'params': '{\"script\": \"G28\"}', 'style': None, 'confirm': None}}]"
```
-27
View File
@@ -1,27 +0,0 @@
img {
display: block;
margin: 0 auto;
}
.md-typeset .md-typeset__table {
display: block;
}
.md-typeset__table table:not([class]) {
display: table;
}
h2, h3, h4 {
padding: 0.5em 0;
text-align: center;
background-color: rgba(0, 0, 0, 0.5);
}
.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
vertical-align: middle;
}
.md-typeset table img {
margin: 0;
display: inline-block;
}
+36 -12
View File
@@ -1,16 +1,36 @@
class KlippyGcodes:
HOME = "G28"
HOME_XY = "G28 X Y"
Z_TILT = "Z_TILT_ADJUST"
QUAD_GANTRY_LEVEL = "QUAD_GANTRY_LEVEL"
MOVE = "G1"
MOVE_ABSOLUTE = "G90"
MOVE_RELATIVE = "G91"
EXTRUDE_ABS = "M82"
EXTRUDE_REL = "M83"
SET_EXT_TEMP = "M104"
SET_BED_TEMP = "M140"
SET_EXT_FACTOR = "M221"
SET_FAN_SPEED = "M106"
SET_SPD_FACTOR = "M220"
PROBE_CALIBRATE = "PROBE_CALIBRATE"
Z_ENDSTOP_CALIBRATE = "Z_ENDSTOP_CALIBRATE"
TESTZ = "TESTZ Z="
ABORT = "ABORT"
ACCEPT = "ACCEPT"
@staticmethod
def set_bed_temp(temp):
return f"M140 S{temp}"
return f"{KlippyGcodes.SET_BED_TEMP} S{temp}"
@staticmethod
def set_ext_temp(temp, tool=0):
return f"M104 T{tool} S{temp}"
return f"{KlippyGcodes.SET_EXT_TEMP} T{tool} S{temp}"
@staticmethod
def set_heater_temp(heater, temp):
@@ -20,13 +40,25 @@ class KlippyGcodes:
def set_temp_fan_temp(temp_fan, temp):
return f'SET_TEMPERATURE_FAN_TARGET temperature_fan="{temp_fan}" target={temp}'
@staticmethod
def set_fan_speed(speed):
return f"{KlippyGcodes.SET_FAN_SPEED} S{speed * 2.55:.0f}"
@staticmethod
def set_extrusion_rate(rate):
return f"M221 S{rate}"
return f"{KlippyGcodes.SET_EXT_FACTOR} S{rate}"
@staticmethod
def set_speed_rate(rate):
return f"M220 S{rate}"
return f"{KlippyGcodes.SET_SPD_FACTOR} S{rate}"
@staticmethod
def testz_move(dist):
return KlippyGcodes.TESTZ + dist
@staticmethod
def extrude(dist, speed=500):
return f"{KlippyGcodes.MOVE} E{dist} F{speed}"
@staticmethod
def bed_mesh_load(profile):
@@ -39,11 +71,3 @@ class KlippyGcodes:
@staticmethod
def bed_mesh_save(profile):
return f"BED_MESH_PROFILE SAVE='{profile}'"
@staticmethod
def set_led_color(led, color):
return (
f'SET_LED LED="{led}" '
f'RED={color[0]} GREEN={color[1]} BLUE={color[2]} WHITE={color[3]} '
f'SYNC=0 TRANSMIT=1'
)
+87 -133
View File
@@ -1,34 +1,27 @@
# -*- coding: utf-8 -*-
import contextlib
import logging
import os
import pathlib
from functools import lru_cache
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, GdkPixbuf, Gio, Gtk, Pango
from ks_includes.widgets.scroll import CustomScrolledWindow
def find_widget(widget, wanted_type):
# Returns a widget of wanted_type or None
if isinstance(widget, wanted_type):
return widget
if isinstance(widget, (Gtk.Container, Gtk.Bin, Gtk.Button, Gtk.Alignment, Gtk.Box)):
for _ in widget.get_children():
result = find_widget(_, wanted_type)
if result is not None:
return result
def format_label(widget, lines=2):
label = find_widget(widget, Gtk.Label)
if label is not None:
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
label.set_line_wrap(True)
label.set_ellipsize(Pango.EllipsizeMode.END)
label.set_lines(lines)
if type(widget) == Gtk.Label:
return widget
if type(widget) in (Gtk.Container, Gtk.Bin, Gtk.Button, Gtk.Alignment, Gtk.Box):
for _ in widget.get_children():
lbl = format_label(_)
if lbl is not None:
lbl.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
lbl.set_line_wrap(True)
lbl.set_ellipsize(True)
lbl.set_ellipsize(Pango.EllipsizeMode.END)
lbl.set_lines(lines)
class KlippyGtk:
@@ -37,28 +30,26 @@ class KlippyGtk:
def __init__(self, screen):
self.screen = screen
self.themedir = os.path.join(pathlib.Path(__file__).parent.resolve().parent, "styles", screen.theme, "images")
self.cursor = screen.show_cursor
self.font_size_type = screen._config.get_main_config().get("font_size", "medium")
self.width = screen.width
self.height = screen.height
self.ultra_tall = (self.height / self.width) >= 3
self.font_ratio = [28, 42] if self.screen.vertical_mode else [40, 27]
self.font_ratio = [33, 49] if self.screen.vertical_mode else [43, 29]
self.font_size = min(self.width / self.font_ratio[0], self.height / self.font_ratio[1])
self.img_scale = self.font_size * 2
self.button_image_scale = 1.38
self.bsidescale = .65 # Buttons with image at the side
self.dialog_buttons_height = round(self.height / 5)
if self.font_size_type == "max":
self.font_size = self.font_size * 1.06
self.img_scale = self.img_scale * 0.7
self.font_size = self.font_size * 1.2
self.bsidescale = .7
elif self.font_size_type == "extralarge":
self.font_size = self.font_size * 1.05
self.font_size = self.font_size * 1.14
self.img_scale = self.img_scale * 0.7
self.bsidescale = 1.0
self.bsidescale = 1
elif self.font_size_type == "large":
self.font_size = self.font_size * 1.025
self.img_scale = self.img_scale * 0.85
self.font_size = self.font_size * 1.09
self.img_scale = self.img_scale * 0.9
self.bsidescale = .8
elif self.font_size_type == "small":
self.font_size = self.font_size * 0.91
@@ -80,7 +71,7 @@ class KlippyGtk:
self.content_height = self.height - self.titlebar_height
self.keyboard_height = self.content_height * 0.5
if self.ultra_tall:
if (self.height / self.width) >= 3: # Ultra-tall
self.keyboard_height = self.keyboard_height * 0.5
self.color_list = {} # This is set by screen.py init_style()
@@ -115,33 +106,30 @@ class KlippyGtk:
for key in self.color_list:
self.color_list[key]['state'] = 0
@staticmethod
def Label(label, style=None):
la = Gtk.Label(label)
if style is not None:
la.get_style_context().add_class(style)
return la
def Image(self, image_name=None, width=None, height=None):
if image_name is None:
return Gtk.Image()
pixbuf = self.PixbufFromIcon(image_name, width, height)
return Gtk.Image.new_from_pixbuf(pixbuf) if pixbuf is not None else Gtk.Image()
def update_themedir(self, theme):
self.themedir = os.path.join(pathlib.Path(__file__).parent.resolve().parent, "styles", theme, "images")
def PixbufFromIcon(self, filename, width=None, height=None):
width = width if width is not None else self.img_width
height = height if height is not None else self.img_height
return self._PixbufFromIcon(filename, self.themedir, int(width), int(height))
@staticmethod
@lru_cache(maxsize=500)
def _PixbufFromIcon(filename, themedir, width, height):
filename = os.path.join(themedir, filename)
filename = os.path.join(self.themedir, filename)
for ext in ["svg", "png"]:
file = f"{filename}.{ext}"
pixbuf = KlippyGtk.PixbufFromFile(file, width, height) if os.path.exists(file) else None
pixbuf = self.PixbufFromFile(f"{filename}.{ext}", int(width), int(height))
if pixbuf is not None:
return pixbuf
return None
@staticmethod
@lru_cache(maxsize=500)
def PixbufFromFile(filename, width=-1, height=-1):
try:
return GdkPixbuf.Pixbuf.new_from_file_at_size(filename, int(width), int(height))
@@ -164,117 +152,71 @@ class KlippyGtk:
return pixbuf
def Button(self, image_name=None, label=None, style=None, scale=None, position=Gtk.PositionType.TOP, lines=2):
if self.font_size_type == "max" and label is not None:
if self.font_size_type == "max" and label is not None and scale is None:
image_name = None
b = Gtk.Button(hexpand=True, vexpand=True, image_position=position, always_show_image=True)
focusable = self.screen._config.get_main_config().getboolean("keyboard_navigation", fallback=False)
b.set_can_focus(focusable)
b = Gtk.Button()
if label is not None:
b.set_label(label.replace("\n", " "))
b.set_hexpand(True)
b.set_vexpand(True)
b.set_can_focus(False)
if image_name is not None:
b.set_name(image_name)
if scale is None:
scale = self.button_image_scale
if label is None:
scale = scale * 1.4
scale = scale * 1.5
width = height = self.img_scale * scale
b.set_image(self.Image(image_name, width, height))
spinner = Gtk.Spinner(width_request=width, height_request=height, no_show_all=True)
spinner.hide()
box = find_widget(b, Gtk.Box)
if box:
box.add(spinner)
b.set_image_position(position)
b.set_always_show_image(True)
if label is not None:
format_label(b, lines)
if style is not None:
b.get_style_context().add_class(style)
b.connect("clicked", self.screen.screensaver.reset_timeout)
b.connect("clicked", self.screen.lock_screen.reset_timeout)
b.connect("clicked", self.screen.reset_screensaver_timeout)
return b
@staticmethod
def Button_busy(widget, busy):
spinner = find_widget(widget, Gtk.Spinner)
image = find_widget(widget, Gtk.Image)
if busy:
widget.set_sensitive(False)
if image:
widget.set_always_show_image(False)
image.hide()
if spinner:
spinner.start()
spinner.show()
else:
if image:
widget.set_always_show_image(True)
image.show()
if spinner:
spinner.stop()
spinner.hide()
widget.set_sensitive(True)
def Dialog(self, screen, buttons, content, callback=None, *args):
dialog = Gtk.Dialog()
dialog.set_default_size(screen.width, screen.height)
dialog.set_resizable(False)
dialog.set_transient_for(screen)
dialog.set_modal(True)
def dialog_content_decouple(self, widget, event, dialog):
self.remove_dialog(dialog)
for button in buttons:
dialog.add_button(button['name'], button['response'])
button = dialog.get_widget_for_response(button['response'])
button.set_size_request((screen.width - 30) / 3, screen.height / 5)
format_label(button, 3)
def Dialog(self, title, buttons, content, callback=None, *args):
dialog = Gtk.Dialog(title=title, modal=True, transient_for=self.screen,
default_width=self.width, default_height=self.height)
dialog.set_size_request(self.width, self.height)
if not self.screen.windowed:
dialog.fullscreen()
if buttons:
max_buttons = 4
if len(buttons) > max_buttons:
buttons = buttons[:max_buttons]
if len(buttons) > 2:
dialog.get_action_area().set_layout(Gtk.ButtonBoxStyle.EXPAND)
button_hsize = -1
else:
button_hsize = int((self.width / 3))
for button in buttons:
style = button['style'] if 'style' in button else 'dialog-default'
dialog.add_button(button['name'], button['response'])
button = dialog.get_widget_for_response(button['response'])
button.set_size_request(button_hsize, self.dialog_buttons_height)
button.get_style_context().add_class(style)
format_label(button, 2)
else:
# No buttons means clicking anywhere closes the dialog
content.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK)
content.connect("button-release-event", self.dialog_content_decouple, dialog)
dialog.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK)
dialog.connect("button-release-event", self.remove_dialog)
dialog.connect("response", self.screen.screensaver.reset_timeout)
dialog.connect("response", self.screen.lock_screen.reset_timeout)
dialog.connect("response", self.screen.reset_screensaver_timeout)
dialog.connect("response", callback, *args)
dialog.get_style_context().add_class("dialog")
content_area = dialog.get_content_area()
content_area.set_margin_start(10)
content_area.set_margin_end(5)
content_area.set_margin_top(5)
content_area.set_margin_bottom(0)
content_area.set_margin_start(15)
content_area.set_margin_end(15)
content_area.set_margin_top(15)
content_area.set_margin_bottom(15)
content_area.add(content)
dialog.show_all()
# Change cursor to blank
self.set_cursor(show=self.screen.show_cursor, window=dialog.get_window())
if self.cursor:
dialog.get_window().set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.ARROW))
else:
dialog.get_window().set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.BLANK_CURSOR))
self.screen.dialogs.append(dialog)
logging.info(f"Showing dialog {dialog.get_title()} {dialog.get_size()}")
logging.info(f"Showing dialog {dialog}")
return dialog
def remove_dialog(self, dialog, *args):
if not isinstance(dialog, Gtk.Dialog):
logging.error(f"Invalid dialog: {dialog}")
return
if self.screen.updating:
return
if dialog == self.screen.confirm:
self.screen.confirm = None
dialog.destroy()
if dialog in self.screen.dialogs:
logging.info("Removing Dialog")
@@ -282,18 +224,30 @@ class KlippyGtk:
return
logging.debug(f"Cannot remove dialog {dialog}")
def ScrolledWindow(self, steppers=True, **kwargs):
steppers = steppers and self.screen._config.get_main_config().getboolean("show_scroll_steppers", fallback=False)
return CustomScrolledWindow(steppers, **kwargs)
@staticmethod
def HomogeneousGrid(width=None, height=None):
g = Gtk.Grid()
g.set_row_homogeneous(True)
g.set_column_homogeneous(True)
if width is not None and height is not None:
g.set_size_request(width, height)
return g
def set_cursor(self, show: bool, window: Gdk.Window):
if show:
window.set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.ARROW))
if not self.screen.wayland:
os.system("xsetroot -cursor_name arrow")
else:
window.set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.BLANK_CURSOR))
if not self.screen.wayland:
os.system("xsetroot -cursor ks_includes/emptyCursor.xbm ks_includes/emptyCursor.xbm")
def ToggleButton(self, text):
b = Gtk.ToggleButton(text)
b.props.relief = Gtk.ReliefStyle.NONE
b.set_hexpand(True)
b.set_vexpand(True)
b.connect("clicked", self.screen.reset_screensaver_timeout)
return b
@staticmethod
def ScrolledWindow():
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK |
Gdk.EventMask.TOUCH_MASK |
Gdk.EventMask.BUTTON_RELEASE_MASK)
scroll.set_kinetic_scrolling(True)
return scroll
+32 -28
View File
@@ -1,62 +1,66 @@
import logging
import re
import requests
class KlippyRest:
def __init__(self, ip, port=7125, api_key=False, path='', ssl=None):
def __init__(self, ip, port=7125, api_key=False):
self.ip = ip
self.port = port
self.path = f"/{path}" if path else ''
self.ssl = ssl
self.api_key = api_key
self.ssl = int(self.port) in {443, 7130} if ssl is None else bool(ssl)
self.status = ''
@property
def endpoint(self):
return f"{'https' if self.ssl else 'http'}://{self.ip}:{self.port}{self.path}"
@staticmethod
def process_response(response):
return response['result'] if response and 'result' in response else response
protocol = "http"
if int(self.port) in {443, 7130}:
protocol = "https"
return f"{protocol}://{self.ip}:{self.port}"
def get_server_info(self):
return self.send_request("server/info")
def get_oneshot_token(self):
return self.send_request("access/oneshot_token")
r = self.send_request("access/oneshot_token")
if r is False or 'result' not in r:
return False
return r['result']
def get_printer_info(self):
return self.send_request("printer/info")
def get_gcode_help(self):
return self.send_request("printer/gcode/help")
def get_thumbnail_stream(self, thumbnail):
return self.send_request(f"server/files/gcodes/{thumbnail}", json=False)
def _do_request(self, method, request_method, data=None, json=None, json_response=True, timeout=3):
def send_request(self, method, json=True):
url = f"{self.endpoint}/{method}"
headers = {"x-api-key": self.api_key} if self.api_key else {}
headers = {} if self.api_key is False else {"x-api-key": self.api_key}
data = False
try:
callee = getattr(requests, request_method)
response = callee(url, json=json, data=data, headers=headers, timeout=timeout)
response = requests.get(url, headers=headers, timeout=3)
response.raise_for_status()
self.status = ''
return response.json() if json_response else response.content
if json:
logging.debug(f"Sending request to {url}")
data = response.json()
else:
data = response.content
except requests.exceptions.HTTPError as h:
self.status = self.format_status(h)
except requests.exceptions.ConnectionError as c:
self.status = self.format_status(c)
except requests.exceptions.Timeout as t:
self.status = self.format_status(t)
except requests.exceptions.JSONDecodeError as j:
self.status = self.format_status(j)
except requests.exceptions.RequestException as r:
self.status = self.format_status(r)
except Exception as e:
self.status = self.format_status(e)
if data:
self.status = ''
else:
logging.error(self.status.replace('\n', '>>'))
return False
def post_request(self, method, data=None, json=None, json_response=True):
return self._do_request(method, "post", data, json, json_response)
def send_request(self, method, json=True, timeout=4):
res = self._do_request(method, "get", json_response=json, timeout=timeout)
return self.process_response(res) if json else res
return data
@staticmethod
def format_status(status):
+64 -71
View File
@@ -1,8 +1,8 @@
#!/usr/bin/python
import threading
import json
import logging
import threading
import gi
import websocket
@@ -20,72 +20,75 @@ class KlippyWebsocket(threading.Thread):
reconnect_count = 0
max_retries = 4
def __init__(self, callback, host, port, api_key, path='', ssl=None):
def __init__(self, screen, callback, host, port):
threading.Thread.__init__(self)
self._wst = None
self.ws_url = None
self._screen = screen
self._callback = callback
self.klippy = MoonrakerApi(self)
self.ws = None
self.closing = False
self.host = host
self.port = port
self.path = f"/{path}" if path else ''
self.ssl = int(self.port) in {443, 7130} if ssl is None else bool(ssl)
self.header = {"x-api-key": api_key} if api_key else {}
self.api_key = api_key
@property
def _url(self):
return f"{self.host}:{self.port}{self.path}"
return f"{self.host}:{self.port}"
@property
def ws_proto(self):
return "wss" if self.ssl else "ws"
if int(self.port) in {443, 7130}:
return "wss"
return "ws"
def retry(self):
self.reconnect_count = 0
self.connecting = True
self.initial_connect()
def initial_connect(self):
if self.connect() is not False:
# Enable a timeout so that way if moonraker is not running, it will attempt to reconnect
self.connect()
if self.connecting:
GLib.timeout_add_seconds(10, self.reconnect)
def reconnect(self):
if self.reconnect_count > self.max_retries:
logging.debug("Stopping reconnections")
self.connecting = False
GLib.idle_add(self._callback['on_cancel'])
return False
return self.connect()
def connect(self):
if self.connected:
logging.debug("Already connected")
return False
logging.debug("Attempting to connect")
return
self.reconnect_count += 1
try:
state = self._screen.apiclient.get_server_info()
if state is False:
if self.reconnect_count > 2:
self._screen.printer_initializing(
_("Cannot connect to Moonraker") + '\n\n'
+ _("Retrying") + f' #{self.reconnect_count}'
)
return False
token = self._screen.apiclient.get_oneshot_token()
except Exception as e:
logging.critical(e, exc_info=True)
logging.debug("Unable to get oneshot token")
return False
self.ws_url = f"{self.ws_proto}://{self._url}/websocket?token={self.api_key}"
self.ws_url = f"{self.ws_proto}://{self._url}/websocket?token={token}"
self.ws = websocket.WebSocketApp(
self.ws_url,
on_close=self.on_close,
on_error=self.on_error,
on_message=self.on_message,
on_open=self.on_open,
header=self.header
on_close=self.on_close, on_error=self.on_error, on_message=self.on_message, on_open=self.on_open
)
self._wst = threading.Thread(target=self.ws.run_forever, daemon=True)
try:
logging.debug("Starting websocket thread")
self._wst.start()
except Exception as e:
logging.debug(f"Error starting web socket {e}")
return True
return False
logging.critical(e, exc_info=True)
logging.debug("Error starting web socket")
def close(self):
logging.debug("Closing websocket")
self.closing = True
self.connecting = False
if self.ws is not None:
self.ws.keep_running = False
self.ws.close()
def on_message(self, *args):
@@ -96,20 +99,17 @@ class KlippyWebsocket(threading.Thread):
self.callback_table[response['id']][1],
self.callback_table[response['id']][2],
*self.callback_table[response['id']][3])
GLib.idle_add(self.callback_table[response['id']][0], *args, priority=GLib.PRIORITY_HIGH_IDLE)
GLib.idle_add(self.callback_table[response['id']][0], *args)
self.callback_table.pop(response['id'])
return
if "method" in response and "on_message" in self._callback:
args = (response['method'], response['params'][0] if "params" in response else {})
GLib.idle_add(self._callback['on_message'], *args, priority=GLib.PRIORITY_HIGH_IDLE)
if self.closing:
timer = threading.Timer(2, self.ws.close)
timer.start()
args = response['method'], response['params'][0] if "params" in response else {}
GLib.idle_add(self._callback['on_message'], *args)
return
def send_method(self, method, params=None, callback=None, *args):
if not self.connected or self.closing:
if not self.connected:
return False
if params is None:
params = {}
@@ -130,30 +130,45 @@ class KlippyWebsocket(threading.Thread):
def on_open(self, *args):
logging.info("Moonraker Websocket Open")
self.connected = True
self.connecting = False
self._screen.reinit_count = 0
self.reconnect_count = 0
if "on_connect" in self._callback:
GLib.idle_add(self._callback['on_connect'], priority=GLib.PRIORITY_HIGH_IDLE)
GLib.idle_add(self._callback['on_connect'])
def on_close(self, *args):
# args: ws, status, message
# sometimes ws is not passed due to bugs
if len(args) == 3:
status = args[1]
message = args[2]
else:
status = args[0]
message = args[1]
message = args[2] if len(args) == 3 else args[1]
if message is not None:
logging.info(f"{status} {message}")
logging.info(f"{message}")
if not self.connected:
logging.debug("Connection already closed")
return
if self.closing:
logging.debug("Closing websocket")
self.ws.keep_running = False
self.close()
self.closing = False
return
if "on_close" in self._callback:
GLib.idle_add(self._callback['on_close'], priority=GLib.PRIORITY_HIGH_IDLE)
GLib.idle_add(self._callback['on_close'], "Lost Connection to Moonraker")
logging.info("Moonraker Websocket Closed")
self.connected = False
def reconnect(self):
if self.connected:
return False
if self.reconnect_count > self.max_retries:
logging.debug("Stopping reconnections")
self.connecting = False
self._screen.printer_initializing(
_("Cannot connect to Moonraker")
+ f'\n\n{self._screen.apiclient.status}')
return False
logging.debug("Attempting to reconnect")
self.connect()
return True
@staticmethod
def on_error(*args):
error = args[1] if len(args) == 2 else args[0]
@@ -180,7 +195,7 @@ class MoonrakerApi:
)
def get_file_dir(self, path='gcodes', callback=None, *args):
logging.debug(f"Sending server.files.directory {path}")
logging.debug("Sending server.files.directory")
return self._ws.send_method(
"server.files.list",
{"path": path},
@@ -197,15 +212,6 @@ class MoonrakerApi:
*args
)
def get_dir_info(self, callback=None, directory='gcodes', *args):
logging.debug(f"Sending server.files.get_directory {directory}")
return self._ws.send_method(
"server.files.get_directory",
{"path": directory},
callback,
*args
)
def get_file_metadata(self, filename, callback=None, *args):
return self._ws.send_method(
"server.files.metadata",
@@ -332,16 +338,3 @@ class MoonrakerApi:
return self._ws.send_method(
"printer.firmware_restart"
)
def identify_client(self, version, api_key):
logging.debug("Sending server.connection.identify")
return self._ws.send_method(
"server.connection.identify",
{
"client_name": "KlipperScreen",
"version": f"{version}",
"type": "display",
"url": "https://github.com/KlipperScreen/KlipperScreen",
"api_key": f"{api_key}"
},
)
File diff suppressed because it is too large. Load diff
+176 -282
View File
@@ -1,29 +1,25 @@
import configparser
import copy
import gettext
import json
import locale
import logging
import os
import pathlib
import logging
import json
import re
import copy
import pathlib
import locale
from io import StringIO
SCREEN_BLANKING_OPTIONS = [
60, # 1 Minute
120, # 2 Minutes
300, # 5 Minutes
900, # 15 Minutes
1800, # 30 Minutes
3600, # 1 Hour
7200, # 2 Hours
300, # 5 Minutes
900, # 15 Minutes
1800, # 30 Minutes
3600, # 1 Hour
7200, # 2 Hours
14400, # 4 Hours
]
klipperscreendir = pathlib.Path(__file__).parent.resolve().parent
home = os.path.expanduser("~/")
printer_data_config = os.path.join(home, "printer_data", "config")
xdg_config = os.path.join(home, ".config", "KlipperScreen")
class ConfigError(Exception):
@@ -39,52 +35,41 @@ class KlipperScreenConfig:
def __init__(self, configfile, screen=None):
self.lang_list = None
self.errors = []
self.default_config_path = os.path.join(klipperscreendir, "config", "defaults.conf")
self.default_config_path = os.path.join(klipperscreendir, "ks_includes", "defaults.conf")
self.config = configparser.ConfigParser()
self.config_path = self.get_config_file_location(configfile)
logging.debug(f"Config path location: {self.config_path}")
self.user_cfg = None
self.defined_config = None
self.lang = None
self.langs = {}
try:
# parse defaults.conf
self.config.read(self.default_config_path)
includes = [i[8:] for i in self.config.sections() if i.startswith("include ")]
for include in includes:
directory = "/".join(self.default_config_path.split("/")[:-1])
self._include_config(self.config, directory, include, log=False)
self.validate_config(self.config) # In case a user altered defaults
# parse KlipperScreen.conf
if self.config_path != self.default_config_path:
user_def, saved_def = self.separate_saved_config(self.config_path)
self.user_cfg = configparser.ConfigParser()
self.user_cfg.read_string(user_def)
self.defined_config = configparser.ConfigParser()
self.defined_config.read_string(user_def)
includes = [i[8:] for i in self.user_cfg.sections() if i.startswith("include ")]
includes = [i[8:] for i in self.defined_config.sections() if i.startswith("include ")]
for include in includes:
directory = "/".join(self.config_path.split("/")[:-1])
self._include_config(self.user_cfg, directory, include)
self._include_config("/".join(self.config_path.split("/")[:-1]), include)
if not self.user_cfg.getboolean('main', "use_default_menu", fallback=True):
self.exclude_menu_from_config(self.config)
self.exclude_from_config(self.defined_config)
if any(sec.startswith("preheat") for sec in self.user_cfg.sections()):
self.exclude_preheat_from_config(self.config)
self.log_config(self.user_cfg)
if self.validate_config(self.user_cfg, string=user_def):
merged_user_text = self._build_config_string(self.user_cfg)
self.config.read_string(merged_user_text) # Merge user config
# Parse configs saved from the UI
self.log_config(self.defined_config)
self.config.read_string(user_def)
if saved_def is not None:
auto_gen = configparser.ConfigParser()
auto_gen.read_string(saved_def)
if self.validate_config(auto_gen, string=saved_def, remove=True):
self.config.read_string(saved_def) # Merge ui saved config
logging.info(f"\n====== Saved ======\n{saved_def}\n")
self.config.read_string(saved_def)
logging.info(f"====== Saved Def ======\n{saved_def}\n=======================")
# This is the final config
# self.log_config(self.config)
if self.validate_config():
logging.info('Configuration validated succesfuly')
else:
logging.error('Invalid configuration detected !!!')
logging.info('Loading default config')
self.config = configparser.ConfigParser()
self.config.read(self.default_config_path)
except KeyError as Kerror:
msg = f"Error reading config: {self.config_path}\n{Kerror}"
logging.exception(msg)
@@ -99,15 +84,13 @@ class KlipperScreenConfig:
logging.exception(msg)
self.errors.append(msg)
printers = [i for i in self.config.sections() if i.startswith("printer ")]
if not printers:
printers = sorted([i for i in self.config.sections() if i.startswith("printer ")])
if len(printers) == 0:
printers.append("Printer Printer")
self.printers = [
{printer[8:]: {
"moonraker_host": self.config.get(printer, "moonraker_host", fallback="127.0.0.1"),
"moonraker_port": self.config.get(printer, "moonraker_port", fallback="7125"),
"moonraker_path": self.config.get(printer, "moonraker_path", fallback='').strip('/'),
"moonraker_ssl": self.config.getboolean(printer, "moonraker_ssl", fallback=None),
"moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback="").replace('"', '')
}} for printer in printers
]
@@ -130,39 +113,33 @@ class KlipperScreenConfig:
for lng in self.lang_list:
self.langs[lng] = gettext.translation('KlipperScreen', localedir=lang_path, languages=[lng], fallback=True)
lang = self.get_main_config().get("language", "system_lang")
logging.debug(f"Selected lang: {lang} OS lang: {locale.getlocale()[0]}")
lang = self.get_main_config().get("language", None)
logging.debug(f"Selected lang: {lang} OS lang: {locale.getdefaultlocale()[0]}")
self.install_language(lang)
def find_language(self, lang):
if lang in (None, "system_lang"):
sys_lang = locale.getlocale()[0]
if sys_lang is None or len(sys_lang) < 2:
return "en"
if sys_lang in self.lang_list:
return sys_lang
for language in self.lang_list:
if sys_lang.startswith(language):
return language
return next((language for language in self.lang_list if lang.startswith(language)), "en")
def install_language(self, lang):
if lang is None or lang == "system_lang":
for language in self.lang_list:
if locale.getdefaultlocale()[0].startswith(language):
logging.debug("Using system lang")
lang = language
if lang is not None and lang not in self.lang_list:
# try to match a parent
for language in self.lang_list:
if lang.startswith(language):
lang = language
self.set("main", "language", lang)
if lang not in self.lang_list:
lang = self.find_language(lang)
logging.error(f"lang: {lang} not found")
logging.info(f"Available lang list {self.lang_list}")
lang = "en"
logging.info(f"Using lang {lang}")
self.lang = self.langs[lang]
self.lang.install(names=['gettext', 'ngettext'])
def validate_config(self, config, string="", remove=False):
def validate_config(self):
valid = True
if string:
msg = "Section headers have extra information after brackets possible newline issue:"
for line in string.split('\n'):
if re.match(r".+\].", line):
logging.error(line)
self.errors.append(f'{msg}\n\n{line}')
return False
for section in config:
for section in self.config:
if section == 'DEFAULT' or section.startswith('include '):
# Do not validate 'DEFAULT' or 'include*' sections
continue
@@ -171,74 +148,58 @@ class KlipperScreenConfig:
bools = (
'invert_x', 'invert_y', 'invert_z', '24htime', 'only_heaters', 'show_cursor', 'confirm_estop',
'autoclose_popups', 'use_dpms', 'use_default_menu', 'side_macro_shortcut', 'use-matchbox-keyboard',
'show_heater_power', "show_scroll_steppers", "auto_open_extrude", "start_locked",
"keyboard_navigation"
'show_heater_power'
)
strs = (
'default_printer', 'language', 'print_sort_dir', 'theme', 'screen_blanking_printing', 'font_size',
'print_estimate_method', 'screen_blanking', "screen_on_devices", "screen_off_devices", 'print_view',
"lock_password"
'default_printer', 'language', 'print_sort_dir', 'theme', 'screen_blanking', 'font_size',
'print_estimate_method', 'screen_blanking', "screen_on_devices", "screen_off_devices",
)
numbers = (
'job_complete_timeout', 'job_error_timeout', 'move_speed_xy', 'move_speed_z',
'print_estimate_compensation', 'width', 'height', 'autolock_timeout',
'print_estimate_compensation', 'width', 'height',
)
elif section.startswith('printer '):
bools = (
'invert_x', 'invert_y', 'invert_z', 'moonraker_ssl',
'invert_x', 'invert_y', 'invert_z',
)
strs = (
'moonraker_api_key', 'moonraker_host', 'moonraker_path', 'titlebar_name_type',
'moonraker_api_key', 'moonraker_host', 'titlebar_name_type',
'screw_positions', 'power_devices', 'titlebar_items', 'z_babystep_values',
'extrude_distances', 'extrude_speeds', 'move_distances', 'zcalibrate_custom_commands'
'extrude_distances', "extrude_speeds", "camera_url",
)
numbers = (
'moonraker_port', 'move_speed_xy', 'move_speed_z', 'screw_rotation',
'calibrate_x_position', 'calibrate_y_position', 'spool_low_limit',
'moonraker_port', 'move_speed_xy', 'move_speed_z',
'calibrate_x_position', 'calibrate_y_position',
)
elif section.startswith('preheat '):
strs = ('gcode', '')
numbers = [f'{option}' for option in config[section] if option != 'gcode']
numbers = [f'{option}' for option in self.config[section] if option != 'gcode']
elif section.startswith('menu '):
strs = ('name', 'icon', 'panel', 'method', 'params', 'enable', 'confirm', 'style')
elif section.startswith('graph')\
or section.startswith('displayed_macros')\
or section.startswith('spoolman'):
bools = [f'{option}' for option in config[section]]
elif section == 'bed_screws':
# This section may be deprecated in favor of moving this options under the printer section
numbers = ('rotation', '')
strs = ('screw_positions', '')
elif section.startswith('graph') or section.startswith('displayed_macros'):
bools = [f'{option}' for option in self.config[section]]
elif section.startswith('z_calibrate_position'):
# This section may be deprecated in favor of moving this options under the printer section
numbers = ('calibrate_x_position', 'calibrate_y_position')
else:
self.errors.append(f'Section [{section}] not recognized')
for key in config[section]:
for key in self.config[section]:
if key not in bools and key not in strs and key not in numbers:
msg = f'Option "{key}" not recognized for section "[{section}]"'
if section.startswith("menu"):
msg = (
msg + "\n\n"
+ "KlipperScreen menu uses different options than Klipper\n"
+ "Syntax meant for text/graphical LCDs (usually blue)\n"
+ "will not work with KlipperScreen\n"
+ "please consult KlipperScreen documentation."
)
if key == "camera_url":
msg = (
"camera_url has been deprecated in favor of moonraker cameras\n\n"
+ "https://moonraker.readthedocs.io/en/latest/configuration/#webcam\n\n"
+ "remove camera_url from KlipperScreen config file"
)
if remove:
# This should only be called for the auto-generated section
self.config.remove_option(section, key)
else:
self.errors.append(msg)
elif key in numbers and not self.is_float(config[section][key]) \
or key in bools and not self.is_bool(config[section][key]):
self.errors.append(msg)
# This most probably is not a big issue, continue to load the config
elif key in numbers and not self.is_float(self.config[section][key]) \
or key in bools and self.config[section][key] not in ["False", "false", "True", "true"]:
msg = (
f'Unable to parse "{key}" from [{section}]\n'
f'Expected a {"number" if key in numbers else "boolean"} but got: {config[section][key]}'
f'Expected a {"number" if key in numbers else "boolean"} but got: {self.config[section][key]}'
)
self.errors.append(msg)
logging.error('Invalid configuration detected !!!')
valid = False
return valid
@@ -250,24 +211,22 @@ class KlipperScreenConfig:
except ValueError:
return False
@staticmethod
def is_bool(element):
return element in ["False", "false", "True", "true"]
def get_errors(self):
return "".join(f'{error}\n\n' for error in self.errors)
def _create_configurable_options(self, screen):
self.configurable_options = [
{"language": {
"section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang",
"callback": screen.change_language, "options": [
{"name": _("System") + " " + _("(default)"), "value": "system_lang"}]}},
{"theme": {
"section": "main", "name": _("Icon Theme"), "type": "dropdown",
"tooltip": _("Changes how the interface looks"),
"value": "z-bolt", "callback": screen.change_theme, "options": [
"value": "z-bolt", "callback": screen.restart_ks, "options": [
{"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}},
{"print_estimate_method": {
"section": "main", "name": _("Estimated Time Method"), "type": "dropdown",
"tooltip": _("Changes how the time remaining is calculated"),
"value": "auto", "options": [
{"name": _("Auto") + " " + _("(default)"), "value": "auto"},
{"name": _("File"), "value": "file"},
@@ -275,26 +234,15 @@ class KlipperScreenConfig:
{"name": _("Slicer"), "value": "slicer"}]}},
{"screen_blanking": {
"section": "main", "name": _("Screen Power Off Time"), "type": "dropdown",
"tooltip": _("Timeout for screen black-out or power-off"),
"value": "3600", "callback": screen.set_screenblanking_timeout, "options": [
{"name": _("Never"), "value": "off"}]
}},
{"screen_blanking_printing": {
"section": "main", "name": _("Screen Power Off Time") + " (" + _("Printing") + ")",
"type": "dropdown",
"tooltip": _("Timeout for screen black-out or power-off during printing"),
"value": "3600", "callback": screen.set_screenblanking_printing_timeout, "options": [
{"name": _("Never"), "value": "off"}]
}},
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary",
"tooltip": _("Disable for 12hs with am / pm"),
"value": "True"}},
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
{"side_macro_shortcut": {
"section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary",
"value": "False", "callback": screen.toggle_shortcut}},
"value": "True", "callback": screen.toggle_macro_shortcut}},
{"font_size": {
"section": "main", "name": _("Font Size"), "type": "dropdown",
"tooltip": _("Inversely affects the icon size"),
"value": "medium", "callback": screen.restart_ks, "options": [
{"name": _("Small"), "value": "small"},
{"name": _("Medium") + " " + _("(default)"), "value": "medium"},
@@ -302,29 +250,18 @@ class KlipperScreenConfig:
{"name": _("Extra Large"), "value": "extralarge"},
{"name": _("Maximum"), "value": "max"}]}},
{"confirm_estop": {"section": "main", "name": _("Confirm Emergency Stop"), "type": "binary",
"tooltip": _("Asks for confirmation before stopping"),
"value": "False"}},
{"only_heaters": {"section": "main", "name": _("Hide sensors in Temp."), "type": "binary",
"tooltip": _("Show only devices that are able to be set"),
"value": "False", "callback": screen.reload_panels}},
{"use_dpms": {"section": "main", "name": _("Screen DPMS"), "type": "binary",
"tooltip": _("Enable screen power management") + "\n"
+ _("Not all screens support this"),
"value": "True", "callback": screen.set_dpms}},
{"print_estimate_compensation": {
"section": "main", "name": _("Slicer Time correction (%)"), "type": "scale", "value": "100",
"range": [50, 150], "step": 1}},
{"autoclose_popups": {"section": "main", "name": _("Auto-close notifications"), "type": "binary",
"tooltip": _("Close messages after a timeout"),
"value": "True"}},
{"show_heater_power": {"section": "main", "name": _("Show Heater Power"), "type": "binary",
"tooltip": _("Current percentage and graph line"),
"value": "False", "callback": screen.reload_panels}},
{"show_scroll_steppers": {"section": "main", "name": _("Show Scrollbars Buttons"), "type": "binary",
"tooltip": _("Useful for un-responsive touchscreens"),
"value": "False", "callback": screen.reload_panels}},
{"auto_open_extrude": {"section": "main", "name": _("Auto-open Extrude On Pause"), "type": "binary",
"value": "True", "callback": screen.reload_panels}},
{"show_cursor": {"section": "main", "name": _("Show cursor"), "type": "binary",
"tooltip": _("For mouse control or to verify touchscreen accuracy"),
"value": "False", "callback": screen.update_cursor}},
# {"": {"section": "main", "name": _(""), "type": ""}}
]
@@ -336,46 +273,31 @@ class KlipperScreenConfig:
{"move_speed_xy": {"section": "main", "name": _("XY Move Speed (mm/s)"), "type": None, "value": "50"}},
{"move_speed_z": {"section": "main", "name": _("Z Move Speed (mm/s)"), "type": None, "value": "10"}},
{"print_sort_dir": {"section": "main", "type": None, "value": "name_asc"}},
{"print_view": {"section": "main", "type": None, "value": "thumbs"}},
{"language": {"section": "main", "name": _("Language"), "type": None, "value": "system_lang"}},
]
self.configurable_options.extend(panel_options)
i0 = i1 = i2 = None
for i, option in enumerate(self.configurable_options):
if list(option)[0] == "theme":
i0 = i
elif list(option)[0] == "screen_blanking":
i1 = i
elif list(option)[0] == "screen_blanking_printing":
i2 = i
if i0 and i1 and i2:
break
lang_opt = self.configurable_options[0]['language']['options']
for lang in self.lang_list:
lang_opt.append({"name": lang, "value": lang})
t_path = os.path.join(klipperscreendir, 'styles')
themes = [
d for d in os.listdir(t_path)
if (not os.path.isfile(os.path.join(t_path, d))
and d not in ("z-bolt", "printers"))
]
themes = [d for d in os.listdir(t_path) if (not os.path.isfile(os.path.join(t_path, d)) and d != "z-bolt")]
themes.sort()
theme_opt = self.configurable_options[1]['theme']['options']
for theme in themes:
self.configurable_options[i0]['theme']['options'].append({"name": theme, "value": theme})
theme_opt.append({"name": theme, "value": theme})
index = self.configurable_options.index(
[i for i in self.configurable_options if list(i)[0] == "screen_blanking"][0])
for num in SCREEN_BLANKING_OPTIONS:
hour = num // 3600
minute = num // 60
if hour > 0:
name = f'{hour} ' + ngettext("hour", "hours", hour)
else:
name = f'{minute} ' + ngettext("minute", "minutes", minute)
self.configurable_options[i1]['screen_blanking']['options'].append({
"name": name,
"value": f"{num}"
})
self.configurable_options[i2]['screen_blanking_printing']['options'].append({
name = f'{num / 60:.0f} ' + _("minutes")
self.configurable_options[index]['screen_blanking']['options'].append({
"name": name,
"value": f"{num}"
})
@@ -388,81 +310,48 @@ class KlipperScreenConfig:
if name not in list(self.config[vals['section']]):
self.config.set(vals['section'], name, vals['value'])
def exclude_menu_from_config(self, config):
logging.info("Using custom menu, removing default menu entries.")
exclude_list = ('menu __main', 'menu __print', 'menu __splashscreen')
self.exclude_from_config(config, exclude_list)
def exclude_from_config(self, config):
exclude_list = ['preheat']
if not self.defined_config.getboolean('main', "use_default_menu", fallback=True):
logging.info("Using custom menu, removing default menu entries.")
exclude_list.extend(('menu __main', 'menu __print', 'menu __splashscreen'))
for i in exclude_list:
for j in config.sections():
if j.startswith(i):
for k in list(self.config.sections()):
if k.startswith(i):
del self.config[k]
def exclude_preheat_from_config(self, config):
exclude_list = ('preheat',)
self.exclude_from_config(config, exclude_list)
def _include_config(self, directory, filepath):
full_path = filepath if filepath[0] == "/" else f"{directory}/{filepath}"
parse_files = []
def exclude_from_config(self, config, exclude_list):
for prefix in exclude_list:
if any(sec.startswith(prefix) for sec in config.sections()):
for key in list(self.config.keys()):
if key.startswith(prefix):
del self.config[key]
def _include_config(self,
config_to_integrate: configparser.ConfigParser,
base_dir: str,
filepath: str,
log: bool = True) -> None:
# ---------- Resolve absolute path ----------
if os.path.isabs(filepath):
full_path = filepath
else:
full_path = os.path.join(base_dir, filepath)
files_to_process = []
if '*' in full_path:
parent_dir = os.path.dirname(full_path)
pattern = re.escape(os.path.basename(full_path)).replace(r'\*', r'.*')
regex = re.compile(f'^{pattern}$')
try:
for fname in os.listdir(parent_dir):
if regex.match(fname):
files_to_process.append(os.path.join(parent_dir, fname))
except Exception as e:
logging.error(f"Config Error: unable to list directory {parent_dir}: {e}")
if "*" in full_path:
parent_dir = "/".join(full_path.split("/")[:-1])
file = full_path.split("/")[-1]
if not os.path.exists(parent_dir):
logging.info(f"Config Error: Directory {parent_dir} does not exist")
return
files = os.listdir(parent_dir)
regex = f"^{file.replace('*', '.*')}$"
parse_files.extend(os.path.join(parent_dir, file) for file in files if re.match(regex, file))
else:
if not os.path.isfile(full_path):
logging.error(f"Config Error: include file '{full_path}' does not exist")
if not os.path.exists(os.path.join(full_path)):
logging.info(f"Config Error: {full_path} does not exist")
return
files_to_process.append(full_path)
parse_files.append(full_path)
for fp in files_to_process:
try:
with open(fp, 'r', encoding='utf-8') as f:
cfg_text = f.read()
except Exception as e:
logging.error(f"Config Error: failed to read '{fp}': {e}")
continue
temp_cfg = configparser.ConfigParser()
try:
temp_cfg.read_string(cfg_text)
except Exception as e:
logging.error(f"Config Error: failed to parse '{fp}': {e}")
continue
# nested includes
nested_includes = [s[8:] for s in temp_cfg.sections() if s.startswith("include ")]
for inc_file in nested_includes:
self._include_config(
config_to_integrate=config_to_integrate,
base_dir=os.path.dirname(fp),
filepath=inc_file,
log=False
)
if self.validate_config(config_to_integrate, string=cfg_text):
config_to_integrate.read_string(cfg_text)
if log:
self.log_config(config_to_integrate)
logging.info(f"Parsing files: {parse_files}")
for file in parse_files:
config = configparser.ConfigParser()
config.read(file)
includes = [i[8:] for i in config.sections() if i.startswith("include ")]
for include in includes:
self._include_config("/".join(full_path.split("/")[:-1]), include)
self.exclude_from_config(config)
self.log_config(config)
self.config.read(file)
def separate_saved_config(self, config_path):
user_def = []
@@ -483,27 +372,35 @@ class KlipperScreenConfig:
saved_def.append(line[(len(self.do_not_edit_prefix) + 1):])
return ["\n".join(user_def), None if saved_def is None else "\n".join(saved_def)]
@staticmethod
def check_path_exists(base_dir, filename):
for name in (filename, filename.lower()):
full_path = os.path.join(base_dir, name)
if os.path.exists(full_path):
return full_path
return None
def get_config_file_location(self, file):
# Passed config (-c) by default is blank
# Passed config (-c) by default is ~/KlipperScreen.conf
logging.info(f"Passed config (-c): {file}")
if file not in (".", "..") and os.path.exists(file):
if os.path.exists(file):
return file
# List of directories to search for the config file
directories = [printer_data_config, xdg_config, klipperscreendir]
file = os.path.join(klipperscreendir, self.configfile_name)
if os.path.exists(file):
return file
file = os.path.join(klipperscreendir, self.configfile_name.lower())
if os.path.exists(file):
return file
for directory in directories:
path = self.check_path_exists(directory, self.configfile_name)
if path:
return path
klipper_config = os.path.join(os.path.expanduser("~/"), "printer_data", "config")
file = os.path.join(klipper_config, self.configfile_name)
if os.path.exists(file):
return file
file = os.path.join(klipper_config, self.configfile_name.lower())
if os.path.exists(file):
return file
# OLD config folder
klipper_config = os.path.join(os.path.expanduser("~/"), "klipper_config")
file = os.path.join(klipper_config, self.configfile_name)
if os.path.exists(file):
return file
file = os.path.join(klipper_config, self.configfile_name.lower())
if os.path.exists(file):
return file
# fallback
return self.default_config_path
@@ -564,22 +461,21 @@ class KlipperScreenConfig:
opt = item[name]
curval = self.config[opt['section']].get(name)
if curval != opt["value"] or (
self.user_cfg is not None and opt['section'] in self.user_cfg.sections() and
self.user_cfg[opt['section']].get(name, None) not in (None, curval)):
self.defined_config is not None and opt['section'] in self.defined_config.sections() and
self.defined_config[opt['section']].get(name, None) not in (None, curval)):
if opt['section'] not in save_config.sections():
save_config.add_section(opt['section'])
save_config.set(opt['section'], name, str(curval))
extra_sections = [i for i in self.config.sections() if i.startswith("displayed_macros")]
extra_sections.extend([i for i in self.config.sections() if i.startswith("graph")])
extra_sections.extend([i for i in self.config.sections() if i.startswith("spoolman")])
for section in extra_sections:
for item in self.config.options(section):
value = self.config[section].getboolean(item, fallback=True)
if value is False or (self.user_cfg is not None and
section in self.user_cfg.sections() and
self.user_cfg[section].getboolean(item, fallback=True) is False and
self.user_cfg[section].getboolean(item, fallback=True) != value):
if value is False or (self.defined_config is not None and
section in self.defined_config.sections() and
self.defined_config[section].getboolean(item, fallback=True) is False and
self.defined_config[section].getboolean(item, fallback=True) != value):
if section not in save_config.sections():
save_config.add_section(section)
save_config.set(section, item, str(value))
@@ -603,17 +499,17 @@ class KlipperScreenConfig:
if self.config_path != self.default_config_path:
filepath = self.config_path
else:
if os.path.exists(printer_data_config):
filepath = os.path.join(printer_data_config, self.configfile_name)
filepath = os.path.expanduser("~/")
klipper_config = os.path.join(filepath, "printer_data", "config")
old_klipper_config = os.path.join(filepath, "klipper_config")
if os.path.exists(klipper_config):
filepath = os.path.join(klipper_config, self.configfile_name)
elif os.path.exists(old_klipper_config):
filepath = os.path.join(old_klipper_config, self.configfile_name)
else:
try:
if not os.path.exists(xdg_config):
pathlib.Path(xdg_config).mkdir(parents=True, exist_ok=True)
filepath = os.path.join(xdg_config, self.configfile_name)
except Exception as e:
logging.error(e)
filepath = klipperscreendir
filepath = os.path.join(filepath, self.configfile_name)
logging.info(f'Creating a new config file in {filepath}')
try:
with open(filepath, 'w') as file:
file.write(contents)
@@ -621,19 +517,17 @@ class KlipperScreenConfig:
logging.error(f"Error writing configuration file in {filepath}:\n{e}")
def set(self, section, name, value):
self.config.set(section, name, str(value))
self.config.set(section, name, value)
def log_config(self, config):
sensitive_keys = [
r'(moonraker_api_key\s*(?:=|:)\s*)\S+',
r'(lock_password\s*(?:=|:)\s*)\S+',
]
config_str = self._build_config_string(config)
for pattern in sensitive_keys:
config_str = re.sub(pattern, r'\1[redacted]', config_str)
lines = [
" "
"===== Config File =====",
config_str,
re.sub(
r'(moonraker_api_key\s*=\s*\S+)',
'moonraker_api_key = [redacted]',
self._build_config_string(config)
),
"======================="
]
logging.info("\n".join(lines))
+296
View File
@@ -0,0 +1,296 @@
[main]
[preheat PLA]
bed = 40
extruder = 195
[preheat ABS]
bed = 90
extruder = 220
[preheat PETG]
bed = 80
extruder = 240
[preheat FLEX]
bed = 0
extruder = 210
[menu __main]
name: {{ gettext('Main Menu') }}
[menu __main homing]
name: {{ gettext('Homing') }}
icon: home
[menu __main temperature]
name: {{ gettext('Temperature') }}
icon: heat-up
panel: temperature
enable: {{ (printer.temperature_devices.count > 0) or (printer.extruders.count > 0)}}
[menu __main actions]
name: {{ gettext('Actions') }}
icon: move
[menu __main config]
name: {{ gettext('Configuration') }}
icon: settings
[menu __main print]
name: {{ gettext('Print') }}
icon: print
panel: print
[menu __main homing homeall]
name: {{ gettext('Home All') }}
icon: home
method: printer.gcode.script
params: {"script":"G28"}
[menu __main homing homex]
name: {{ gettext('Home X') }}
icon: home-x
method: printer.gcode.script
params: {"script":"G28 X"}
[menu __main homing homey]
name: {{ gettext('Home Y') }}
icon: home-y
method: printer.gcode.script
params: {"script":"G28 Y"}
[menu __main homing homez]
name: {{ gettext('Home Z') }}
icon: home-z
method: printer.gcode.script
params: {"script":"G28 Z"}
[menu __main homing homexy]
name: {{ gettext('Home XY') }}
icon: home
method: printer.gcode.script
params: {"script":"G28 X Y"}
[menu __main homing quad_gantry_level]
name: {{ gettext('Quad Gantry Level') }}
icon: home-z
method: printer.gcode.script
params: {"script":"QUAD_GANTRY_LEVEL"}
enable: {{ printer.quad_gantry_level is defined }}
[menu __main homing Z-Tilt]
name: {{ gettext('Z Tilt') }}
icon: z-tilt
method: printer.gcode.script
params: {"script":"Z_TILT_ADJUST"}
enable: {{ printer.z_tilt is defined }}
[menu __main actions move]
name: {{ gettext('Move') }}
icon: move
panel: move
[menu __main actions extrude]
name: {{ gettext('Extrude') }}
icon: filament
panel: extrude
enable: {{ printer.extruders.count > 0 }}
[menu __main actions fan]
name: {{ gettext('Fan') }}
icon: fan
panel: fan
enable: {{ printer.fans.count > 0 }}
[menu __main actions macros]
name: {{ gettext('Macros') }}
icon: custom-script
panel: gcode_macros
enable: {{ printer.gcode_macros.count > 0 }}
[menu __main actions pins]
name: {{ gettext('Pins') }}
icon: fine-tune
panel: pins
enable: {{ printer.output_pins.count > 0 }}
[menu __main actions power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ printer.power_devices.count > 0 }}
[menu __main actions disablemotors]
name: {{ gettext('Disable Motors') }}
icon: motor-off
method: printer.gcode.script
params: {"script":"M18"}
[menu __main actions camera]
name: {{ gettext('Camera') }}
icon: camera
panel: camera
enable: {{ camera_configured }}
[menu __main actions console]
name: {{ gettext('Console') }}
icon: console
panel: console
[menu __main config bedlevel]
name: {{ gettext('Bed Level') }}
icon: bed-level
panel: bed_level
enable: {{ printer.bed_screws or printer.screws_tilt_adjust}}
[menu __main config bedmesh]
name: {{ gettext('Bed Mesh') }}
icon: bed-mesh
panel: bed_mesh
enable: {{ printer.bed_mesh is defined }}
[menu __main config zoffset]
name: {{ gettext('Z Calibrate') }}
icon: z-farther
panel: zcalibrate
[menu __main config limits]
name: {{ gettext('Limits') }}
icon: fine-tune
panel: limits
[menu __main config network]
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __main config retraction]
name: {{ gettext('Retraction') }}
icon: retract
panel: retraction
enable: {{ printer.firmware_retraction }}
[menu __main config system]
name: {{ gettext('System') }}
icon: info
panel: system
[menu __main config save]
name: {{ gettext('Save Config') }}
icon: complete
method: printer.gcode.script
params: {"script":"SAVE_CONFIG"}
confirm:
{{ gettext('Save configuration?') }}
{{ gettext('Klipper will reboot') }}
[menu __main config settings]
name: {{ gettext('Settings') }}
icon: settings
panel: settings
[menu __main config input_shaper]
name: {{ gettext('Input Shaper') }}
icon: move
panel: input_shaper
enable: {{ printer.input_shaper }}
[menu __print]
name: {{ gettext('Print Control') }}
[menu __print temperature]
name: {{ gettext('Temperature') }}
icon: heat-up
panel: temperature
enable: {{ (printer.temperature_devices.count > 0) or (printer.extruders.count > 0)}}
[menu __print fan]
name: {{ gettext('Fan') }}
icon: fan
panel: fan
enable: {{ printer.fans.count > 0 }}
[menu __print move]
name: {{ gettext('Move') }}
icon: move
panel: move
enable: {{ (printer.pause_resume.is_paused == True) }}
[menu __print extrude]
name: {{ gettext('Extrude') }}
icon: filament
panel: extrude
enable: {{ (printer.pause_resume.is_paused == True) and (printer.extruders.count > 0) }}
[menu __print power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ printer.power_devices.count > 0 }}
[menu __print macros]
name: {{ gettext('Macros') }}
icon: custom-script
panel: gcode_macros
enable: {{ printer.gcode_macros.count > 0 }}
[menu __print camera]
name: {{ gettext('Camera') }}
icon: camera
panel: camera
enable: {{ camera_configured }}
[menu __print console]
name: {{ gettext('Console') }}
icon: console
panel: console
[menu __print limits]
name: {{ gettext('Limits') }}
icon: fine-tune
panel: limits
[menu __print network]
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __print retraction]
name: {{ gettext('Retraction') }}
icon: retract
panel: retraction
enable: {{ printer.firmware_retraction }}
[menu __print settings]
name: {{ gettext('Settings') }}
icon: settings
panel: settings
[menu __splashscreen]
name: {{ gettext('Menu') }}
[menu __splashscreen power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ printer.power_devices.count > 0 }}
[menu __splashscreen network]
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __splashscreen system]
name: {{ gettext('System') }}
icon: info
panel: system
enable: {{ moonraker_connected }}
[menu __splashscreen settings]
name: {{ gettext('Settings') }}
icon: settings
panel: settings
+136 -81
View File
@@ -4,6 +4,7 @@ import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GLib
class KlippyFiles:
@@ -11,134 +12,188 @@ class KlippyFiles:
self._screen = screen
self.callbacks = []
self.files = {}
self.directories = []
self.filelist = []
self.gcodes_path = None
def reinit(self):
self.callbacks.clear()
self.files.clear()
self.directories.clear()
self.gcodes_path = None
def set_gcodes_path(self):
virtual_sdcard = self._screen.printer.get_config_section("virtual_sdcard")
if virtual_sdcard and "path" in virtual_sdcard:
self.gcodes_path = os.path.expanduser(virtual_sdcard['path'])
def initialize(self):
if "virtual_sdcard" in self._screen.printer.get_config_section_list():
vsd = self._screen.printer.get_config_section("virtual_sdcard")
if "path" in vsd:
self.gcodes_path = os.path.expanduser(vsd['path'])
logging.info(f"Gcodes path: {self.gcodes_path}")
def reset(self):
self._screen = None
self.callbacks = None
self.files = None
self.filelist = None
self.gcodes_path = None
def _callback(self, result, method, params):
if "error" in result:
logging.debug(result["error"])
return
if method == "server.files.list":
for item in result["result"]:
self.files[item["path"]] = item
self.request_metadata(item["path"])
if "result" in result and isinstance(result['result'], list):
newfiles = []
deletedfiles = self.filelist.copy()
for item in result['result']:
file = item['filename'] if "filename" in item else item['path']
if file in self.files:
deletedfiles.remove(file)
else:
newfiles.append(file)
self.add_file(item, False)
if newfiles or len(deletedfiles) > 0:
self.run_callbacks(newfiles, deletedfiles)
if len(deletedfiles) > 0:
for file in deletedfiles:
self.remove_file(file)
elif method == "server.files.directory":
if "result" in result:
directory = params['path'][7:] if params['path'].startswith('gcodes/') else params['path']
if directory[-1] == '/':
directory = directory[:-1]
newfiles = []
for file in result['result']['files']:
fullpath = f"{directory}/{file['filename']}"
if fullpath not in self.filelist:
newfiles.append(fullpath)
if newfiles:
self.run_callbacks(newfiles)
elif method == "server.files.metadata":
if "error" in result.keys():
logging.debug(f"Error in getting metadata for {params['filename']}. Retrying in 6 seconds")
return
for x in result['result']:
if params['filename'] not in self.files:
self.files[params['filename']] = {}
self.files[params['filename']][x] = result['result'][x]
if 'path' not in self.files[params['filename']]:
self.files[params['filename']]['path'] = params['filename']
if "thumbnails" in self.files[params['filename']]:
self.files[params['filename']]['thumbnails'].sort(key=lambda y: y['size'], reverse=True)
for thumbnail in self.files[params['filename']]['thumbnails']:
thumbnail['local'] = False
if self.gcodes_path is not None:
path = os.path.join(
os.path.dirname(os.path.join(self.gcodes_path, params['filename'])),
thumbnail['relative_path']
)
fpath = os.path.join(self.gcodes_path, params['filename'])
fdir = os.path.dirname(fpath)
path = os.path.join(fdir, thumbnail['relative_path'])
if os.access(path, os.R_OK):
thumbnail['local'] = True
thumbnail['path'] = path
if thumbnail['local'] is False:
thumbnail['path'] = os.path.join(
os.path.dirname(params['filename']),
thumbnail['relative_path']
)
self._screen.process_update("notify_metadata_update", params)
self.run_callbacks(
"modify_file", {'action': "modify_file", 'item': self.files[params['filename']]}
)
fdir = os.path.dirname(params['filename'])
thumbnail['path'] = os.path.join(fdir, thumbnail['relative_path'])
self.run_callbacks(mods=[params['filename']])
def add_file(self, item):
if 'path' not in item:
logging.info(f"Error adding item, unknown path: {item}")
def add_file(self, item, notify=True):
if 'filename' not in item and 'path' not in item:
logging.info(f"Error adding item, unknown filename or path: {item}")
return
self.files[item['path']] = item
self.request_metadata(item['path'])
def remove_file(self, filename):
if filename in self.files:
self.files.pop(filename)
def add_callback(self, callback):
self.callbacks.append(callback)
def remove_callback(self, callback):
if callback in self.callbacks:
self.callbacks.remove(callback)
filename = item['path'] if "path" in item else item['filename']
if filename in self.filelist:
logging.info(f"File already exists: {filename}")
self.request_metadata(filename)
args = None, None, [filename]
GLib.idle_add(self.run_callbacks, *args)
return
logging.info(f"callback not found {callback}")
self.filelist.append(filename)
self.files[filename] = {
"size": item['size'],
"modified": item['modified']
}
self.request_metadata(filename)
if notify is True:
self.run_callbacks(newfiles=[filename])
def add_file_callback(self, callback):
try:
self.callbacks.append(callback)
except Exception as e:
logging.debug(f"Callback not found: {callback}:\n{e}")
def process_update(self, data):
if (
'item' in data and data['item']['root'] != 'gcodes'
or data['action'].endswith("file") and not self.is_gcode(data['item']['path'])
):
if 'item' in data and data['item']['root'] != 'gcodes':
return
if data['action'] == "create_file":
if data['action'] == "create_dir":
self._screen._ws.klippy.get_file_dir(f"gcodes/{data['item']['path']}", self._callback)
elif data['action'] == "create_file":
self.add_file(data['item'])
elif data['action'] == "delete_file":
self.remove_file(data['item']['path'])
elif data['action'] == "modify_file":
self.request_metadata(data['item']['path'])
elif data['action'] == "move_file":
self.files[data['item']['path']] = self.files.pop(data['source_item']['path'])
self.files[data['item']['path']].update(data['item'])
self.run_callbacks(data['action'], data)
self.add_file(data['item'], False)
self.remove_file(data['source_item']['path'], False)
self.run_callbacks(newfiles=[data['item']['path']], deletedfiles=[data['source_item']['path']])
@staticmethod
def is_gcode(path):
return os.path.splitext(path)[1] in {'.gcode', '.gco', '.g'}
def remove_file_callback(self, callback):
if callback in self.callbacks:
self.callbacks.pop(self.callbacks.index(callback))
def file_exists(self, filename):
return filename in self.filelist
def file_metadata_exists(self, filename):
return filename in self.files and "slicer" in self.files[filename]
if self.file_exists(filename):
return "slicer" in self.files[filename]
return False
def get_thumbnail_location(self, filename, small=False):
if all((
small,
len(self.files[filename]['thumbnails']) > 1
)):
if small and len(self.files[filename]['thumbnails']) > 1 \
and self.files[filename]['thumbnails'][0]['width'] > self.files[filename]['thumbnails'][1]['width']:
thumb = self.files[filename]['thumbnails'][1]
else:
thumb = self.files[filename]['thumbnails'][0]
return ['file', thumb['path']] if thumb['local'] else ['http', thumb['path']]
if thumb['local'] is False:
return ['http', thumb['path']]
return ['file', thumb['path']]
def has_thumbnail(self, filename):
return filename in self.files and "thumbnails" in self.files[filename]
if filename not in self.files:
return False
return "thumbnails" in self.files[filename] and len(self.files[filename]) > 0
def request_metadata(self, filename):
if self.is_gcode(filename):
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
else:
logging.info("Not a gcode")
if filename not in self.filelist:
return False
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
def refresh_files(self):
self._screen._ws.klippy.get_file_list(self._callback)
def run_callbacks(self, action, item):
def remove_file(self, filename, notify=True):
if filename not in self.filelist:
return
self.filelist.remove(filename)
self.files.pop(filename, None)
if notify is True:
self.run_callbacks(deletedfiles=[filename])
def run_callbacks(self, newfiles=None, deletedfiles=None, mods=None):
if mods is None:
mods = []
if deletedfiles is None:
deletedfiles = []
if newfiles is None:
newfiles = []
if len(self.callbacks) <= 0:
return False
for cb in self.callbacks:
cb(action, item)
args = newfiles, deletedfiles, mods
GLib.idle_add(cb, *args)
return False
def get_file_info(self, path):
if path not in self.files:
logging.info(f"Metadata not found {path}")
self.request_metadata(path)
return {}
return self.files[path]
def get_file_list(self):
return self.filelist
def get_dir_info(self, directory):
self._screen._ws.klippy.get_dir_info(self._callback, directory=directory)
def get_file_info(self, filename):
if filename not in self.files:
return {"path": None, "modified": 0, "size": 0}
return self.files[filename]
+66 -49
View File
@@ -1,14 +1,17 @@
import ctypes
import logging
import logging.handlers
import os
import struct
import re
import subprocess
import sys
import threading
import time
import traceback
from queue import SimpleQueue as Queue
import ctypes
import struct
dpms_loaded = False
try:
ctypes.cdll.LoadLibrary('libXext.so.6')
@@ -24,63 +27,79 @@ try:
def get_DPMS_state(display_name_in_byte_string=b':0'):
state = DPMS_State.Fail
if not isinstance(display_name_in_byte_string, bytes):
raise TypeError("display_name_in_byte_string must be of type bytes")
display_name = ctypes.c_char_p(display_name_in_byte_string)
raise TypeError
display_name = ctypes.c_char_p()
display_name.value = display_name_in_byte_string
libXext.XOpenDisplay.restype = ctypes.c_void_p
display = ctypes.c_void_p(libXext.XOpenDisplay(display_name))
major_opcode_p = ctypes.create_string_buffer(8)
first_event_p = ctypes.create_string_buffer(8)
dummy1_i_p = ctypes.create_string_buffer(8)
dummy2_i_p = ctypes.create_string_buffer(8)
if display.value:
try:
if libXext.DPMSQueryExtension(display, major_opcode_p, first_event_p) \
and libXext.DPMSCapable(display):
onoff_p = ctypes.create_string_buffer(1)
state_p = ctypes.create_string_buffer(2)
if libXext.DPMSInfo(display, state_p, onoff_p):
onoff = struct.unpack('B', onoff_p.raw)[0]
if onoff:
state = struct.unpack('H', state_p.raw)[0]
finally:
libXext.XCloseDisplay(display)
if libXext.DPMSQueryExtension(display, dummy1_i_p, dummy2_i_p) \
and libXext.DPMSCapable(display):
onoff_p = ctypes.create_string_buffer(1)
state_p = ctypes.create_string_buffer(2)
if libXext.DPMSInfo(display, state_p, onoff_p):
onoff = struct.unpack('B', onoff_p.raw)[0]
if onoff:
state = struct.unpack('H', state_p.raw)[0]
libXext.XCloseDisplay(display)
return state
dpms_loaded = True
except OSError as e:
logging.error(f"Couldn't load DPMS library: {e}")
except Exception as e:
logging.error(f"An unexpected error occurred: {e}")
except Exception as msg:
logging.error(f"Couldn't load DPMS: {msg}")
def get_network_interfaces():
stream = os.popen("ip addr | grep ^'[0-9]' | cut -d ' ' -f 2 | grep -o '[a-zA-Z0-9\\.]*'")
return [i for i in stream.read().strip().split('\n') if not i.startswith('lo')]
def get_wireless_interfaces():
p = subprocess.Popen(["which", "iwconfig"], stdout=subprocess.PIPE)
while p.poll() is None:
time.sleep(.1)
if p.poll() != 0:
return None
try:
p = subprocess.Popen(["iwconfig"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = p.stdout.read().decode('ascii').split('\n')
except Exception as e:
logging.critical(e, exc_info=True)
logging.info("Error with running iwconfig command")
return None
interfaces = []
for line in result:
match = re.search('^(\\S+)\\s+.*$', line)
if match:
interfaces.append(match[1])
return interfaces
def get_software_version():
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always', '--tags', '--long', '--dirty')
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always',
'--tags', '--long', '--dirty')
try:
process = subprocess.Popen(prog, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
process = subprocess.Popen(prog, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
ver, err = process.communicate()
retcode = process.wait()
if retcode == 0:
version = ver.strip()
if isinstance(version, bytes):
version = version.decode()
# Remove the 'g' at the start of the hash
parts = version.split('-')
if len(parts) > 2 and parts[-2].startswith('g'):
parts[-2] = parts[-2][1:] # Remove the 'g'
version = '-'.join(parts)
return version
else:
logging.debug(f"Error getting git version: {err}")
except OSError:
logging.exception("Error running git describe")
logging.exception("Error runing git describe")
return "?"
def parse_bool(value):
return value.lower() == "true"
def patch_threading_excepthook():
"""Installs our exception handler into the threading modules Thread object
Inspired by https://bugs.python.org/issue1230540
@@ -106,29 +125,28 @@ def patch_threading_excepthook():
# Rotating file handler based on Klipper and Moonraker's implementation
class KlipperScreenLoggingHandler(logging.handlers.RotatingFileHandler):
def __init__(self, filename, **kwargs):
def __init__(self, software_version, filename, **kwargs):
super(KlipperScreenLoggingHandler, self).__init__(filename, **kwargs)
self.rollover_info = {
'header': f"{'-' * 20}KlipperScreen Log Start{'-' * 20}",
'version': f"KlipperScreen Version: {get_software_version()}",
'py_ver': f"Python version: {sys.version_info.major}.{sys.version_info.minor}",
'version': f"Git Version: {software_version}",
}
self.log_start()
lines = [line for line in self.rollover_info.values() if line]
if self.stream is not None:
self.stream.write("\n".join(lines) + "\n")
def set_rollover_info(self, name, item):
self.rollover_info[name] = item
def doRollover(self):
super(KlipperScreenLoggingHandler, self).doRollover()
self.log_start()
def log_start(self):
for line in self.rollover_info.values():
logging.info(line)
lines = [line for line in self.rollover_info.values() if line]
if self.stream is not None:
self.stream.write("\n".join(lines) + "\n")
# Logging based on Arksine's logging setup
def setup_logging(log_file):
def setup_logging(log_file, software_version):
root_logger = logging.getLogger()
queue = Queue()
queue_handler = logging.handlers.QueueHandler(queue)
@@ -137,12 +155,11 @@ def setup_logging(log_file):
stdout_hdlr = logging.StreamHandler(sys.stdout)
stdout_fmt = logging.Formatter(
'%(asctime)s,%(msecs)03d [%(filename)s:%(funcName)s] - %(message)s',
'%Y%m%d %H:%M:%S')
'%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s')
stdout_hdlr.setFormatter(stdout_fmt)
fh = listener = None
try:
fh = KlipperScreenLoggingHandler(log_file, maxBytes=4194304, backupCount=1)
fh = KlipperScreenLoggingHandler(software_version, log_file, maxBytes=4194304, backupCount=1)
formatter = logging.Formatter('%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s')
fh.setFormatter(formatter)
listener = logging.handlers.QueueListener(queue, fh, stdout_hdlr)
+54 -308
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-26 12:31-0300\n"
"POT-Creation-Date: 2022-11-30 18:17-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -43,24 +43,21 @@ msgstr ""
msgid "Accept"
msgstr ""
msgid "Add profile"
msgid "Actions"
msgstr ""
msgid "All"
msgid "Add profile"
msgstr ""
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %s%.3f offset to Endstop?"
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.3f offset to Probe?"
msgstr ""
msgid "Archived"
msgid "Apply %s%.2f offset to Probe?"
msgstr ""
msgid "Are you sure do you want to exclude the object?"
@@ -81,9 +78,6 @@ msgstr ""
msgid "Are you sure you wish to shutdown the system?"
msgstr ""
msgid "Asks for confirmation before stopping"
msgstr ""
msgid "Auto"
msgstr ""
@@ -93,9 +87,6 @@ msgstr ""
msgid "Auto-close notifications"
msgstr ""
msgid "Auto-open Extrude On Pause"
msgstr ""
msgid "Auto-scroll"
msgstr ""
@@ -105,7 +96,7 @@ msgstr ""
msgid "Bed Mesh"
msgstr ""
msgid "Both"
msgid "Bed screw configuration:"
msgstr ""
msgid "Calibrate"
@@ -114,10 +105,10 @@ msgstr ""
msgid "Calibrated"
msgstr ""
msgid "Calibrating"
msgid "Calibrated, save configuration to make it permanent"
msgstr ""
msgid "Camera"
msgid "Calibrating"
msgstr ""
msgid "Can't set above the maximum:"
@@ -138,12 +129,6 @@ msgstr ""
msgid "Cannot connect to Moonraker"
msgstr ""
msgid "Changes how the interface looks"
msgstr ""
msgid "Changes how the time remaining is calculated"
msgstr ""
msgid "Channel"
msgstr ""
@@ -159,10 +144,10 @@ msgstr ""
msgid "Close"
msgstr ""
msgid "Close messages after a timeout"
msgid "Complete"
msgstr ""
msgid "Complete"
msgid "Configuration"
msgstr ""
msgid "Confirm Emergency Stop"
@@ -171,62 +156,40 @@ msgstr ""
msgid "Connected"
msgstr ""
msgid "Connecting"
msgstr ""
#, python-format
msgid "Connecting to %s"
msgstr ""
msgid "Connection failed"
msgstr ""
msgid "Console"
msgstr ""
msgid "Continue"
msgstr ""
msgid "Cooldown"
msgstr ""
msgid "Couldn't add network"
msgstr ""
msgid "Current"
msgstr ""
msgid "Current percentage and graph line"
msgstr ""
msgid "DPMS has failed to load and has been disabled"
msgstr ""
msgid "Date"
msgstr ""
msgid "Delete"
msgstr ""
msgid "Delete Directory?"
msgid "Decrease"
msgstr ""
msgid "Delete File?"
msgstr ""
msgid "Deselect"
msgstr ""
msgid "Disable Motors"
msgstr ""
msgid "Disable for 12hs with am / pm"
msgstr ""
msgid "Disconnect"
msgid "Disable XY"
msgstr ""
msgid "Distance (mm)"
msgstr ""
#, python-format
msgid "Do you want to forget or disconnect %s?"
msgstr ""
#, python-format
msgid "Do you want to recover %s?"
msgstr ""
@@ -234,39 +197,12 @@ msgstr ""
msgid "Elapsed:"
msgstr ""
msgid "Emergency Stop"
msgstr ""
msgid "Enable screen power management"
msgstr ""
msgid "Error"
msgstr ""
msgid "Error clearing active spool"
msgstr ""
msgid "Error getting active spool"
msgstr ""
msgid "Error setting active spool"
msgstr ""
msgid "Error trying to fetch spools"
msgstr ""
msgid "Error: Couldn't get a position to probe"
msgstr ""
msgid "Estimated Time"
msgstr ""
msgid "Estimated Time Method"
msgstr ""
msgid "Example"
msgstr ""
msgid "Exclude Object"
msgstr ""
@@ -276,30 +212,18 @@ msgstr ""
msgid "Extrude"
msgstr ""
msgid "Extruders"
msgstr ""
msgid "Extrusion +"
msgstr ""
msgid "Extrusion -"
msgstr ""
msgid "Failed to delete connection"
msgstr ""
msgid "Failed to initialize"
msgstr ""
msgid "Failed, adjust position first"
msgstr ""
msgid "Fan"
msgstr ""
msgid "Filament"
msgstr ""
msgid "Filament Used"
msgstr ""
@@ -318,9 +242,6 @@ msgstr ""
msgid "File:"
msgstr ""
msgid "Filter"
msgstr ""
msgid "Finding ADXL"
msgstr ""
@@ -342,34 +263,25 @@ msgstr ""
msgid "Font Size"
msgstr ""
msgid "For mouse control or to verify touchscreen accuracy"
msgstr ""
msgid "Forget"
msgstr ""
msgid "Full Update"
msgstr ""
msgid "Gcodes"
msgstr ""
msgid "Getting IP address"
msgstr ""
msgid "Go Back"
msgstr ""
msgid "Height:"
msgstr ""
msgid "Hidden"
msgstr ""
msgid "Hide"
msgstr ""
msgid "Hide sensors in Temp."
msgstr ""
msgid "Home"
msgid "Hide temp."
msgstr ""
msgid "Home All"
@@ -387,30 +299,27 @@ msgstr ""
msgid "Home Z"
msgstr ""
msgid "Homing"
msgstr ""
msgid "Host"
msgstr ""
msgid "Hostname"
msgstr ""
msgid "ID"
msgid "Icon Theme"
msgstr ""
msgid "Icon Theme"
msgid "Increase"
msgstr ""
msgid "Initializing printer..."
msgstr ""
msgid "Initiate a PID calibration for:"
msgstr ""
msgid "Input Shaper"
msgstr ""
msgid "Insufficient privileges"
msgstr ""
msgid "Interface"
msgstr ""
@@ -420,12 +329,6 @@ msgstr ""
msgid "Invalid password"
msgstr ""
msgid "Invalid temperature"
msgstr ""
msgid "Inversely affects the icon size"
msgstr ""
msgid "Invert X"
msgstr ""
@@ -435,15 +338,6 @@ msgstr ""
msgid "Invert Z"
msgstr ""
msgid "It may take more than 5 minutes depending on the heater power."
msgstr ""
msgid "It's possible that the configuration is not correct"
msgstr ""
msgid "Job Status"
msgstr ""
msgid "Klipper Restart"
msgstr ""
@@ -462,8 +356,7 @@ msgstr ""
msgid "Klipper will reboot"
msgstr ""
msgid ""
"LOAD_FILAMENT/UNLOAD_FILAMENT are hidden and should be used from extrude"
msgid "KlipperScreen will reboot"
msgstr ""
msgid "Language"
@@ -472,21 +365,9 @@ msgstr ""
msgid "Large"
msgstr ""
msgid "Last Duration"
msgstr ""
msgid "Last Used"
msgstr ""
msgid "Layer Height"
msgstr ""
msgid "Layer:"
msgstr ""
msgid "Leds"
msgstr ""
msgid "Left:"
msgstr ""
@@ -496,15 +377,6 @@ msgstr ""
msgid "Load"
msgstr ""
msgid "Loading..."
msgstr ""
msgid "Lock"
msgstr ""
msgid "Lost Connection to Moonraker"
msgstr ""
msgid "Lower Nozzle"
msgstr ""
@@ -517,19 +389,16 @@ msgstr ""
msgid "Main Menu"
msgstr ""
msgid "Material"
msgstr ""
msgid "Max"
msgstr ""
msgid "Max Acceleration"
msgstr ""
msgid "Max Velocity"
msgid "Max Acceleration to Deceleration"
msgstr ""
msgid "Max:"
msgid "Max Velocity"
msgstr ""
msgid "Maximum"
@@ -547,16 +416,10 @@ msgstr ""
msgid "Medium"
msgstr ""
msgid "Memory"
msgstr ""
msgid "Menu"
msgstr ""
msgid "Minimum Cruise Ratio"
msgstr ""
msgid "Minimum:"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified"
@@ -565,9 +428,6 @@ msgstr ""
msgid "Moonraker: connected"
msgstr ""
msgid "More"
msgstr ""
msgid "Move"
msgstr ""
@@ -580,58 +440,27 @@ msgstr ""
msgid "Network"
msgstr ""
msgid "Network connected"
msgstr ""
msgid "Network disconnected"
msgstr ""
msgid "Network not found"
msgstr ""
msgid "Never"
msgstr ""
msgid "New"
msgstr ""
msgid "No elegible macros:"
msgstr ""
msgid "No info available"
msgstr ""
msgid "No mesh has been loaded"
msgstr ""
msgid "No wireless interface has been found"
msgstr ""
msgid "Not all screens support this"
msgstr ""
msgid "Not working or not configured"
msgid ""
"Not supported for auto-detection, it needs to be configured in klipperscreen."
"conf"
msgstr ""
msgid "Nothing selected"
msgstr ""
msgid "Notification log empty"
msgstr ""
msgid "Notifications"
msgstr ""
msgid "Nozzle diameter"
msgstr ""
msgid "Only for the move panel"
msgstr ""
#, python-format
msgid "Outdated by %d"
msgstr ""
msgid "PSK for"
msgstr ""
msgid "Package will be updated"
msgid_plural "Packages will be updated"
msgstr[0] ""
@@ -640,9 +469,6 @@ msgstr[1] ""
msgid "Part Fan"
msgstr ""
msgid "Password"
msgstr ""
msgid "Password saved"
msgstr ""
@@ -661,30 +487,24 @@ msgstr ""
msgid "Please recompile and flash the micro-controller."
msgstr ""
msgid "Please wait"
msgstr ""
msgid "Power"
msgstr ""
msgid "Power On Printer"
msgstr ""
msgid "Pressure Advance"
msgstr ""
msgid "Pressure Advance:"
msgstr ""
msgid "Pressure advance"
msgstr ""
msgid "Print"
msgstr ""
msgid "Print Control"
msgstr ""
msgid "Print Time"
msgstr ""
msgid "Printer"
msgstr ""
@@ -727,12 +547,6 @@ msgstr ""
msgid "Refresh"
msgstr ""
msgid "Remove network"
msgstr ""
msgid "Rename/Move:"
msgstr ""
msgid "Restart"
msgstr ""
@@ -757,9 +571,6 @@ msgstr ""
msgid "Retrying"
msgstr ""
msgid "Rotation invalid"
msgstr ""
msgid "Save"
msgstr ""
@@ -788,12 +599,16 @@ msgstr ""
msgid "Screws Adjust"
msgstr ""
msgid "Screws not used:"
msgid "Select"
msgstr ""
msgid "Send"
msgstr ""
#, python-format
msgid "Sending Power ON signal to: %s"
msgstr ""
msgid "Set Temp"
msgstr ""
@@ -806,15 +621,6 @@ msgstr ""
msgid "Show Heater Power"
msgstr ""
msgid "Show Scrollbars Buttons"
msgstr ""
msgid "Show cursor"
msgstr ""
msgid "Show only devices that are able to be set"
msgstr ""
msgid "Shutdown"
msgstr ""
@@ -824,15 +630,15 @@ msgstr ""
msgid "Slicer"
msgstr ""
msgid "Slicer Time correction (%)"
msgstr ""
msgid "Slicer:"
msgstr ""
msgid "Small"
msgstr ""
msgid "Smooth time"
msgstr ""
msgid "Speed (mm/s)"
msgstr ""
@@ -848,10 +654,10 @@ msgstr ""
msgid "Square Corner Velocity"
msgstr ""
msgid "Standby"
msgid "Start"
msgstr ""
msgid "Start"
msgid "Starting WiFi Association"
msgstr ""
msgid "Starting recovery for"
@@ -860,9 +666,6 @@ msgstr ""
msgid "Starting update for"
msgstr ""
msgid "Swaps buttons if they are on top of each other, affects other panels"
msgstr ""
msgid "System"
msgstr ""
@@ -872,51 +675,24 @@ msgstr ""
msgid "System Shutdown"
msgstr ""
msgid "System:"
msgstr ""
msgid "Temp (°C)"
msgstr ""
msgid "Temperature"
msgstr ""
msgid "Temperature too low to extrude"
msgstr ""
msgid "The system doesn't meet the minimum requirement"
msgstr ""
msgid "This panel supports up-to 9 screws in a 3x3 Grid"
msgstr ""
msgid "This will affect screw positions and mesh graph"
msgstr ""
msgid "Timeout for screen black-out or power-off"
msgstr ""
msgid "Timeout for screen black-out or power-off during printing"
msgstr ""
msgid "Total:"
msgstr ""
msgid "Unknown Heater"
msgstr ""
msgid "Unknown security type"
msgid "Unknown screw position"
msgstr ""
msgid "Unload"
msgstr ""
msgid "Unlock"
msgstr ""
msgid "Unlock failed"
msgstr ""
msgid "Unretract Extra Length"
msgstr ""
@@ -932,16 +708,7 @@ msgstr ""
msgid "Updating"
msgstr ""
msgid "Useful for un-responsive touchscreens"
msgstr ""
msgid "User"
msgstr ""
msgid "WebRTC is not supported by the backend trying Stream"
msgstr ""
msgid "Working"
msgid "Uploaded"
msgstr ""
msgid "XY Move Speed (mm/s)"
@@ -970,12 +737,7 @@ msgid_plural "commits"
msgstr[0] ""
msgstr[1] ""
msgid "day"
msgid_plural "days"
msgstr[0] ""
msgstr[1] ""
msgid "g"
msgid "dBm"
msgstr ""
msgid "hour"
@@ -983,17 +745,9 @@ msgid_plural "hours"
msgstr[0] ""
msgstr[1] ""
msgid "macros that use 'rename_existing' are hidden"
msgid "minutes"
msgstr ""
msgid "macros with a name starting with '_' are hidden"
msgstr ""
msgid "minute"
msgid_plural "minutes"
msgstr[0] ""
msgstr[1] ""
msgid "mm"
msgstr ""
@@ -1005,11 +759,3 @@ msgstr ""
msgid "mm³/s"
msgstr ""
msgid "s"
msgstr ""
msgid "second"
msgid_plural "seconds"
msgstr[0] ""
msgstr[1] ""
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
Loaded 100 of 445 files, more files were not shown because too many files have changed in this diff. Show more