Open luc-github opened 6 years ago
some update for command / answer according Firmware:
1 - smoothieware
which is quiet (nowait when idle), use N{New Line Position} M110 to reset, and resend error is rs N
2 - Marlin Kimbra
which is not quiet (send wait when idle), use M110 N{New Line Position} to reset, resend error is Resend:
3 - Marlin
which is quiet (no wait when idle), use M110 N{New Line Position} to reset, resend error is Resend:
4 - Repetier
which is not quiet (send wait when idle), use M110 N{New Line Position} to reset, resend error is Resend:
Basic GCODE host functions are now available they will be used for the autotstart feature, the [ESP700] command and Serial Upload the host features will be improved later if necessary
Next steps to work on for proper gcode host support
a basic GCODE host stream is now in https://github.com/luc-github/ESP3DLib/tree/2-0 it is basic ping/pong command/ack with ok it is no more blocking and it is used by [ESP700], can be used with line script/FS file and SD file
Current limitation:
no resend / busy is handled - need to add conditions to do it
But framework / code base is now ready
"can be used with ... SD file"
How?
by typing the command manually for the moment
[ESP700]/SD/myfile.gco
The latest definition used currently on ESP3D-TFT is here: StreamingService.md
The ping pong streaming service is available in ESP3D-TFT as POC and will be ported to ESP3D once validate
Is to difficult read gcodes from esp3d SD as a macros?
what do you mean ? read gcode is not hard - send gcode is not hard but that is not streaming Streaming is to control the flow of commands, control the response and react accordingly, if error , if timeout, also errors and responses are different for each FW : Marlin / Repetier / Smoothieware / grbl / etc... In addition need to handle user command like PAUSE, filament sensor reporting no more filament, etc it is not difficult but is a lot of possible users cases that need to be handled. also need to handle user send manual commands as well as polling commands from external device like tft or even computer while streaming is ongoing
Macros are suposed to be few gcodes and so currently they are all send blindly at once without checking the response , and because they are only macros, if they failed it is not a big issue - but once gcode host will be implemented they will be handled as any other gcodes
Time to define what host feature will be: Basic description 1 - Read Gcode from SD 2- Send GCODE to printer FW via Serial 3 - Wait for ack 4 - if ack go to 1 / if error go to 2
Now need to clarify each part :
N1 G28
Reset the line numbering is M110 N0 on Repetier / Marlin / Smoothiware 2 - add command checksum for safety (all command char are XOR++checksum calculated) `N20 M10520`ok 20
if error on line number or checksum you getresend 20
Not sure if special command need to be handled (like @pause) right now as it is not a host that have direct UI, but will be when Oled Screen is enabled as well as rotary encoder is supported.
One command is key: Emergency stop, to stop sending commands ans stop printer FW