I would like to log each line of G-code to the serial port as it is processed.
Steps to achieve:
- the printer reads a file from the SD card
- each line it reads will be serial logged (this I can't figure out)
- those lines can then read via the serial monitor on a laptop
So by the end of the print, on my laptop I would have the reconstructed G-code file (plus whatever other logs the printer outputs).
The printer runs the Prusa Firmware. Ideally I would like to achieve the logging from altering the firmware rather than adding an extra plugin/server (For understanding and experimenting purposes).
What I tried
I have looked in code and found the print functions and examples of them in use in the code. This line is the "command, which is to be excecuted right now", but I think that would be the just one command not the full line.
The cardreader or SdBaseFile are where I would expect a G-code line to be read such that I could add a print statement after it but I did not see where.
Would it be as easy as setting this card.logging bool to true?
I imagine this is quite an easy thing to do and that I have just overcomplicated it by trying to understand the firmware. Any advice would be great!