I hope I found the problem that generated the malfunction: the filament run-out switch which wasn't positioned correctly; this causes a fast random switching and a false signaling on E0 connector.
Every time this was happen my duet wrote on USB console [c]Resume-after-power-fail state saved <cr><lr>Printing paused[/c]
In my opinion not a very appropriate description since it drove me in the wrong hypothesis of a power failure.
Obviously in the trigger there was a[c]M117 No Filament!!![/c] but I wasn't able to see it because this command write only on web interface (that was malfunctioning due to a firmware bug) and at display that I don't have.
My solution:
I moved the switch closer to the filament in order to avoid fast switching (so the false signaling on E0). Than I added to the trigger code the following line in order to receive the message also on USB console. [c]M118 S"Hello Duet"[/c]
My 2cent:
@dc42 I strongly suggest to replace the [c]Resume-after-power-fail state saved <cr><lr>Printing paused[/c] message with something that can't be associated so easily to a real power issue.
PS: I'm using this Filament Detector: https://www.thingiverse.com/thing:2629228</lr></cr></lr></cr>