[3.6.0-beta3] Macro race condition?
-
I encountered an issue with M291 where the K array seem to sometimes carry over to a subsequent call.
I'm using 3.6.0-beta.3 on Rpi Bookworm with a Mini5+
I do not recall seeing this issue on previous versions.Below is a skeletal macro that exhibits the problem.
To reproduce:
Run the macro and when the first popup appears QUICKLY (I'm not sure how important that is) - select one of the options.
Sometimes (may take 3 or 5 attempts) the next popup appears as below:
Placing a delay
G4 P250
(line 25) between the M291 calls seems to resolve the issue.Test Macro
var P_X_points = 0 var P_Y_points = 0 var set_temp = false M291 R"How Many Probe points" P"Select a number" K{"9","16","64","100","Cancel"} S4 if input == 0 set var.P_X_points = 3 set var.P_Y_points = 3 elif input == 1 set var.P_X_points = 4 set var.P_Y_points = 4 elif input == 2 set var.P_X_points = 8 set var.P_Y_points = 8 elif input == 3 set var.P_X_points = 10 set var.P_Y_points = 10 else abort "Selection cancelled" ; ; Delay to stop issue - comment out to reproduce ;G4 P250 ; M291 R"Hot or Cold Calibration" P"Turn on Heaters" K{"YES","NO","Cancel"} S4 if input == 0 set var.set_temp = true elif input == 1 set var.set_temp = false else abort "Selection cancelled"
-
undefined stuartofmt marked this topic as a question
-
@stuartofmt would it be possible for you to test this on standalone mode easily or is it a lot of faff to change things to do that?
-
@T3P3Tony said in [3.6.0-beta3] Macro race condition?:
@stuartofmt would it be possible for you to test this on standalone mode easily or is it a lot of faff to change things to do that?
Hmm - I'm not sure what would be involved. Move the SD card from Pi to Mini then just power up the mini? Or is there plugging and unplugging etc.?
-
@stuartofmt you would need to make the "SD card" directories in the FAT/boot partition of the SD card (or update the files if the directories are already there). Basically what is in /opt/dsf/sd needs to be copied into the boot partition. Also assign an IP address in that config.g or set to DHCP as appropriate. Alternatively start with a fresh SD card and put copies of the directories there.
With an SD card in the Duet is should boot into Standalone mode.
-
@T3P3Tony
Got it - will try to get it done over the weekend.
I'll just create a new SD card likely the quickest. -
@T3P3Tony
Well, that was fun ... I've moved countries and eventually found the external antenna in a box of bits. It was only then that I realized the Mini5+ is ethernet and said antenna was for something else. The house is wifi only. Getting the printer, safely, to the router in the loft (for an ethernet connection), is a faff too far -
@stuartofmt Thanks for reporting this, I could reproduce it. I'm going to fix this before we release 3.6.0-beta.4.
-
@stuartofmt I've got a fix ready for the upcoming v3.6.0-beta.4. In SBC mode, sometimes DWC wasn't informed about updates of
state.messageBox.choices
. That could only happen whenstate.messageBox
wasn't changed tonull
before another message box with choices was opened. I guess if you add a delay of 250ms or more between theM291
calls, the problem doesn't show up. -
@stuartofmt sorry for the huge faff. I am glad Christian managed to id the issue.
-
@T3P3Tony
No need to be sorry - I had to figure out what else was in the boxes anywayAnd thank you Christian. I though I was seeing things at first
-
undefined stuartofmt has marked this topic as solved
-
@chrishamm @T3P3Tony
I just tested with 3.6.0-beta.4. I can no longer trigger the behavior.Looks good!