I want to turn on LED when my printer is off and no gcode´s can be sent.
I thought i could realize this through system commands drop down. But always i try octoprint is crashing and i have to reboot th Pi4 and delte the system command again.
I can run it through ssh but not know if it is not possible to run curl through system commands or there is a failure in my setup.
The command is: curl --header "Content-Type: application/json" --header "X-Api-Key: YOURAPIKEY" --request POST --data '{"command": "toggle_lights"}' http://127.0.0.1/api/plugin/ws281x_led_status
I tried it as curl, python and bash. All of the work via ssh connection but not system command button.
I used abolute paths as well.
I'm sorry, but I'm not quite understanding what you are trying to do. If your printer is off, Octoprint won't be able to connect to it so you won't be able to start a print.
Are you trying to have the light turn on automatically or manually through one of the commands in Octoprint? Why would you need to turn on the light manually if you already know that the printer is off? A little more detail about what you are trying to accomplish would be helpful.
Thank you for the quick response. When my print is done, my printer goes off using PSU Control. If i want to see the result i have to turn on light because it is dark in the room. I want avoid powering and connecting to printer just to turn on the light and power off again. As i know system commands are the only which work when printer is off. My Anycubic does not accept gcode´s when off.
Okay...but you are trying to turn on a light that is connected to your printer or directly to your Pi? If it is connected directly to your pi, you do not have to uses CURL to turn the light on. You're using the WS281x status plugin? That plugin has the ability to add a button to the nav bar so you can turn the lights on directly, without having to use system commands.