ESP3D icon indicating copy to clipboard operation
ESP3D copied to clipboard

GcodeHost Implementation

Open jamespearson04 opened this issue 3 years ago • 9 comments
trafficstars

Adds logic to ignore post command and full line comments whilst parsing Gcode from SD or FS through GcodeHost::readNextCommand(), as requested in #785.

If implemented, this renders the function GcodeHost::isCommand() redundant, as all it does is verify that _currentCommand isn't a full line comment, and trims any trailing comments from it.

This approach should reduce memory usage, as comments won't be written into _currentCommand to begin with. May also improve performance, as GcodeHost::readNextCommand() should only set _currentCommand to usable commands. (No extra calls required in the case of full line comments) #

jamespearson04 avatar Jul 21 '22 21:07 jamespearson04

Apologies for the messy commits, but should be understandable.

jamespearson04 avatar Jul 21 '22 21:07 jamespearson04

Thank you, I should be able to review the PR today

luc-github avatar Jul 21 '22 23:07 luc-github

the GcodeHost::isCommand() is now indeed a duplication but I think it can now be used to test if it is Host command (e.g: @pause) vs GCODE

luc-github avatar Jul 22 '22 01:07 luc-github

Got it, makes sense. Since I'm continuing to work on gcode hosting, this push isn't worth it as is, I'll convert it to a draft and update it.

jamespearson04 avatar Jul 22 '22 03:07 jamespearson04

Features added in this push so far:

  • Checksum and line numbering
  • Pause and resume w/ M0 and M108 commands
  • Abort w/ M112 command

Still need to add line resend - ~~If anyone knows where I can get some examples of error messages for missed lines etc please let me know~~

-also fixed ESP701 response message

jamespearson04 avatar Jul 24 '22 22:07 jamespearson04

I did some comments - I did not finished to read all yet but I think there is confusion between:|

  • GCODE commands to be sent to host
  • GCODE commands and Command to be interpreted by Host
  • GCODE commands to be sent to printer FW

luc-github avatar Jul 25 '22 01:07 luc-github

Currently @ commands haven't been implemented. I'm not too familiar with the ESP commands yet, but they appear to function properly, for instance ESP111 prints the IP address in the webui terminal, I'll try and get a screen recording of a test up.

jamespearson04 avatar Jul 25 '22 02:07 jamespearson04

https://user-images.githubusercontent.com/26628667/180682955-90253256-b7ef-4c70-9294-99fba61b68ca.mp4

jamespearson04 avatar Jul 25 '22 02:07 jamespearson04

Did you read my comments in code?

luc-github avatar Jul 25 '22 02:07 luc-github

Hi @jamespearson04, awesome work, what is the status of your branch? Is the feature working? What needs to be done @luc-github for this PR to get merged? Thanks a lot for the hard work.

marianomd avatar Jan 14 '23 05:01 marianomd

need test all gcode provided by Marlin, check which gcode provide ack and which provide data, test each state: processing/busy/heating/error/ack/out of filament/ etc.. and handle accordingly

also handle a possible user commands like @ pause and @ continue

if ok, make all these parameters as variable according FW: Marlin/Repetier/smoothieware

current pr is just at the early beginning, this is not simple task if handled properly

luc-github avatar Jan 14 '23 05:01 luc-github

This feature is actually a project by itself

luc-github avatar Jan 14 '23 05:01 luc-github

Thanks Luc for the detailed explanation. I really like the project, if I find time I will look into this.

marianomd avatar Jan 14 '23 23:01 marianomd

sure, every contribution is welcome ^_^

luc-github avatar Jan 14 '23 23:01 luc-github