What is the problem?
I added some scripts to my config.yaml (in ~/.octoprint/config.yaml) to be called when certain print events happen, but they never get called.
What did you already try to solve it?
I made sure the script was working correctly by running it normally.
I also tried resetting the raspberry pi (I have the stock octoprint image, and octoprint is version 1.3.7, according to the 'about Octoprint" in the settings menu).
I looked up some examples from other people, but mine looks the same to me.
Additional information about your setup
Here is what I added to the bottom of my config.yaml file:
events: enabled: True subscriptions: - event: PrintStarted command: /home/scripts/toggleLights.py 1 type: system - event: PrintDone command: /home/scripts/toggleLights.py 2 type: system - event: PrintFailed command: /home/scripts/toggleLights.py 3 type: system - event: PrintCancelled command: /home/scripts/toggleLights.py 4 type: system
Then this is the script that should run (and works when I run it normally):
#! /usr/bin/python import sys import time print "Lights would have been toggled!" f = open("/home/pi/test"+ str(time.time()) + ".txt",'w') f.write("test!\n"); f.write(str(sys.argv)); f.close();