WonderMaker ZR: Control Chamber Lighting from Fluidd and Automatically via G-code

Nov 8, 2026 | 3D printing tricks

Want to turn your WonderMaker ZR chamber lights on and off from Fluidd, or automatically at the beginning and end of a print? Here is the procedure we developed and tested on our printer.

Tested on a four-toolhead WonderMaker ZR (T0 to T3), firmware 1.1.13. No firmware flashing, Klipper update or replacement of the Makerbase software is required. We add a small Python module to Klipper, three G-code macros and a Linux service. The touchscreen lighting button continues to work as before.

Compatibility: WonderMaker offers distinct models: the ZR (one toolhead), ZR Ultra and ZR Ultra-S (four toolheads). This method is confirmed only on our printer. It may also work on an unenclosed ZR Ultra if the controller and lighting output are identical, but we have not tested that. Compatibility with the basic ZR and other firmware versions remains unconfirmed. Do not continue if the GPIO test in step 2 gives different results..

1. Connect to the printer via SSH

On Windows, open PuTTY (Option 1): Enter the ZR IP address in Host Name, keep port 22 and connection type SSH, then click Open. Accept the host key after verifying that it belongs to your printer. In Windows Terminal, macOS or Linux (Option 2), use:

ssh t13dp@ADRESSE_IP_DE_LA_ZR

On our installation, the SSH username is t13dpand at the time of writing, the default password is TM88888. Enter the password (nothing appears as you type). The paths and commands below apply to this installation.

2. Identify and verify the lighting GPIO

First, check that the GPIO used by our printer exists:

cat /sys/class/gpio/gpio76/{direction,active_low,value}

On our printer, the first two lines are out and 0. The final line shows the current lighting state: 0 when the LEDs are off and 1 when they are on. Press the touchscreen lighting button and run the command again: the final value should change. If the gpio76 directory is missing or the value does not change, stop here: your version may use different settings.

Next, check that the G-code interfaces used by our module exist in your installed version of Klipper:

grep -nE 'def register_command|def register_mux_command|def run_script_from_command|def get_reactor' /home/t13dp/klipper/klippy/gcode.py /home/t13dp/klipper/klippy/klippy.py

This command should return lines for register_command and get_reactor. It makes no changes.

3. Allow Klipper to access the lights

By default, the GPIO is controlled by root, while Klipper runs as t13dp. For the initial test:

sudo chown t13dp:netdev /sys/class/gpio/gpio76/value && sudo chmod 660 /sys/class/gpio/gpio76/value && test -w /sys/class/gpio/gpio76/value && echo "GPIO76 accessible à Klipper"

Expected result: GPIO76 accessible à Klipper. These temporary permissions will be restored automatically on startup in step 7.

4. Install the small Python module

To create the Python script, paste the entire following block into the SSH terminal, including the sudo tee and PY lines, and press Enter. Do not paste them inside the nano editor: they are shell command delimiters.

sudo tee /home/t13dp/klipper/klippy/extras/zr_light.py >/dev/null <<'PY'
GPIO = "/sys/class/gpio/gpio76/value"

class ZRLight:
    def __init__(self, config):
        gcode = config.get_printer().lookup_object("gcode")
        gcode.register_command("ZR_LIGHT_ON", self.cmd_on)
        gcode.register_command("ZR_LIGHT_OFF", self.cmd_off)
        gcode.register_command("ZR_LIGHT_TOGGLE", self.cmd_toggle)

    def set_light(self, value, gcmd):
        try:
            with open(GPIO, "w") as f:
                f.write(str(value))
        except OSError as e:
            raise gcmd.error("ZR light: %s" % e)

    def cmd_on(self, gcmd):
        self.set_light(1, gcmd)

    def cmd_off(self, gcmd):
        self.set_light(0, gcmd)

    def cmd_toggle(self, gcmd):
        try:
            with open(GPIO, "r") as f:
                current = int(f.read().strip())
        except (OSError, ValueError) as e:
            raise gcmd.error("ZR light: %s" % e)
        self.set_light(0 if current else 1, gcmd)

def load_config(config):
    return ZRLight(config)
PY

Check the syntax of the newly created file:

python3 -m py_compile /home/t13dp/klipper/klippy/extras/zr_light.py && echo "Module valide"

Expected result: Module valide. This operation does not change the LED state.

5. Create the three macros in Fluidd

Create a dedicated configuration file to load the module and display the macros in Fluidd:

cat > /home/t13dp/printer_data/config/zr_light.cfg <<'EOF'
[zr_light]

[gcode_macro LIGHT_ON]
gcode:
    ZR_LIGHT_ON

[gcode_macro LIGHT_OFF]
gcode:
    ZR_LIGHT_OFF

[gcode_macro LIGHT_TOGGLE]
gcode:
    ZR_LIGHT_TOGGLE
EOF

You will then have the commands LIGHT_ON, LIGHT_OFF and LIGHT_TOGGLE. They invoke the corresponding internal commands ZR_LIGHT_ON, ZR_LIGHT_OFF and ZR_LIGHT_TOGGLE.

6. Include the macros and restart Klipper

Back up printer.cfg and add the include directive for the new file (only once):

CFG=/home/t13dp/printer_data/config/printer.cfg; cp -a "$CFG" "$CFG.pre-zr-light"; grep -Fqx '[include zr_light.cfg]' "$CFG" || sed -i '1i[include zr_light.cfg]' "$CFG"

In the console Fluidd, when the printer is idle, enter:

RESTART

The RESTART command reloads the Klipper configuration; it does not flash the firmware. Three new macros should appear in Fluidd. Test each, then make sure the touchscreen lighting button still works.

Note about commands during a print: During certain Klipper wait operations (particularly bed levelling or waiting for the target temperature), the LIGHT_ON, LIGHT_OFF and LIGHT_TOGGLE commands may not execute immediately. They generally run when the printer resumes processing G-code. They work normally when the printer is idle or while printing outside these wait states.

7. Keep permissions after a reboot

Because permissions under /sys/class/gpio are recreated at startup, install this systemd service. It waits for gpio76 to appear and grants access to the t13dp :

sudo tee /etc/systemd/system/zr-light-gpio.service >/dev/null <<'EOF'
[Unit]
Description=ZR internal lighting GPIO permissions
After=makerbase-client.service

[Service]
Type=oneshot
ExecStart=/bin/sh -c 'i=0; while [ ! -e /sys/class/gpio/gpio76/value ]; do i=$((i+1)); [ "$i" -lt 60 ] || exit 1; sleep 1; done; chown t13dp:root /sys/class/gpio/gpio76/value && chmod 600 /sys/class/gpio/gpio76/value'

[Install]
WantedBy=multi-user.target
EOF

Enable the service and apply its permissions immediately:

sudo systemctl daemon-reload && sudo systemctl enable --now zr-light-gpio.service

Check the result:

systemctl show zr-light-gpio.service -p Result -p ExecMainStatus -p UnitFileState; stat -c '%U:%G %a' /sys/class/gpio/gpio76/value

Expected results: Result=success, ExecMainStatus=0, UnitFileState=enabled and t13dp:root 600. A service state of inactive (dead) is normal for a service of type oneshot : it exits once the permissions have been applied.

After fully rebooting the ZR, test the Fluidd macros and the touchscreen button again. Both still work on our printer.

8. Turn the LEDs on and off automatically during prints

In Wonderprint-Orca, switch to Advanced, then open the printer profile and the Machine G-codesection. Under Machine start G-code, add this line at the very beginning of the existing script:

LIGHT_ON

In Machine end G-code, add:

LIGHT_OFF

In a profile whose end-of-print routine uses PRINT_END, place LIGHT_OFF immediately before the PRINT_ENDline so the lights turn off before the macro resets the print file. Keep all other original commands, including START_PRINT and PRINT_END.

These additions apply to the normal completion of a job sliced using this profile. Cancelling a print, an error or G-code from another profile may not trigger LIGHT_OFF. Manual lighting controls remain available at any time.

9. Change the default SSH password

Because SSH provides access to the printer configuration and could compromise the security of your printer and local network, take this opportunity to change the password for the t13dpaccount. In your SSH session:

passwd

Enter the current password, then the new password twice. Nothing appears as you type. Keep the session open while you test a new SSH connection with the new password. This changes the Linux password for the signed-in account without altering the firmware.

 

Did this guide help you?

Having to use the touchscreen every time we wanted to control our WonderMaker ZR chamber lights was extremely frustrating! So we decided to fix it and share a solution we could not find documented anywhere else.

If this guide saved you a few hours of searching and frustration, we would really appreciate a small favour: Share the good news!

And if you have already done business with our family-run company (Impression 3D Québec / 3D Prints Canada), we would also love to hear about your experience in a Google review.

Happy printing!

 

Notes and references

This procedure documents a real-world test on firmware 1.1.13, not a feature officially supported by WonderMaker across all ZR models (although we think it should be a basic feature! ;)). It does not install KIAUH or gcode_shell_command, nor does it modify the proprietary makerbase-clientbinary. It adds code to the existing Klipper installation: after a major update, make sure the zr_light.py module is still present.

Documentation: WonderMaker models and support · Klipper G-code commands · OrcaSlicer Machine G-code.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *