[3.5.1] Macro restarting
-
I've been doing a bunch of experimentation on an SBC driven system with, sd jobs, macros, pause, resume, M400, and dsf-python.
I've encountered some issues and general unreliable results when triggering commands and macros from various code channels, especially when interacting with pause/resume during a file. So I preceded to try and create some minimal examples that showcase my issues. When trying to create a control example (without all the channel stuff) I came across this issue with macros.
Steps to replicate:
- Fresh 64 bit duetpi install on RPI4,
sudo apt-get update
,sudo apt-get upgrade
(everything is at 3.5.1) - Upload of my config.g
- Change LogLevel to
debug
in/opt/dsf/conf/config.json
- Reboot
- Home
- Upload of a gcode file test_custom_code_in_file.nc.g (added .g) for upload
- Upload of a macro move_x_macro.g
- Running of
test_custom_code_in_file.nc
produces expected effect, machine moves down in the Y axis, enters macro, moves over on X axis, finishes macro, and then continues to move down in Y.sudo journalctl --unit duetcontrolserver -f
gives the following output during: normal_file_w_macro_nopause.log.g - While running
test_custom_code_in_file.nc
, the user hits pause in dwc while the x axis is moving. The macro completes and the x axis moves out to a value of 400. - User presses resume, and the macro is re-executed the X axis goes back to around 0, and repeats the motion out to 400. normal_file_w_macro_pause.log.g
As far as I know, unless the macro has an
M98 R1
(which mine does not have) , the file should resume directly after theM98
call. I tried adding anM98 R0
command to the beginning, but got the same result.For macros that toggle physical systems, i.e tool-change-like actions, a repeat like this can cause a crash.
My eventual goal here is to figure out how to pause a file without the fear of a macro being repeated.
Then I can move on to to diagnosing my other issues.
Thanks
TEdit:
I tried going back to 3.4.6, and things functioned in the way I would expect. The macro did not restart after resuming. - Fresh 64 bit duetpi install on RPI4,
-
@tristanryerparke This sounds somewhat similar to the issue reported here: https://forum.duet3d.com/topic/35544/resume-g-activating-twice-with-fw3-5
It's on the list for @dc42 to have a look at. I'll alert him to this thread.Ian
-
@droftarts Thanks.
Is it possible to go back to 3.5.0-beta4 to temporarily avoid the issue while still having some of the 3.5 features?
I couldn't find it on the rrf/dsf apt package index.Edit:
I built and installed rrf/dsf/dwc 3.5.0-beta4 but the issue persisted, so I had to stay at 3.4.6 to avoid the macros restarting. -
@tristanryerparke if you haven't already, please upgrade to 3.5.2 and report whether it fixes this issue.
-
@dc42 On 3.5.2 I'm noticing some different behavior.
This time when the user presses pause while themove_x_macro.g
is running, the x axis stops at X=300 and the machine enters a paused state. The macro does not seem to restart upon resuming.
The final line of the macro isG0 X400
which indicates the last movement command is being skipped? I tried adding aG0 X0
to the end of the macro and repeating with the pause, which made the machine stop at X=400. Repeating theG0 X0
did not help either.EDIT:
I tried addingM400
orG4 P1
at the end of the file as workarounds for the last command issue, but this made the restart issue re-emerge.
Can provide logs again if need be.Thanks,
T