fiberpunk1 / Beam-ESP32

Beam by Fiberpunk - ESP32
GNU Affero General Public License v3.0
67 stars 14 forks source link

Status API not responding correctly #10

Open gitley opened 2 years ago

gitley commented 2 years ago

/status while printing normally responds with

ok T:37.60 /140.00 B:24.73 /60.00 @:127 B@:12 ,,SD printing byte 1123/6282205

After a couple of requests by the webUI it starts responding differently. Sometimes it starts responding ok T:37.60 /140.00 B:24.73 /60.00 @:127 B@:127 ,, even though it's printing.

Sometimes it even starts to just respond ,, or too verbose ok T:200.97 /200.00 B:60.36 /60.00 @:61 B@:0 ,ok T B:59.86 /60.00 @:82 B@:0 ,

This behavior also breaks the progress bar in the web UI.

Printer-Firmware: Marlin 2.0.x (for BTT SKR Mini) Node-Firmware: v1.0.7

fiber-punk commented 1 year ago

Thanks for the tip. I found the cause of this bug. It is because when sending "M105" or "M27" to the printer, sometimes the printer cannot return immediately. But http server is responding immediately.

If you are updating the UI, it is more recommended to use websocket or EventSource to monitor the data returned by the serial port, which will be better