Snapmaker 2 Enclosure control from OctoPrint

If you use OctoPrint you can add custom controls.
image

To add light and fan speed add the following to your config.yaml

controls:
-   children:
    -   command: M1010 S3 P%(inten)s
        confirm: null
        default: ''
        input:
        -   default: 0
            name: Intensity
            parameter: inten
            slider:
                max: '100'
                min: '0'
                step: '5'
        name: Apply
        regex: ''
        template: ''
    -   command: M1010 S4 P%(fan)s
        confirm: null
        default: ''
        input:
        -   default: 0
            name: Fan speed
            parameter: fan
            slider:
                max: '100'
                min: '0'
                step: '5'
        name: Apply
        regex: ''
        template: ''
    layout: vertical
    name: Enclosure
10 Likes

Thank you so much for this! Just got a new RPi for running octoprint to monitor my snapmaker! You even get more functionality than through the little tablet which is great!

1 Like

Hello, I’m connected with ssh to the octoprint on my pi3 and I want to edit the config.yaml but I don’t know where to find this file and if I can edit it with nano editor ? Can you help me with that please ?

Think you may look at octopi forum

1 Like

I’ve used Custom Control Editor Plugin for now… Haven’t got sliders at the moment but I can control Fan and Leds with 0, 50 and 100 buttons ! That’s a beginning…

1 Like

Been looking for something like this, saved me from having to do it myself.

ON / Off buttons and sliders

controls:
-   children:
    -   command: M1010 S3 P%(inten)s
        confirm: null
        default: ''
        input:
        -   default: 0
            name: Brightness
            parameter: inten
            slider:
                max: '100'
                min: '0'
                step: '5'
        name: Apply
        regex: ''
        template: ''
    -   command: M1010 S3 P100
        name: 'On'
        type: command
    -   command: M1010 S3 P0
        name: 'Off'
        type: command
    -   command: M1010 S4 P%(fan)s
        confirm: null
        default: ''
        input:
        -   default: 0
            name: Fan speed
            parameter: fan
            slider:
                max: '100'
                min: '0'
                step: '5'
        name: Apply
        regex: ''
        template: ''
    -   command: M1010 S4 P100
        name: 'On'
        type: command
    -   command: M1010 S4 P0
        name: 'Off'
        type: command
    layout: horizontal
    name: Enclosure
4 Likes

Hi,

I want to use octoprint as monitor too. Do you send the job with Luban to the sm2 via wifi? Or do you use octoprint to send the job?

Greetings,

Marcel

If you want to use octoprint to monitor the job then send the job to octoprint. Octoprint won’t be able to monitor jobs sent via Luban to the snapmaker main controller.

Octoprint also allows you to tweak marlin settings directly via the console from another computer as it is plugged directly to the USB serial port something you cannot do connectedto the SM in Luban via wi-fi.

Did someone manage to control the air purifier the same way? Maybe with a warning about the Filter percentage?

1 Like

How do you level your beds automatically via octoprint? Is this possible?

1 Like

Also look here: https://forum.snapmaker.com/t/full-octoprint-cura-setup