luc-github / ESP3D-WEBUI

A Web UI for ESP8266 or ESP32 based boards connected to 3D printers / CNC
GNU General Public License v3.0
747 stars 305 forks source link

[FEATURE REQUEST]Print status panel #239

Closed luc-github closed 2 years ago

luc-github commented 2 years ago

Need to display print status with correspondig informations / commands

luc-github commented 2 years ago

here messages that need to be handled as POC with Marlin, according command or status

For status some are successively displayed - so will display the last one, for other need to refer to terminal output e.g: echo:Homing Failed won't be displayed or very fast because just after Error:Printer halted. kill() called! will be displayed

luc-github commented 2 years ago

Implemented

olivierbarriere commented 2 years ago

It already works great, but would it be possible to handle M31 (time elapsed since the start of the current print job) in the print status panel?

https://reprap.org/wiki/G-code#M31:_Output_time_since_last_M109_or_SD_card_start_to_serial Example M31 The response looks like: echo:54 min, 38 sec

And also maybe an estimate of the remaining time as: remaining = elapsed * (100 - progress) / progress

luc-github commented 2 years ago

How the M31 output looks after 1hour ? and after 1 day?

olivierbarriere commented 2 years ago

The example from reprap showed "min" and "sec" with a comma, but Marlin seems to be using "y", "d", "h", "m" and "s" with spaces. It could be shown as is for the "elapsed time". It only has to be parsed for the computation/estimation of the "remaining time".

Relevant parts from Marlin 2.1 source code:

luc-github commented 2 years ago

Hmm I am not sure if it will be very reliable to detect this output, need to add a regex to detect and extract the value for computation here : https://github.com/luc-github/ESP3D-WEBUI/blob/3.0/src/targets/Printer3D/Marlin/filters.js#L96-L131

I am not sure the computation will be correct as it come from 2 differents outputs with possible delay between them

Also this output should be ignored if no SD print job is on going

EDIT: this regex should to the job: /echo:((?<year>[0-9]*)y\s)*((?<day>[0-9]*)d\s)*((?<hour>[0-9]*)h\s)*((?<min>[0-9]*)m\s)*((?<sec>[0-9]*)s)/ for echo:1y 23d 22h 0m 21s

image

and for echo:22h 0m 21s image

olivierbarriere commented 2 years ago

I just tested on the printer, and the message appears with a "Print time: " description after "echo:" echo:Print time: 9m 57s

That's now an explicit message, and it can be displayed as is in "Print time" in the status panel without the need to match the full regexp. The full regexp is still useful if we want to reconstruct the time in seconds, estimate the remaining time, and back transform it into y/d/h/m/s.

By the way, when there is no print job, the output is echo:Print time: 0s which should be easy to ignore

luc-github commented 2 years ago

doc says it display time if M109 is active, is it the case ?

With echo:Print time: trigger filter will be definitively better

the regex will be also used to be able to translate (Y/d/h/m/s) in other language - which make me think I forget to handle translation for status : https://github.com/luc-github/ESP3D-WEBUI/blob/3.0/src/targets/Printer3D/Marlin/filters.js#L115

luc-github commented 2 years ago

I have implemented the stream support in GRBL webUI - it actully does not support the job progress but the stream progression which is different - so it act exactly as offline controler: image

I will check if this can be improved but I am not sure as in ESP3D the streaming process only react to ok and does not catch/analyze any others answers as WebUI do

Next Week I will add the M31 support for Marlin as I have missed it

luc-github commented 2 years ago

M31 support for Marlin is implemented image

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.