M291 messages ignored by PanelDue
-
@flobler @PaulHew strange, then i don't seem to understand what you are doing...
I have here a couple of tests and I am satisfied with the behavior.
https://github.com/mfs12/endocrine/tree/config-m291-test/macros
@PaulHew I tested m291-s3 ok and cancel behavior with this script.
https://github.com/mfs12/endocrine/blob/config-m291-test/macros/test-m291-s3-cancel.g
It works for me fine with active screensaver and without. The only thing I don't like so much is when the screensaver is active the polling time get's reduced which leads to delays before the message is actually displayed. So keep in mind such a reaction might take up to 10s... ;(
I am considering not to reduce the polling time so things are going to happen more quickly. Let's see.
What would be helpful is simplify your test process so I can better understand your usecase and what mechanic actually fails.
-
@flobler said in M291 messages ignored by PanelDue:
@mfs12 @wilriker I am still seeing very inconsistent behaviour when using M291, especially with messages not being displayed on the PanelDue. Often for information type messages via S0 or S1, that indicate the printer is currently heating or loading or similar.
I upgraded to PanelDue Firmware 3.3 before I did the following tests (I am on 3.3 for both RRF and DWC on my Duet 3 Mini 5+ in standalone mode):
Note: All macros are initiated from the PanelDue
1. M291 S3, followed by M291 S0
M291 P"BED and EXTRUDER will be heated before the procedure starts! Press OK to start or CANCEL to abort!" S3 R"Z OFFSET CALIBRATION" M291 P"Heating..." S0 R"Z OFFSET CALIBRATION"
Both messages show on DWC and PanelDue.
2. M291 S3, followed by M291 S1
M291 P"BED and EXTRUDER will be heated before the procedure starts! Press OK to start or CANCEL to abort!" M291 P"Heating..." S1 R"Z OFFSET CALIBRATION"
Only the second message shows on both PanelDue and DWC, the first message is completely ignored.
3. M291 S3, followed by M291 S2
M291 P"BED and EXTRUDER will be heated before the procedure starts! Press OK to start or CANCEL to abort!" M291 P"Heating..." S2 R"Z OFFSET CALIBRATION"
Only the second message shows on both PanelDue and DWC, the first message is completely ignored.
4. M291 S3, followed by some additional steps, followed by M291 S0
M291 P"BED and EXTRUDER will be heated before the procedure starts! Press OK to start or CANCEL to abort!" S3 R"Z OFFSET CALIBRATION" ; requires user input to continue ; preparation M104 S230 ; set extruder temperature to 230C M140 S70 ; set bed temperature to 70C if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed ; if not all axes are homed G28 ; home all axes else ; if all axes are homed G1 Z{sensors.probes[0].diveHeight} F360 ; move Z axis to probe dive height M561 ; clear any bed transform M290 R0 S0 ; clear babystepping G90 ; absolute positioning G1 X{(move.axes[0].min + move.axes[0].max)/2} Y{(move.axes[1].min + move.axes[1].max)/2} ; move X and Y axis to their center G1 Z5 ; move Z axis 5mm above the bed M564 S0 H0 ; allow movement beyond axis limits defined in config.g M291 P"Heating..." S0 R"Z OFFSET CALIBRATION" ; message to confirm heating G10 P0 S230 ; wait for extruder temperature to reach 230C M190 S70 ; wait for bed temperature to reach 70C M400 ; wait for current moves to finish
The first message shows on both PanelDue and DWC, the second message only in DWC.
5. M291 S3, followed by some additional steps, followed by M291 S1
M291 P"BED and EXTRUDER will be heated before the procedure starts! Press OK to start or CANCEL to abort!" S3 R"Z OFFSET CALIBRATION" ; requires user input to continue ; preparation M104 S230 ; set extruder temperature to 230C M140 S70 ; set bed temperature to 70C if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed ; if not all axes are homed G28 ; home all axes else ; if all axes are homed G1 Z{sensors.probes[0].diveHeight} F360 ; move Z axis to probe dive height M561 ; clear any bed transform M290 R0 S0 ; clear babystepping G90 ; absolute positioning G1 X{(move.axes[0].min + move.axes[0].max)/2} Y{(move.axes[1].min + move.axes[1].max)/2} ; move X and Y axis to their center G1 Z5 ; move Z axis 5mm above the bed M564 S0 H0 ; allow movement beyond axis limits defined in config.g M291 P"Heating..." S1 R"Z OFFSET CALIBRATION" ; message to confirm heating G10 P0 S230 ; wait for extruder temperature to reach 230C M190 S70 ; wait for bed temperature to reach 70C M400 ; wait for current moves to finish
The first message shows on both PanelDue and DWC, the second message only in DWC.
6. M291 S3, followed by some additional steps, followed by M291 S2
M291 P"BED and EXTRUDER will be heated before the procedure starts! Press OK to start or CANCEL to abort!" S3 R"Z OFFSET CALIBRATION" ; requires user input to continue ; preparation M104 S230 ; set extruder temperature to 230C M140 S70 ; set bed temperature to 70C if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed ; if not all axes are homed G28 ; home all axes else ; if all axes are homed G1 Z{sensors.probes[0].diveHeight} F360 ; move Z axis to probe dive height M561 ; clear any bed transform M290 R0 S0 ; clear babystepping G90 ; absolute positioning G1 X{(move.axes[0].min + move.axes[0].max)/2} Y{(move.axes[1].min + move.axes[1].max)/2} ; move X and Y axis to their center G1 Z5 ; move Z axis 5mm above the bed M564 S0 H0 ; allow movement beyond axis limits defined in config.g M291 P"Heating..." S2 R"Z OFFSET CALIBRATION" ; message to confirm heating G10 P0 S230 ; wait for extruder temperature to reach 230C M190 S70 ; wait for bed temperature to reach 70C M400 ; wait for current moves to finish
The first message only shows in DWC, the second message shows on PanelDue and DWC.
This makes it really difficult to create self-explanatory macros for our users as we aim for them to be able to navigate the printer completely from the display on the printer. Without consistent messages I am not sure how to do that though.
Am I still missing an aspect of M291?
@mfs12 these are the tests I have been running with v3.3 and paneldue-3.4.0-pre. The behavior is the same for both.
I will run the test you have linked to and report what happens.
-
Actually looking at it again I have failed to include "S3" in macro 2) and 3) for the initial message. This would totally explain the issues I have been seeing for those two tests.
So the problem seems to be more with what I am doing in the macros 4), 5) and 6) between both messages.
Let me fix this and re-test.
-
@mfs12 ok, so macro 1), 2) and 3) I shared above do work fine now that I fixed them. Apologies for that!
The simplified test macro "test-m291-flobler.g" you shared also seems to work fine.
But if I look at my non-simplified version of it there still seems to be an issue with displaying either of the two "S1" messages that are following the initial "S3" messages.
; filament_load.g ; system file, called to load filament if move.axes[0].homed & move.axes[1].homed & move.axes[2].homed ; if all axes are homed if move.axes[2].machinePosition < 100 ; if Z axis < 100mm G90 ; absolute positioning G1 Z120 F1500 ; lift Z axis to 120mm else ; if Z axis => 100mm G91 ; relative positioning G1 Z10 F1500 H2 ; lift Z axis by 10mm else G1 Z10 F1500 H2 ; lift Z axis by 10mm G90 ; absolute positioning M116 ; wait for hotend temperature to be reached M300 S300 P1000 ; beep sound when temperature is reached M291 P"Do you want to load FILAMENT now? Press OK to continue or CANCEL to abort!" S3 ; requires user input to start the filament loading procedure M291 P"Loading FILAMENT..." S1 T60 ; message confirming that filament is being loaded M83 ; set extruder to relative mode G1 E80 F400 ; quickly feed 80mm of filament G1 E50 F100 ; slowly feed 50mm of filament M400 ; wait for current moves to finish while true ; below 10 iterations repeat the procedure until cancelled if iterations = 10 ; after 10 iterations break the procedure break M291 P"Do you want to load more FILAMENT? Press OK to continue loading or CANCEL to abort!" S3 ; requires user input to start the filament loading procedure M291 P"Loading FILAMENT..." S1 T60 ; message confirming that filament is being loaded G1 E50 F100 ; slowly feed 50mm of filament M400 ; wait for current moves to finish
Both times M291 P"Loading FILAMENT..." S1 T60 are ignored by the PanelDue. They do show on DWC.
-
@mfs12
Thanks for your hard work.I tested your script as is and it does as we expect.
Changed mine to look like yours and it still shutsdown the Pi after hitting cancel.
G4 P500 M291 R"** SHUTDOWN **" P" Are you sure you want to SHUTDOWN the printer and Pi?" S3 G4 S3 M400 M106 P10 S0 M7722 ;G4 P500 ;M291 P"S3 message" S3 ;G4 S3 ;M400 ;M291 P"ok pressed" S1
I honestly do not think it is a PanelDue issue but RRF or DWC.
I re-opened my previous issue because something this simple should just work!Regards,
Paul -
@flobler I think i understand what is happening.
PD has only one popup to display at a time. This means M291 S1 messages are directly overwritten by the following M291 S3 message. And as PD is polling quite slowly it doesn't see the other message.
You could make sleep command of 30s (i think it's G4 S30) followed by M400 after M291 S1 call and see what happens.
M291 S3 P"S3 message" M291 S1 P"S1 message" G4 S30 M400 M291 S3 P"S3 message 2"
-
@paulhew sorry, i have no idea why this is failing... but i agree with you paneldue itself doesn't fail here. At least it looks like it.
-
@mfs12 sorry again for my late reply, I am currently moving and it is difficult to manage work, the move and these topics at the same time.
I tried what you suggested, but all it does is delaying whatever comes after the messages by 30 seconds and still does not display the second message (M291 S1) on the PanelDue (only on DWC).
-
@flobler, "S1 message" is missed. This happens due to paneldue's polling interval of 500ms. If it's reduced to 250ms the "S1 message" is more likely seen. But same issue applies to DWC if a state update of the OM is missed then the message is lost.
@dc42 can this be improved on RRF side somehow so message are always catched?
-
@flobler all messages which don't require any confirmation may be overwritten by any following message.
So if you want to be sure to see a S1 or S0 message which may be followed by another message you best add a timeout after the message, i.e. "G4 S20".
-
@mfs12 I tried that previously in this thread and it did not solve the problem but just caused a 20 second wait with the S1 message still not displaying on the PanelDue.
@flobler said in M291 messages ignored by PanelDue:
@mfs12 sorry again for my late reply, I am currently moving and it is difficult to manage work, the move and these topics at the same time.
I tried what you suggested, but all it does is delaying whatever comes after the messages by 30 seconds and still does not display the second message (M291 S1) on the PanelDue (only on DWC).
I just re-tried and saw the same behavior. This is what I did:
- Test
M291 P"Do you want to load FILAMENT now? Press OK to continue or CANCEL to abort!" S3 ; requires user input to start the filament loading procedure M291 P"Loading FILAMENT..." S1 T60 ; message confirming that filament is being loaded M291 P"Do you want to load FILAMENT now? Press OK to continue or CANCEL to abort!" S3 ; requires user input to start the filament loading procedure
The initial S3 messages pops-up on the PanelDue, I press OK and the following S1 message is being ignored. Instead both PanelDue and DWC direclty jump to the next S3 message.
- Test
M291 P"Do you want to load FILAMENT now? Press OK to continue or CANCEL to abort!" S3 ; requires user input to start the filament loading procedure M291 P"Loading FILAMENT..." S1 T60 ; message confirming that filament is being loaded G4 S30 M400 M291 P"Do you want to load FILAMENT now? Press OK to continue or CANCEL to abort!" S3 ; requires user input to start the filament loading procedure
The initial S3 message pops-up on the PanelDue, I press OK and then the following S1 message is only displayed in DWC and not on PanelDue, after 30 seconds the next S3 message pops-up on both PanelDue and DWC.
Any other ideas? I am setting this back to "unresolved".
Thank you for your help
-
-
@flobler, i ran the following test
If macro is launched from dwc the s1 message is displayed on paneldue.
If macro is launched from paneldue the s1 message is not displayed on paneldue.M291 S3 P"S3 message" M291 S1 P"S1 message" G4 S5 M400 M291 S3 P"S3 message 2"
Log from paneldue when launched from DWC
;dbg 19 FindSeqByKey(555): key ;dbg 19 UpdateSeq(577): state 70 -> 71 ;dbg 19 UpdateSeq(577): volumes 73 -> 74 ;dbg 19 main(2375): requesting state N44 M409 K"state" F"vn"*124 ;dbg 19 ProcessReceivedValue(1563): message S3 message ;dbg 19 main(2248): message updated last action time ;dbg 20 EndReceivedMessage(973): seq state 1 DONE ;dbg 20 main(2375): requesting volumes N45 M409 K"volumes" F"v"*31 ;dbg 20 EndReceivedMessage(973): seq volumes 1 DONE N46 M409 F"d99f"*120 ;dbg 20 FindSeqByKey(555): key ;dbg 21 UpdateSeq(577): state 71 -> 73 ;dbg 21 main(2375): requesting state N47 M409 K"state" F"vn"*127 ;dbg 21 ProcessReceivedValue(1563): message S1 message ;dbg 21 main(2248): message updated last action time ;dbg 21 EndReceivedMessage(973): seq state 1 DONE N48 M409 F"d99f"*118 ;dbg 21 FindSeqByKey(555): key N49 M409 F"d99f"*119 ;dbg 22 FindSeqByKey(555): key N50 M409 F"d99f"*127 ;dbg 22 FindSeqByKey(555): key N51 M409 F"d99f"*126 ;dbg 23 FindSeqByKey(555): key N52 M409 F"d99f"*125 ;dbg 23 FindSeqByKey(555): key N53 M409 F"d99f"*124 ;dbg 24 FindSeqByKey(555): key N54 M409 F"d99f"*123 ;dbg 24 FindSeqByKey(555): key N55 M409 F"d99f"*122 ;dbg 25 FindSeqByKey(555): key N56 M409 F"d99f"*121 ;dbg 25 FindSeqByKey(555): key ;dbg 26 UpdateSeq(577): state 73 -> 74 ;dbg 26 main(2375): requesting state N57 M409 K"state" F"vn"*126 ;dbg 26 ProcessReceivedValue(1563): message S3 message 2 ;dbg 26 main(2248): message updated last action time ;dbg 26 EndReceivedMessage(973): seq state 1 DONE
Log from paneldue when launched from PanelDue
N239 M98 P"0:/macros/test-m291-s3s1-sleep.g"*41 N240 M409 F"d99f"*76 ;dbg 117 FindSeqByKey(555): key ;dbg 118 UpdateSeq(577): state 75 -> 76 ;dbg 118 UpdateSeq(577): volumes 75 -> 76 ;dbg 118 main(2375): requesting state N241 M409 K"state" F"vn"*75 ;dbg 118 ProcessReceivedValue(1563): message S3 message ;dbg 118 main(2248): message updated last action time ;dbg 118 EndReceivedMessage(973): seq state 1 DONE ;dbg 118 main(2375): requesting volumes N242 M409 K"volumes" F"v"*42 ;dbg 119 EndReceivedMessage(973): seq volumes 1 DONE N243 M409 F"d99f"*79 ;dbg 119 FindSeqByKey(555): key N244 M409 F"d99f"*72 ;dbg 120 FindSeqByKey(555): key N245 M409 F"d99f"*73 ;dbg 120 FindSeqByKey(555): key N246 M409 F"d99f"*74 ;dbg 121 FindSeqByKey(555): key N247 M409 F"d99f"*75 ;dbg 121 FindSeqByKey(555): key N248 M409 F"d99f"*68 ;dbg 122 FindSeqByKey(555): key N249 M409 F"d99f"*69 ;dbg 122 FindSeqByKey(555): key ;dbg 122 main(2229): delta 4703 state 1 ;dbg 122 main(2231): pressed N250 M292 P0*109 N251 M409 F"d99f"*76 ;dbg 123 FindSeqByKey(555): key ;dbg 123 UpdateSeq(577): state 76 -> 78 ;dbg 123 main(2375): requesting state N252 M409 K"state" F"vn"*73 ;dbg 124 FindSeqByKey(555): key ;dbg 124 main(2375): requesting state N253 M409 K"state" F"vn"*72 ;dbg 125 FindSeqByKey(555): key ;dbg 125 main(2375): requesting state N254 M409 K"state" F"vn"*79 ;dbg 126 FindSeqByKey(555): key ;dbg 126 main(2375): requesting state N255 M409 K"state" F"vn"*78 ;dbg 127 FindSeqByKey(555): key ;dbg 127 main(2375): requesting state N256 M409 K"state" F"vn"*77 ;dbg 127 FindSeqByKey(555): key ;dbg 128 UpdateSeq(577): state 78 -> 79 ;dbg 128 ProcessReceivedValue(1563): message S3 message 2 ;dbg 128 main(2248): message updated last action time ;dbg 128 EndReceivedMessage(973): seq state 1 DONE ;dbg 128 ProcessReceivedValue(1563): message S3 message 2
To conclude, the sequence number on RRF side increment and when the state seq request is executed the S1 message is not delivered from RRF. To me it looks like an issue on RRF side.
I have to talk to @dc42 about this.
-
@flobler, good news. It looks like we understood the problem so there might be a solution in reach.
-
@mfs12 awesome, thank you very much for investigating!
-
@mfs12 Is this the issue we are talking about here?
https://github.com/Duet3D/PanelDueFirmware/issues/239 -
-
@mfs12 it looks like upgrading everything to 3.4.0 fixed this for me and all messages are now displayed as they should thank you very much for your help along the way!!!
-