luc-github / ESP3D-WEBUI

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

Allow sending blank lines from the MDI (Terminal). #364

Closed terjeio closed 1 year ago

terjeio commented 1 year ago

Is your feature request related to a problem? Please describe. grblHAL repeats the last error until cleared by a blank line or a $-command for safety reasons. The v3 WebUI does not allow sending blank lines from the MDI.

Describe the solution you'd like Allow sending blank lines.

Describe alternatives you've considered Setting grblHAL compatibility level > 0 disables this safety feature alongside some other new features supported by the WebUI - tool changes is at least one prominent one. IMO not a good solution.

Additional context See this OpenBuilds comment onwards.

luc-github commented 1 year ago

what is a blank line ? \n ? "" ? 0x0 ?

because webui send : http://192.168.2.186/command?cmd=(command) I am not sure sending http://192.168.2.186/command?cmd= will work does: http://192.168.2.186/command?cmd=%C2%00 would do the trick ?

Let me know what should work and I wil add it - I also can add a variable if necessary to replace any not printable char

terjeio commented 1 year ago

http://192.168.2.186/command?cmd= works after I modified my backend to test for blank lines. I just forward a newline to the command parser when received.

terjeio commented 1 year ago

http://192.168.2.186/command?cmd=%C2%00 would do the trick ?

Not without further code changes to the backend. I prefer http://192.168.2.186/command?cmd=

luc-github commented 1 year ago

I have modified the webui to allow nothing as test but I forgot it add automaticaly a timestamp to bypass the cache : http://192.168.2.186/command?cmd=&t=1692164825367 does this still work on your backend ?

terjeio commented 1 year ago

Timestamp is ok and I guess needed when there is a proxy in between.

luc-github commented 1 year ago

Can you give a try to : index.html.gz

terjeio commented 1 year ago

Works! Thanks for quick implementation.

luc-github commented 1 year ago

Ok I will push it - I have just changed one thing compare to the version you test : emptyline won't go to history of command because it is not easy to see what command is that

luc-github commented 1 year ago

Implemented in version 39 https://github.com/luc-github/ESP3D-WEBUI/commit/d7238016397823dfff1dece6b3a10beabe9a2d12

luc-github commented 1 year ago

@terjeio you are welcome , it was an easy fix and happy it is useful ^_^

terjeio commented 1 year ago

Again thanks, I'll report the fix in the OpenBuilds thread when I have pushed the change on my end.

github-actions[bot] commented 1 year 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.