[DSF Extension] Exec On MCode (was: Shutdown SBC)
-
@wilriker
this the output:pi@CCC:~ $ sudo /usr/local/bin/execonmcode -mCode 7722 -command poweroff -debug -trace 2021/05/20 20:27:38 7722: poweroff 2021/05/20 20:27:38 [DEBUG] <Recv> {"version":11,"id":114} 2021/05/20 20:27:38 [DEBUG] <Send> {"Mode":"Intercept","Version":10,"InterceptionMode":"Pre","Channels":["HTTP","Telnet","File","USB","Aux","Trigger","Queue","LCD","SBC","Daemon","Aux2","AutoPause","Unknown"],"Filters":["M7722"],"PriorityCodes":false} 2021/05/20 20:27:38 [DEBUG] <Recv> {"success":true} 2021/05/20 20:27:38 [DEBUG] <Connect> Connection established 2021/05/20 20:27:47 Connection to DCS closed 2021/05/20 20:27:47 [DEBUG] <Close> Closing connection 2021/05/20 20:27:47 EOF pi@CCC:~ $ sudo journalctl -eu duetcontrolserver May 20 18:31:16 CCC DuetControlServer[424]: [warn] IPC#67: Client with outdated protocol version connected (got 10, want 11) May 20 18:40:55 CCC DuetControlServer[424]: [warn] IPC#69: Client with outdated protocol version connected (got 10, want 11) May 20 18:43:43 CCC DuetControlServer[424]: [warn] IPC#70: Client with outdated protocol version connected (got 10, want 11) May 20 18:44:42 CCC DuetControlServer[424]: [warn] IPC#72: Client with outdated protocol version connected (got 10, want 11) May 20 18:45:54 CCC DuetControlServer[424]: [warn] IPC#75: Client with outdated protocol version connected (got 10, want 11) May 20 18:46:20 CCC DuetControlServer[424]: [warn] IPC#77: Client with outdated protocol version connected (got 10, want 11) May 20 18:46:25 CCC DuetControlServer[424]: [warn] IPC#78: Client with outdated protocol version connected (got 10, want 11) May 20 18:47:03 CCC DuetControlServer[424]: [warn] IPC#80: Client with outdated protocol version connected (got 10, want 11) May 20 18:47:06 CCC DuetControlServer[424]: [warn] IPC#81: Client with outdated protocol version connected (got 10, want 11) May 20 18:47:58 CCC DuetControlServer[424]: [warn] IPC#83: Client with outdated protocol version connected (got 10, want 11) May 20 18:48:08 CCC DuetControlServer[424]: [warn] IPC#85: Client with outdated protocol version connected (got 10, want 11) May 20 18:58:23 CCC DuetControlServer[424]: [info] Starting macro file homeall.g on channel HTTP May 20 18:58:23 CCC DuetControlServer[424]: [info] Starting macro file homey.g on channel HTTP May 20 18:58:28 CCC DuetControlServer[424]: [info] Finished macro file homey.g May 20 18:58:28 CCC DuetControlServer[424]: [info] Starting macro file homex.g on channel HTTP May 20 18:58:32 CCC DuetControlServer[424]: [info] Finished macro file homex.g May 20 18:58:32 CCC DuetControlServer[424]: [info] Starting macro file homez.g on channel HTTP May 20 18:58:47 CCC DuetControlServer[424]: [info] Starting macro file bed.g on channel HTTP May 20 18:59:14 CCC DuetControlServer[424]: [info] Finished macro file bed.g May 20 18:59:15 CCC DuetControlServer[424]: [info] Finished macro file homez.g May 20 18:59:15 CCC DuetControlServer[424]: [info] Finished macro file homeall.g May 20 20:26:35 CCC DuetControlServer[424]: [warn] IPC#109: Client with outdated protocol version connected (got 10, want 11) May 20 20:27:38 CCC DuetControlServer[424]: [warn] IPC#114: Client with outdated protocol version connected (got 10, want 11) lines 74-96/96 (END)
-
@wilriker
and with the absolute path:pi@CCC:~ $ sudo /usr/local/bin/execonmcode -mCode 7722 -command /usr/bin/poweroff -debug -trace 2021/05/20 20:31:12 7722: /usr/bin/poweroff 2021/05/20 20:31:12 [DEBUG] <Recv> {"version":11,"id":117} 2021/05/20 20:31:12 [DEBUG] <Send> {"Mode":"Intercept","Version":10,"InterceptionMode":"Pre","Channels":["HTTP","Telnet","File","USB","Aux","Trigger","Queue","LCD","SBC","Daemon","Aux2","AutoPause","Unknown"],"Filters":["M7722"],"PriorityCodes":false} 2021/05/20 20:31:12 [DEBUG] <Recv> {"success":true} 2021/05/20 20:31:12 [DEBUG] <Connect> Connection established 2021/05/20 20:31:48 Connection to DCS closed 2021/05/20 20:31:48 [DEBUG] <Close> Closing connection 2021/05/20 20:31:48 EOF pi@CCC:~ $ sudo journalctl -eu duetcontrolserver May 20 18:44:42 CCC DuetControlServer[424]: [warn] IPC#72: Client with outdated protocol version connected (got 10, want 11) May 20 18:45:54 CCC DuetControlServer[424]: [warn] IPC#75: Client with outdated protocol version connected (got 10, want 11) May 20 18:46:20 CCC DuetControlServer[424]: [warn] IPC#77: Client with outdated protocol version connected (got 10, want 11) May 20 18:46:25 CCC DuetControlServer[424]: [warn] IPC#78: Client with outdated protocol version connected (got 10, want 11) May 20 18:47:03 CCC DuetControlServer[424]: [warn] IPC#80: Client with outdated protocol version connected (got 10, want 11) May 20 18:47:06 CCC DuetControlServer[424]: [warn] IPC#81: Client with outdated protocol version connected (got 10, want 11) May 20 18:47:58 CCC DuetControlServer[424]: [warn] IPC#83: Client with outdated protocol version connected (got 10, want 11) May 20 18:48:08 CCC DuetControlServer[424]: [warn] IPC#85: Client with outdated protocol version connected (got 10, want 11) May 20 18:58:23 CCC DuetControlServer[424]: [info] Starting macro file homeall.g on channel HTTP May 20 18:58:23 CCC DuetControlServer[424]: [info] Starting macro file homey.g on channel HTTP May 20 18:58:28 CCC DuetControlServer[424]: [info] Finished macro file homey.g May 20 18:58:28 CCC DuetControlServer[424]: [info] Starting macro file homex.g on channel HTTP May 20 18:58:32 CCC DuetControlServer[424]: [info] Finished macro file homex.g May 20 18:58:32 CCC DuetControlServer[424]: [info] Starting macro file homez.g on channel HTTP May 20 18:58:47 CCC DuetControlServer[424]: [info] Starting macro file bed.g on channel HTTP May 20 18:59:14 CCC DuetControlServer[424]: [info] Finished macro file bed.g May 20 18:59:15 CCC DuetControlServer[424]: [info] Finished macro file homez.g May 20 18:59:15 CCC DuetControlServer[424]: [info] Finished macro file homeall.g May 20 20:26:35 CCC DuetControlServer[424]: [warn] IPC#109: Client with outdated protocol version connected (got 10, want 11) May 20 20:27:38 CCC DuetControlServer[424]: [warn] IPC#114: Client with outdated protocol version connected (got 10, want 11) May 20 20:27:57 CCC DuetControlServer[424]: [warn] IPC#116: Client with outdated protocol version connected (got 10, want 11) May 20 20:31:12 CCC DuetControlServer[424]: [warn] IPC#117: Client with outdated protocol version connected (got 10, want 11) May 20 20:31:58 CCC DuetControlServer[424]: [warn] IPC#119: Client with outdated protocol version connected (got 10, want 11) lines 77-99/99 (END)
-
@crazycreator Hm, there is something strange here. I can now reproduce your issue. I have to investigate that.
EDIT: It seems that you discovered a but in DCS 3.3-rc2 (and possibly earlier) that will be fixed in the next RC (I have to confirm that still).
-
@wilriker
Why does this always have to happen to me?Which RRF version do you use?
How long do you think it will take to get to the RC? -
@crazycreator It's not RRF but DSF (DCS to be exact) that has that problem. And the next RC is planned to be released within the next couple of days unless important issues will postpone it.
-
@wilriker
then I will probably have to wait ... or you can send me an image of your SD card -
@wilriker - just adding in that I'm experiencing the same thing on 3.3rc2.. I was able to capture it from a console when running below.
Do you know if the issue has been found and is being corrected in 3.3rc3? Any interim builds out there floating around I could download to get past this issue?
Thanks
-
@oozebot said in [DSF Extension] Exec On MCode (was: Shutdown SBC):
Any interim builds out there floating around I could download to get past this issue?
You could test with this build but be aware there are other potential issues.
https://www.dropbox.com/sh/1bblsmpe8m6kb0p/AAD4J_9-uEEnr-Rvh3OjlXyZa?dl=0
-
@CrazyCreator @oozeBot I can confirm that this bug will be fixed with DSF v3.3-rc3.
-
@oozebot said in [DSF Extension] Exec On MCode (was: Shutdown SBC):
Any interim builds out there floating around I could download to get past this issue?
There are no interim builds of DSF available. You would have to build it yourself from sources. What @Phaedrux posted was "only" preliminary builds of RRF 3.3-rc3.
-
With the new release 3.3RC3 it works
Now I have to put the code for power off the shelly-pm in my shutdownsbc.service
next adventure for me
-
here I am ... can someone help me again?
After the update, execonmode now works wonderfully.
But unfortunately I can't start the web call to switch the shelly off.
Unfortunately i can't really work with the console. So it would be nice if someone could take me by the hand and show me the right way so that I know what I can try or test where.
So I want to achieve the following:
when a certain MCode is called, my Shelly 1PM should be switched off.
This would work in my case with the following command:
http://192.168.1.47/relay/0?turn=offIf I enter this line in a browser (of course only at home in my own network) the Shelly switches off.
My goal is now to achieve this via Execonmcode.
please help me
-
@crazycreator this should probably be itβs own thread.. but youβll need to code a shell script to accomplish this. Here is something similar I did for Wemo. Maybe you can take some hints from it.
https://forum.duet3d.com/topic/18989/script-to-control-wemos-from-gcode-using-dsf
-
@oozebot
I answered you there once -
Is execonmcode blocking? Meaning if I make an M1999 Mcode which executes a command that takes a moment will my Duet pause till the script is finished?
EDIT: Found my own answer.
-
@cthulhulabs said in [DSF Extension] Exec On MCode (was: Shutdown SBC):
EDIT: Found my own answer.
What's the answer?
-
@phaedrux said in [DSF Extension] Exec On MCode (was: Shutdown SBC):
What's the answer?
The answer is that it depends on whether or not you use the
-execAsync
flag when startingexeconmcode
. If you do it won't block and if you omit it it will wait until the command has finished. -
@wilriker said in [DSF Extension] Exec On MCode (was: Shutdown SBC):
@oozeBot said in [DSF Extension] Exec On MCode (was: Shutdown SBC):
@wilriker Could you please provide a simple example of using the -returnOutput flag? Thanks
Simple example:
execonmode -mCode 7777 -command "whoami" -returnOutput
will not just confirm successful completion of the command but as part of this return the output of
whoami
(that returns the userexeconmcode
is started as, so probablyroot
) so you can see it e.g. in DWC.Digging this back up.. Does anyone know if it is possible to assign the -returnOutput to a variable?
-
-
Just replying here to point to the python version:
https://forum.duet3d.com/topic/29783/execonmcode-v0-1 -
-