Is there a way to switch the camera's LED via the web interface (Mainsail)?

And what is the solution ?
There is so much propositions in this thread.

I’ve already marked the solution. I can’t explain it any better than onnlucky. The problem is, as described, the display. It gets exclusive access to the GPIO PIN and doesn’t release it. That’s why the Python script is needed. How you then integrate the switch into Mainsail is irrelevant. Various options were shown. However, it would be cleaner if MKS adapted its display software accordingly and released the port. That would significantly reduce the effort.

hey, just wanted to say your python script worked perfectly, so thank you. On a SV06 Plus Ace

Thanks go to @opnnlucky. I haven’t tested that on the SV06 plus ACE.

I can confirm that the patch and procedure works for the SV06 “ACE” [not the “Plus”].

“Let there be light…”

Thank you @onnlucky & @Oliver!

A cautionary tale. With the use of a customized build and modified configuration file, if you should revert to the factory build and forget to revert the configuration file, you will end up in an endless loop of this error message making your unit unusable:

7:03 PM
MCU ‘rpi’ shutdown: Unable to open out GPIO chip line
7:03 PM
MCU ‘rpi’ shutdown: Unable to open out GPIO chip line
Once the underlying issue is corrected, use the
“FIRMWARE_RESTART” command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown
Klipper state: Not ready

I recommend having two files:

/home/sovol/printer_data/build/README_WARNING_CUSTOM_BUILD.md
/home/sovol/printer_data/config/README_WARNING_CUSTOM_BUILD.md

with the following:



#
# 3/29/2026 jlpoole
#
#file: /home/sovol/printer_data/build/README_WARNING_CUSTOM_BUILD.md
#


WARNING:
This directory has one or more builds which consist of the original factory build, mksclient.backup, and then any other builds, e.g. mksclient_camera_light_20260320_1612.BAK.  The method for switching between the two is by soft link with the name “mksclient” – this is what Sovol is booting with.

To switch between,
     cd ~/printer_data/build
     # remove existing link
     unlink mksclient
     # select only one below:
     # point to manufacturer’s build
     #links -s mksclient.backup mksclient
     # or point to cusomized build
     #link -s mksclient_camera_light_20260320_1612.BAK mksclient

IMPORTANT: if you switch, you also need to switch the configuration file or rem out the additions.  For instance, to build the camera_light build, an entry had to be added to ~/printer_data/config/printer.cfg

Example:

sovol@sovol:~/printer_data$ cat  -n config/printer.cfg|grep -B 1 -A 7 jlpoole
323  #
324  # 3/20/26 jlpoole:
325  # per https://forum.sovol3d.com/t/is-there-a-way-to-switch-the-cameras-led-via-the-web-interface-mainsail/6260/11
326  # script saved in ~/scripts
327  #
328  [output_pin cameralight]
329  pin: rpi:gpiochip2/gpio3
330
331  #*# <---------------------- SAVE_CONFIG ---------------------->
sovol@sovol:~/printer_data$

If the above-modified print.cfg is used against the manufacturer’s build, the SV06 “ACE” will go into a continuous loop at start-up with the cryptic error message:

7:03 PM
MCU 'rpi' shutdown: Unable to open out GPIO chip line
7:03 PM
MCU 'rpi' shutdown: Unable to open out GPIO chip line
Once the underlying issue is corrected, use the
"FIRMWARE_RESTART" command to reset the firmware, reload the
config, and restart the host software.
Printer is shutdown
Klipper state: Not ready

The above error message does not alert you that it is complaining about the supposed pin referenced above at lines 328-239, so you have no clue what is causing the problem.  This file is to remind/warn you that if you switch builds, you may also have to resurrect the associated printer.cfg.

Anecdote:
John switched to the camera-light build and then later on when the printer had problems with the thermistor (which John inadvertantly strained having not watched the video about chanding the printer heads), John switched back to the factory setting.  After the new nozzle heater head with thermistor was installed, all the signs were that the temperature readings of the printer head were working.  But when the unit booted up, it became trapped in a continuous loop with the above error message because John had not reverted to the factory configuration file.  (What he did was just switch back the camera-light build and then everything startied working normally.)

An accompany README_WARNING_CUSTOM_BUILD.md is saved in the config directory with this text:

 If this machine has a custom build, see critical ~/printer_data/build/README_WARNING.md