2025年8月7日 星期四

修改 Klipper LCD 螢幕的 menu

在 Klipper 的 LCD 的功能表中,增加一些功能,方便使用。

顯示 IP

在 LCD 顯示 IP,參考 goopypanther/klipper_network_status。參考它的說明,執行 install.sh。或是直接將 network_status.py 複製到 ~/klipper/klippy/extras/ 目錄下,再重新開機,就會生效。然後依照說明,在 printer.cfg 建立功能表。

[menu __main __system]
type: list
name: System

[menu __main __system __network]
type: list
name: Network

[menu __main __system __network _mdns]
type: command
name: mDNS: {printer.network_status.mdns}

[menu __main __system __network _ethip]
type: command
name: Eth IP: {printer.network_status.ethip}

[menu __main __system __network _wifissid]
type: command
name: Wifi SSID: {printer.network_status.wifissid}

[menu __main __system __network _wifiip]
type: command
name: Wifi IP: {printer.network_status.wifiip}

我是放在 [System] 的子功能表之下。


關機功能

參考 Shutdown host from menu with mainsail?

Klipper 是在 Linux 系統下執行,最好執行 shutdown 指令,關閉系統後,再關閉電源,以免資料流失。

首先,透過 kiauh 的 "4) [Advanced]",安裝 "Extras: 8) [G-Code Shell Command]"。

# shell command
[gcode_shell_command reboot_host]
command: reboot

[gcode_shell_command shutdown_host]
command: shutdown now

# 功能表
[menu __main __system __reboot_host]
type: command
name: Reboot Host
gcode:
    M117 Reboot Host
    { menu.exit() }
    RUN_SHELL_COMMAND CMD=reboot_host

[menu __main __system __shutdown_host]
type: command
name: Shutdown Host
gcode:
    M117 Shutdown Host
    { menu.exit() }
    RUN_SHELL_COMMAND CMD=shutdown_host




沒有留言:

張貼留言

網誌存檔