Zmod_en - ghzserg/zmod GitHub Wiki
A macro is a small program written in Klipper/Gcode language.
It can be called from:
- A GCODE file
- The Fluidd/Mainsail console (press the English letter
C
in Fluidd)
Note
The value in parentheses is the default value
🔷 Zmod 🔷 |
|||
---|---|---|---|
CAMERA_OFF | CAMERA_ON | CAMERA_RESTART | ZFLASH |
TAR_CONFIG | RESTORE_TAR_CONFIG | START_ZMOD | STOP_ZMOD |
ZSSH_OFF | ZSSH_ON | ZSSH_RELOAD | ZSSH_RESTART |
REMOVE_ZMOD | SKIP_ZMOD | ZRESTORE |
Enable alternative camera implementation. Parameters:
-
WIDTH
— image width (default:640
) -
HEIGHT
— image height (default:480
) -
FPS
— frames per second (default:20
) -
VIDEO
— video device (default:video0
) -
FS
—1
= enable frame size limiter for unstable cameras,0
= disable (default:0
)
Disable the camera on the printer's screen before calling this macro.
RAM usage for stock cameras:
- 640x480: 2.9 MiB
- 1280x720: 7.8 MiB
- 1920x1080: 18.1 MiB
Many AliExpress/Ozon/Wildberries cameras always consume 18 MiB.
Note
Disable alternative camera implementation. Parameters:
-
WIDTH
— image width (default:640
) -
HEIGHT
— image height (default:480
) -
FPS
— frames per second (default:20
) -
VIDEO
— video device (default:video0
)
Restart the alternative camera implementation.
Uninstall Zmod.
-
FULL
:0
= keep/opt/config/mod_data
,1
= delete/opt/config/mod_data
(default:0
)
The /opt/config/mod_data
directory stores configurations for zmod
, fluidd
, moonraker
, and mainsail
.
It is not deleted by default to prevent accidental data loss.
Reboot into the original system without Zmod. Disables Zmod, Moonraker, and Fluidd configurations. Remaining active:
- Alternative camera
- SSH
Backup configuration files into an archive. Download the archive via: Configuration → mod_data → config.tar
Restore configurations from the config.tar
archive.
Upload the archive to: Configuration → mod_data → config.tar
Update firmware via network using a USB drive.
- Insert the USB drive into the printer and power it on.
- If using without the native screen, ensure the USB is inserted before powering on.
- This macro checks for the latest release, downloads it to the USB, verifies the MD5 hash, and installs it after reboot.
Unload Moonraker, Fluidd/Mainsail, and Telegram Bot from memory.
Reload Moonraker and Fluidd/Mainsail after using STOP_ZMOD
.
Enable SSH tunneling. Parameters:
-
SSH_SERVER
— remote SSH server IP/hostname -
SSH_PORT
— SSH port (default:22
) -
SSH_USER
— remote server username -
VIDEO_PORT
— remote server port for video streaming (default:8080
) -
MOON_PORT
— remote server port for Moonraker (default:7125
) -
REMOTE_enN
— command to execute on the remote server (default:"NONE"
). Example: Use./ff5m.sh bot1
(located inmod/telegram/
) to restart the Telegram bot.
Setup script (if not installed via one-command):
su - tbot # Switch to the bot service user
wget --cache=off -q -O ff5m.sh https://raw.githubusercontent.com/ghzserg/zmod_ff5m/main/telegram/ff5m.sh
chmod +x ff5m.sh
Example usage in Fluidd/Mainsail console:
ZSSH_ON SSH_SERVER=remote.server.ru SSH_PORT=22 SSH_USER=tbot VIDEO_PORT=8080 MOON_PORT=7125 REMOTE_enN="./ff5m.sh bot1"
SSH starts 3 minutes after Klipper boots and automatically restarts at the beginning of prints (via START_PRINT
macro).
Disable SSH client.
Restart the SSH client.
Reload SSH client if not running.
This macro is triggered at the start of prints (via START_PRINT
).
Resume printing after power loss or printer errors.
Requirements:
- Native screen must be disabled (native recovery conflicts with ZRESTORE).
- Printed filename must not start with a number.