Zmod_en - ghzserg/zmod GitHub Wiki

Zmod

Прочитать на русском языке

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

CAMERA_ON

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)
  • FS1 = 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.

Top


CAMERA_OFF

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)

Top


CAMERA_RESTART

Restart the alternative camera implementation.

Top


REMOVE_ZMOD

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.

Top


SKIP_ZMOD

Reboot into the original system without Zmod. Disables Zmod, Moonraker, and Fluidd configurations. Remaining active:

  • Alternative camera
  • SSH

Top


TAR_CONFIG

Backup configuration files into an archive. Download the archive via: Configuration → mod_data → config.tar

Top


RESTORE_TAR_CONFIG

Restore configurations from the config.tar archive. Upload the archive to: Configuration → mod_data → config.tar

Top


ZFLASH

Update firmware via network using a USB drive.

  1. Insert the USB drive into the printer and power it on.
  2. If using without the native screen, ensure the USB is inserted before powering on.
  3. This macro checks for the latest release, downloads it to the USB, verifies the MD5 hash, and installs it after reboot.

Top


STOP_ZMOD

Unload Moonraker, Fluidd/Mainsail, and Telegram Bot from memory.

Top


START_ZMOD

Reload Moonraker and Fluidd/Mainsail after using STOP_ZMOD.

Top


ZSSH_ON

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 in mod/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).

Telegram Bot details

Top


ZSSH_OFF

Disable SSH client.

Top


ZSSH_RESTART

Restart the SSH client.

Top


ZSSH_RELOAD

Reload SSH client if not running. This macro is triggered at the start of prints (via START_PRINT).

Top


ZRESTORE

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.

Back Top Forward

⚠️ **GitHub.com Fallback** ⚠️