Multiple Event Driven @Execute commands

Hi Guys. I have commands set up for each of my printers to send a push notification via pushbullet, wait for 10 minutes and turn off the Sonoff Basic powering the printer. These have been working perfectly. Because I am now printing Covid face shields practically 24/7 I have separated the command files and added extra lines to the extcommands.xml so there is a command for the notification and a separate one for turning off the Sonoff. So, in the 'Run After Job' event driven area, I have 2 lines, one for the notification, the other for the power off:

@execute e3rdone
@execute e3rdelayoff

It was my intention to comment out the power off during the day and uncomment when I set the last print of the day and go to bed.

The issue I have is that the second command never runs. I've tested them both individually and they work fine. Is it the case that you can only have one @execute line for event driven gcode or am I stupidly missing something?

Thanks
John

Comments

  • No you can have any number of @execute commands. How are they configured in extcommands.xml? If you have sync flag active the returned error code can stop further execution.

    PS: In next release there is new event shutdown after print and you can activate to run shutdown script in the printer menu. So no modifications needed any more then.
  • That's what I was thinking.
    Line in extcommands is:
    <execute name="e3delayoff" allowParams="false">bash /home/pi/scripts/e3delayoff.sh</execute>

    The corresponding e3delayoff.sh code is:

    #!/bin/bash
    sleep 10m
    curl -u o.9mGG1TrvWgJqLz3hhOIkuoMCMo5IejRR: -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "Printer Turned Off", "body": "Ender 3 Turned Off"}'

    Nice to hear about the addition to the next release :-)
  • In this context e3rdone would be the one relevant for next execution. Maybe just add as last line
    exit 0
    so it never returns an error code. Bur they should be started asynchroneously anyway so they run in parallel.
Sign In or Register to comment.