luc-github / ESP3D-TFT

ESP3D Firmware for ESP32 based TFT
GNU General Public License v3.0
38 stars 9 forks source link

Gcode host Implementation (Draft) #19

Closed jamespearson04 closed 1 year ago

jamespearson04 commented 1 year ago

This PR will add the functionality for streaming gcode files from the ESP Filesystem and attached SD cards.

It includes the functionality to use pause, resume and abort scripts, either specified in the firmware configuration, or within files specified by the configuration. This could be updated to allow the scripts to be specified via web ui quite easily.

This implementation also handles the queueing of commands whilst waiting for responses, making communication over serial simpler for other threads.

The outward facing interface for the gcodehost module consists of the esp3d client message system (gcodeHostService.process(msg)), and the pause(), resume() and abort() functions. The message data sent to the gcodehost service will be checked to see if it is a file path, if so, the file referred to by it will open and begin streaming over serial. Only one file stream can be queued/in progress, subsequent requests will be ignored. If it is not a file path, it is assumed that it is a command to be sent to the printer. Commands received in this manner will be sent after the next ok response from the printer, so as to allow parameters such as temperature to be updated mid-print. Multiple commands received in this manner will be queued and sent in the order that gcodehost received them, unless it is an EMERGENCY_PARSER command, in which case it will be placed first in the queue.

Currently, line resend requests are not implemented, and better support for error reporting needs to be implemented.

jamespearson04 commented 1 year ago

Update 30/08/23

Goals going forward are:

luc-github commented 1 year ago

@jamespearson04 I have finished UI - so now I will focus on integration of gcode stream service - I will ping you on discord before end of this week

luc-github commented 1 year ago

@all-contributors please add @jamespearson04 for code and ideas update

allcontributors[bot] commented 1 year ago

@luc-github

I've put up a pull request to add @jamespearson04! :tada: