Add auto-dismiss-load-dialog service patch#93
Conversation
Auto-dismisses the 'Load filament complete' modal that appears on the
touchscreen at the end of a filament-load cycle, so remote print
queueing isn't blocked by a local OK-tap.
Detection:
- tail /board-resource/log1
- 'feed state change : 0 -> 1' starts a cycle
- 'single_command<M729>' identifies it as a load (load-only gcode)
- 'feed state change : 1 -> 0' ends the cycle; if it was a load,
synthesize a tap.
Action:
- Replay the recorded gt9xxnew_ts tap sequence on /dev/input/event1
at (289, 182) — the OK button on the load-complete dialog.
Files installed via patch.sh into /app/auto-dismiss-load-dialog/ at
firmware-build time, then copied into /opt and started by an
rc.local hook (idempotent, hooked after the bootstrap_oc block).
Tested live on V0.3.0-o, Centauri Carbon CC1.
|
Heads-up before this gets reviewed in earnest: a real-world test on my own printer just turned up a problem. The user did a filament load, walked away, and came back to find the load-complete dialog still on the screen — the daemon hadn't dismissed it. What we do know from logs after the fact:
Things I want to investigate before this is mergeable:
Holding off on iterating in this branch until I've narrowed it down. Happy to push a fix to |
Field-test on V0.3.0-o turned up that 'feed state change : 1 -> 0' fires AFTER the dialog dismisses — it's downstream of the tap, so useless as a trigger (chicken-and-egg). The dialog actually appears at the moment the load gcode completes, which corresponds to 'single_command<M82>' in the log. Both load and unload emit M82 at the end of their gcode, but only loads precede it with 'single_command<M729>', so the existing is_load flag keeps the unload cycle untapped. No discriminator change needed; only the trigger. Live re-tested end-to-end: dialog auto-dismissed without a manual tap. Updates PR description and README to document the corrected detection model. Also adds a comment in S99auto-dismiss explaining why stop() uses pidof + SIGKILL fallback rather than just PIDFILE (defensive against tail-F'ing daemons in disk wait at SIGTERM time).
|
Update — fixed the issue I flagged earlier. Root cause: The dialog actually appears at Re-test, end-to-end: initiated a load from the touchscreen, walked away, came back to find the dialog already dismissed. Daemon's syslog logged Pushed as a separate commit on While I was in there I also added a comment in |
|
Not gonna lie, this feels like the wrong solution to fix this issus. Wouldn't it be better if you can start prints while on that screen by patching out checks? |
Add auto-dismiss-load-dialog service patch
What this does
Auto-dismisses the "Load filament complete" modal that appears on the
touchscreen at the end of a filament-load cycle. With this patch
installed, you can kick off a load and not have to walk back to the printer to tap OK
before queueing the next print.
The unload-complete dialog isn't blocking in the same way; only loads
need this.
How
Service patch under
oc-patches/services/auto-dismiss-load-dialog/.synth-tap— bash +xxdhelper that writes the recordedinput_eventsequence (BTN_TOUCH down → ABS_MT_POSITION_X/Y/MAJOR/WIDTH/TRACKING_ID → SYN_MT_REPORT → SYN_REPORT → 150 ms wait → BTN_TOUCH up → SYN_REPORT) to/dev/input/event1auto-dismiss-daemon—tail -F /board-resource/log1, three-state machine onfeed state change : 0 -> 1/single_command<M729>/feed state change : 1 -> 0, firessynth-tapwhen the cycle completes and was a load (M729 is the discriminator)S99auto-dismiss— entware service wrapper that detaches via subshell + the daemon's owntrap '' HUP(busybox here has neithernohupnorsetsid)patch.shstages the three files into${SQUASHFS_ROOT}/app/auto-dismiss-load-dialog/and adds a hook block to/etc/rc.localthat copies them into/optand starts the service afterbootstrap_ochas finished setting up entware.Detection-signal derivation
Both load and unload end with
feed state change : 1 -> 0, so we can't dismiss based solely on that signal — it'd produce phantom taps after an unload (where the dialog isn't up). Diffing the two gcode sequences from a real cycle:G1 E-60 F240(negative)SET_MIN_EXTRUDE_TEMP S0/RESETG1 E120 F240(positive)M729M729is single-token, atomic, and load-only — much simpler than parsing signed E values or filament-specific heater targets. The daemon flips itsis_loadflag when it seesM729between the start (feed state change : 0 -> 1) and end (feed state change : 1 -> 0) of a cycle, and only taps if the flag is set.Tap coordinates
(289, 182)in thegt9xxnew_tscoordinate space. Captured from a real user tap on V0.3.0-o by reading/dev/input/event1. Held about 13 frames at the same coordinate, then BTN_TOUCH=0 + SYN_REPORT — the synth-tap script replays exactly this shape.Tested on
V0.3.0-o (OpenCentauri based on stock 1.1.40), Centauri Carbon CC1.
Footprint
~6 KB on disk. One bash process tailing a log; idle CPU is negligible. Only writes to
/dev/input/event1when the load-complete signal is observed.Caveats / things to consider
(289, 182)will hit the wrong thing. Ideally the tap coords (and the M729 discriminator) live in env vars exposed at the top of the init script so users can override./dev/input/event1ordinal. The Goodix touchscreen isevent1here; if a future kernel re-enumerates inputs it could shift. The daemon does not currently autodetect by name (e.g., walking/sys/class/input/event*/device/nameforgt9xxnew_ts). Easy to add if the maintainers want it./board-resource/log1is currently a symlink (/board-resource/log -> /board-resource/log1); if log rotation changes this, the daemon'stail -Fshould still follow correctly, but worth noting.bootstrap-ocservice example.I can iterate on any of the above; this is a starting point. Happy to file a separate issue if the team would rather discuss the design first.